Service - Payment Method Manager: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| (10 intermediate revisions by the same user not shown) | |||
| Line 8: | Line 8: | ||
https://bitbucket.org/izara-market-products/izara-market-products-payment-method-manager/src/master/ | https://bitbucket.org/izara-market-products/izara-market-products-payment-method-manager/src/master/ | ||
= Schemas = | |||
==ObjectSchemas== | |||
===paymentMethod=== | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "paymentMethod", | |||
"canDelete": false, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
}, | |||
"dynamoDB": { | |||
"storageType": "dynamoDB", | |||
"tableName": "PaymentMethodRecords", | |||
"serviceTag": "PaymentMethodManager" | |||
} | |||
}, | |||
"fieldNames": { | |||
"paymentMethodId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"storageResourceTags": ["dynamoDB","graph"], | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$"} | |||
}, | |||
"paymentMethodHandlerServiceNameTag": { | |||
"type": "string", | |||
"randomOnCreate": false, | |||
"requiredOnCreate": true, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"storageResourceTags": ["dynamoDB"], | |||
"validation": { "pattern": "^[a-zA-Z0-9-_]+$"}} | |||
}, | |||
"currencyId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"storageResourceTags": ["dynamoDB"], | |||
"validation": { "pattern": "^[a-zA-Z0-9-_]+$"}} | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "paymentMethodId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript" inline>currencyId</syntaxhighlight>:is uuid and connect translations declere currency eg:"THB" ect. | |||
=== userPaymentMethod === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "userPaymentMethod", | |||
"canDelete": false, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
}, | |||
"dynamoDB": { | |||
"storageType": "dynamoDB", | |||
"tableName": "UserPaymentMethodsRecords", | |||
"serviceTag": "PaymentMethodManager" | |||
} | |||
}, | |||
"fieldNames": { | |||
"userPaymentMethodId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"storageResourceTags": [ | |||
"dynamoDB", | |||
"graph" | |||
], | |||
"validation": {"pattern": "^[a-zA-Z0-9-_]+$"} | |||
}, | |||
"paymentMethodHandlerServiceNameTag": { | |||
"type": "string", | |||
"randomOnCreate": false, | |||
"requiredOnCreate": true, | |||
"optionalOnCreate": false, | |||
"canUpdate": true, | |||
"storageResourceTags": [ | |||
"dynamoDB" | |||
], | |||
"validation": {"pattern": "^[a-zA-Z0-9-_]+$"} | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "userPaymentMethodId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
== RelationshipSchemas == | |||
=== isPaymentMethod === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "PaymentMethodManager", | |||
"fieldNames": { | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"serviceTag": "PaymentMethodManager", | |||
"objectType": "userPaymentMethod" | |||
}, | |||
"requiredOnCreate": true, | |||
"linkType": "many", | |||
"handler": true | |||
}, | |||
"to": { | |||
"objType": { | |||
"serviceTag": "PaymentMethodManager", | |||
"objectType": "paymentMethod" | |||
}, | |||
"linkType": "one", | |||
"handler": true, | |||
"requiredOnCreate": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
= DynamoDB tables = | = DynamoDB tables = | ||
| Line 33: | Line 198: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | == paymentMethod == | ||
Records which Handler manages each payment method | Records which Handler manages each payment method | ||
| Line 39: | Line 204: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
paymentMethodId | paymentMethodId, | ||
currencyId, | |||
paymentMethodHandlerServiceNameTag | paymentMethodHandlerServiceNameTag | ||
} | } | ||
Latest revision as of 07:06, 24 November 2025
Overview
Each payment method is handled by a Service - Payment Method (handlers) service, with Service - Payment Method Generic taking all new/simple payment methods.
The Payment Method Manager service handles shared orchestration of the Payment Method Handler services.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-payment-method-manager/src/master/
Schemas
ObjectSchemas
paymentMethod
{
"objectType": "paymentMethod",
"canDelete": false,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
},
"dynamoDB": {
"storageType": "dynamoDB",
"tableName": "PaymentMethodRecords",
"serviceTag": "PaymentMethodManager"
}
},
"fieldNames": {
"paymentMethodId": {
"type": "string",
"randomOnCreate": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"storageResourceTags": ["dynamoDB","graph"],
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"}
},
"paymentMethodHandlerServiceNameTag": {
"type": "string",
"randomOnCreate": false,
"requiredOnCreate": true,
"optionalOnCreate": false,
"canUpdate": false,
"storageResourceTags": ["dynamoDB"],
"validation": { "pattern": "^[a-zA-Z0-9-_]+$"}}
},
"currencyId": {
"type": "string",
"randomOnCreate": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"storageResourceTags": ["dynamoDB"],
"validation": { "pattern": "^[a-zA-Z0-9-_]+$"}}
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "paymentMethodId"
}
],
"generatedBy": "userGenerated"
}
currencyId:is uuid and connect translations declere currency eg:"THB" ect.
userPaymentMethod
{
"objectType": "userPaymentMethod",
"canDelete": false,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
},
"dynamoDB": {
"storageType": "dynamoDB",
"tableName": "UserPaymentMethodsRecords",
"serviceTag": "PaymentMethodManager"
}
},
"fieldNames": {
"userPaymentMethodId": {
"type": "string",
"randomOnCreate": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"storageResourceTags": [
"dynamoDB",
"graph"
],
"validation": {"pattern": "^[a-zA-Z0-9-_]+$"}
},
"paymentMethodHandlerServiceNameTag": {
"type": "string",
"randomOnCreate": false,
"requiredOnCreate": true,
"optionalOnCreate": false,
"canUpdate": true,
"storageResourceTags": [
"dynamoDB"
],
"validation": {"pattern": "^[a-zA-Z0-9-_]+$"}
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "userPaymentMethodId"
}
],
"generatedBy": "userGenerated"
}
RelationshipSchemas
isPaymentMethod
{
"relationshipServiceTag": "PaymentMethodManager",
"fieldNames": {
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"serviceTag": "PaymentMethodManager",
"objectType": "userPaymentMethod"
},
"requiredOnCreate": true,
"linkType": "many",
"handler": true
},
"to": {
"objType": {
"serviceTag": "PaymentMethodManager",
"objectType": "paymentMethod"
},
"linkType": "one",
"handler": true,
"requiredOnCreate": false
},
"canDelete": false
}
],
"canMove": false
}
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "ProductGraphServiceName"
configTag: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configKey: "PaymentMethodHandlerService"
configTag: xxx // paymentMethodHandlerServiceNameTag, eg: "PaymentMethodGeneric"
configValue: {
serviceName: xxx // eg: "PaymentMethodGeneric", this is the actual deployed service name
}
}
paymentMethod
Records which Handler manages each payment method
{
paymentMethodId,
currencyId,
paymentMethodHandlerServiceNameTag
}
- partition key: paymentMethodId
- sort key: (none)
- all Handler services are expected to create a paymentMethod node in the shared Products graph
UserPaymentMethods
Records which Handler manages each user payment method
{
userPaymentMethodId
paymentMethodHandlerServiceNameTag
}
- partition key: userPaymentMethodId
- sort key: (none)
- all Handler services are expected to create a userPaymentMethod node in the shared Products graph
Complex Filter requests
- Not yet used at the Manager level, would send requests to all handlers, could perhaps setup to automatically pass on processLogical requests to all handlers, and not have a processLogical function in the Manager service
{
filterType: "managerPaymentMethod" //unique id is paymentMethodId
type: "group",
elements:
[
{
type: "logical",
logicalTag: "currencyId",
comparison: "equals",
value: "xx"
},
{
type: "complexFilter",
complexFilter: {
filterType: "paymentMethodProperty",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "paymentMethodNameTranslation" //unique id is paymentMethodId
type: "group",
elements:
[
{
// see [[Service - Translations|Complex Filter requests]]
type: "logical",
logicalTag: "textTag_languageId_text",
resultType: "paymentMethod",
textTag: "paymentMethodName",
languageId: "en",
text: "Is a great term",
subjectIdentifierPropertyName: "paymentMethodId",
caseSensitive: true
},
]
}
},
...
]
}
{
filterType: "managerUserPaymentMethod" //unique id is userPaymentMethodId
type: "group",
elements:
[
{
type: "logical",
logicalTag: "paymentMethodId",
comparison: "equals",
value: "xx"
},
{
type: "complexFilter",
complexFilter: {
filterType: "managerPaymentMethod",
// see above
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "userPaymentMethodProperty",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "userPaymentMethodSaleProperty",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
}
},
...
]
}