Service - Payment Method Generic: Difference between revisions
Jump to navigation
Jump to search
(→Nodes) |
No edit summary |
||
Line 87: | Line 87: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* adds a node between a user and a payment method | * adds a node between a user and a payment method | ||
* this is the node linked to by | * this is the node linked to by sellOfferPlans | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
Line 95: | Line 95: | ||
{ | { | ||
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | ||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | |||
} | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
nodeLabel: "{PaymentMethodGenericLib. | nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel", // userPaymentMethodSalePropertyLabel | ||
} | } | ||
{ | { | ||
nodeLabel: "{PaymentMethodGenericLib. | nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property", | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* see [[NPM module - Izara Core - Property Node|DataSchemaLib]] | * see [[NPM module - Izara Core - Property Node|DataSchemaLib]] | ||
* two sets of property nodes, one for presentation properties (when browsing), paymentMethodSale for after sale, properties that get sent to the buyer, eg bank account number | * two sets of property nodes for userPaymentMethod, one for presentation properties (when browsing), paymentMethodSale for after sale, properties that get sent to the buyer, eg bank account number | ||
=== Relationships === | === Relationships === | ||
Line 125: | Line 134: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
relationshipType: "{PaymentMethodGenericLib. | relationshipType: "{PaymentMethodGenericLib.createIsUserPaymentMethodGraphRelationshipType()}", // "is_userPaymentMethod" | ||
schema: { | schema: { | ||
elementCanBeRemoved: false, | elementCanBeRemoved: false, | ||
Line 146: | Line 155: | ||
{ | { | ||
relationshipType: "is_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | relationshipType: "is_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | ||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
{ | |||
relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
{ | |||
relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
relationshipType: "has_{PaymentMethodGenericLib. | relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property", | ||
} | } | ||
{ | { | ||
relationshipType: "disabled_{PaymentMethodGenericLib. | relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property", | ||
} | } | ||
{ | { | ||
relationshipType: "is_{PaymentMethodGenericLib. | relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel", | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 11:28, 7 November 2021
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,
},
currencyId: {
immutable: true, // currently not have data model for allowing this to be changed, is immutable
},
},
}
}
{
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 sellOfferPlans
{
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel", // userPaymentMethodSalePropertyLabel
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property",
}
- see DataSchemaLib
- two sets of property nodes for userPaymentMethod, one for presentation properties (when browsing), paymentMethodSale for after sale, properties that get sent to the buyer, eg bank account number
Relationships
{
relationshipType: "{PaymentMethodGenericLib.createIsPaymentMethodGraphRelationshipType()}", // "is_paymentMethod"
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{PaymentMethodGenericLib.createIsUserPaymentMethodGraphRelationshipType()}", // "is_userPaymentMethod"
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",
}
{
relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property",
}
{
relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property",
}
{
relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel",
}
- see DataSchemaLib
Basic node schemas
{
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}", // "paymentMethod"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
paymentMethodId: {
identifier: true,
},
paymentMethodHandlerServiceNameTag: {
immutable: true,
},
},
}
}
Schema comes from BasicNodeSchemaLib
- paymentMethodPropertyLabel
- paymentMethodProperty
- paymentMethodSalePropertyLabel
- paymentMethodSaleProperty
Data structure notes
- Users can create new paymentMethods which are uniquely identified by their translation
- Users can create userPaymentMethod nodes for their account which connect to paymentMethods, one user can have multiple userPaymentMethod links to the same paymentMethod, eg different Bank Transfer nodes for different bank accounts, which can be applied to sell offers in any combination