Service - Payment Method Manager: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by 2 users not shown)
Line 9: Line 9:
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/


= DynamoDB tables =
= Schemas =
 
==ObjectSchemas==
== [[Standard Config Table Per Service]] ==
===paymentMethod===
 
=== Configuration tags ===
 
<syntaxhighlight lang="JavaScript">
{
configKey: "ProductGraphServiceName"
configTag: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
</syntaxhighlight>
 
<syntaxhighlight lang="JavaScript">
{
configKey: "PaymentMethodHandlerService"
configTag: xxx // paymentMethodHandlerServiceNameTag, eg: "PaymentMethodGeneric"
configValue: {
serviceName: xxx // eg: "PaymentMethodGeneric", this is the actual deployed service name
}
}
</syntaxhighlight>
 
== PaymentMethodRecord ==
 
Records which Handler manages each payment method
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
paymentMethodId,
  "objectType": "paymentMethod",
     currencyId,
  "canDelete": false,
paymentMethodHandlerServiceNameTag
  "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>
<syntaxhighlight lang="JavaScript" inline>currencyId</syntaxhighlight>:is uuid and connect translations declere currency eg:"THB" ect.


* partition key: paymentMethodId
=== userPaymentMethod ===
* 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
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
userPaymentMethodId
  "objectType": "userPaymentMethod",
paymentMethodHandlerServiceNameTag
  "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>
</syntaxhighlight>


* partition key: userPaymentMethodId
== RelationshipSchemas ==
* 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
<syntaxhighlight lang="JavaScript">
{
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
},
]
}
},
...
]
}
</syntaxhighlight>


=== isPaymentMethod ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
filterType: "managerUserPaymentMethod" //unique id is userPaymentMethodId
  "relationshipServiceTag": "PaymentMethodManager",
type: "group",
  "fieldNames": {},
elements:
  "storageResources": {
[
    "graph": {
{
      "storageType": "graph",
type: "logical",
      "graphServerTag": "GraphHandler"
logicalTag: "paymentMethodId",
    }
comparison: "equals",
  },
value: "xx"
  "links": [
},
    {
{
      "storageResourceTags": [
type: "complexFilter",
        "graph"
complexFilter: {
      ],
filterType: "managerPaymentMethod",
      "from": {
// see above
        "objType": {
}
          "serviceTag": "PaymentMethodManager",
},
          "objectType": "userPaymentMethod"
{
        },
type: "complexFilter",
        "requiredOnCreate": true,
complexFilter: {
        "linkType": "many",
filterType: "userPaymentMethodProperty",
        "handler": true
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
      },
}
      "to": {
},
        "objType": {
{
          "serviceTag": "PaymentMethodManager",
type: "complexFilter",
          "objectType": "paymentMethod"
complexFilter: {
        },
filterType: "userPaymentMethodSaleProperty",
        "linkType": "one",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
        "handler": true,
}
        "requiredOnCreate": false
},
      },
...
      "canDelete": false
]
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 08:49, 13 January 2026

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": {},
  "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
}

Working documents

Payment Method Manager