Service - Payment Method Generic

From Izara Wiki
Revision as of 09:47, 18 October 2021 by Sven the Barbarian (talk | contribs)
Jump to navigation Jump to search

Overview

Handler service for any otherwise un-handled payment methods.

Repository

https://bitbucket.org/izara-market-products/izara-market-products-payment-method-generic/src/master/

DynamoDB tables

Standard Config Table Per Service

Configuration tags

{
	configTag: "PaymentMethodHandlerServiceNameTag"
	configKey: "PaymentMethodHandlerServiceNameTag"
	configValue: xxx // this own services ServiceNameTag, eg "PaymentMethodGeneric"
}
{
	configTag: "ProductGraphServiceName"
	configKey: "ProductGraphServiceName"
	configValue: xxx // eg: "ProductGraph"
}
{
	configTag: "PaymentMethodManagerServiceName"
	configKey: "PaymentMethodManagerServiceName"
	configValue: xxx // eg: "PaymentMethodManager"
}

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}", // "paymentMethod"
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			paymentMethodId: {
				identifier: true, // create unique id from translation
			},
			paymentMethodHandlerServiceNameTag: {
				immutable: true,
			},
		},
	}
}
{
	nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}", // "userPaymentMethod"
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			userPaymentMethodId: {
				identifier: true, // create unique id from user and uniqueMessageId
			},
			paymentMethodHandlerServiceNameTag: {
				immutable: true,
			},
			paymentMethodId: { // stored here to reduce queries finding matching methods, eg sellOffers
				immutable: true,
			},
		},
	}
}
  • adds a node between a user and a payment method
  • this is the node linked to by sellOffers
{
	nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
	nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}

Relationships

{
	relationshipType: "{PaymentMethodGenericLib.createIsPaymentMethodGraphRelationshipType()}", // "isPaymentMethod"
	schema: {
		elementCanBeRemoved: false,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
		},
	}
}
{
	relationshipType: "has_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
	relationshipType: "disabled_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
	relationshipType: "is_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}

Basic node schemas

Schema comes from BasicNodeSchemaLib

  1. paymentMethodPropertyLabel
  2. paymentMethodProperty

Working documents

Payment Method Generic