Service - Payment Method Manager: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by 2 users not shown)
Line 10: Line 10:


= Schemas =
= Schemas =
==paymentMethod==
==ObjectSchemas==
===paymentMethod===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
Line 48: Line 49:
     "currencyId": {
     "currencyId": {
       "type": "string",
       "type": "string",
       "randomOnCreate": false,
       "randomOnCreate": true,
       "requiredOnCreate": true,
       "requiredOnCreate": false,
       "optionalOnCreate": false,
       "optionalOnCreate": false,
       "canUpdate": false,
       "canUpdate": false,
Line 65: Line 66:
}
}
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="JavaScript" inline>currencyId</syntaxhighlight>:is uuid and connect translations declere currency eg:"THB" ect.


== userPaymentMethod ==
=== userPaymentMethod ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
Line 117: Line 119:
</syntaxhighlight>
</syntaxhighlight>


= DynamoDB tables =
== RelationshipSchemas ==


== [[Standard Config Table Per Service]] ==
=== Configuration tags ===


=== isPaymentMethod ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
configKey: "ProductGraphServiceName"
  "relationshipServiceTag": "PaymentMethodManager",
configTag: "ProductGraphServiceName"
  "fieldNames": {},
configValue: xxx // eg: "ProductGraph"
  "storageResources": {
}
    "graph": {
</syntaxhighlight>
      "storageType": "graph",
 
      "graphServerTag": "GraphHandler"
<syntaxhighlight lang="JavaScript">
    }
{
  },
configKey: "PaymentMethodHandlerService"
  "links": [
configTag: xxx // paymentMethodHandlerServiceNameTag, eg: "PaymentMethodGeneric"
    {
configValue: {
      "storageResourceTags": [
serviceName: xxx // eg: "PaymentMethodGeneric", this is the actual deployed service name
        "graph"
}
      ],
}
      "from": {
</syntaxhighlight>
        "objType": {
 
          "serviceTag": "PaymentMethodManager",
== paymentMethod ==
          "objectType": "userPaymentMethod"
 
        },
Records which Handler manages each payment method
        "requiredOnCreate": true,
 
        "linkType": "many",
<syntaxhighlight lang="JavaScript">
        "handler": true
{
      },
paymentMethodId,
      "to": {
    currencyId,
        "objType": {
paymentMethodHandlerServiceNameTag
          "serviceTag": "PaymentMethodManager",
}
          "objectType": "paymentMethod"
</syntaxhighlight>
        },
 
        "linkType": "one",
* partition key: paymentMethodId
        "handler": true,
* sort key: (none)
        "requiredOnCreate": false
* all Handler services are expected to create a paymentMethod node in the shared Products graph
      },
 
      "canDelete": false
== UserPaymentMethods ==
    }
 
  ],
Records which Handler manages each user payment method
  "canMove": false
 
<syntaxhighlight lang="JavaScript">
{
userPaymentMethodId
paymentMethodHandlerServiceNameTag
}
</syntaxhighlight>
 
* 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
 
<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>
 
<syntaxhighlight lang="JavaScript">
{
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]]
}
},
...
]
}
}
</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