Service - Payment Method Manager: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 10: Line 10:


= Schemas =
= Schemas =
==paymentMethod==
==ObjectSchemas==
===paymentMethod===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
Line 34: Line 35:
       "canUpdate": false,
       "canUpdate": false,
       "storageResourceTags": ["dynamoDB","graph"],
       "storageResourceTags": ["dynamoDB","graph"],
       "validation": {}
       "validation": {
          "pattern": "^[a-zA-Z0-9-_]+$"}
     },
     },
     "paymentMethodHandlerServiceNameTag": {
     "paymentMethodHandlerServiceNameTag": {
Line 43: Line 45:
       "canUpdate": false,
       "canUpdate": false,
       "storageResourceTags": ["dynamoDB"],
       "storageResourceTags": ["dynamoDB"],
       "validation": {}
       "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-_]+$"}}
     }
     }
   },
   },
Line 55: Line 66:
}
}
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="JavaScript" inline>currencyId</syntaxhighlight>:is uuid and connect translations declere currency eg:"THB" ect.


 
=== userPaymentMethod ===
 
 
= DynamoDB tables =
 
== [[Standard Config Table Per Service]] ==
 
=== Configuration tags ===
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
configKey: "ProductGraphServiceName"
  "objectType": "userPaymentMethod",
configTag: "ProductGraphServiceName"
  "canDelete": false,
configValue: xxx // eg: "ProductGraph"
  "storageResources": {
}
    "graph": {
</syntaxhighlight>
      "storageType": "graph",
 
      "graphServerTag": "GraphHandler"
<syntaxhighlight lang="JavaScript">
    },
{
    "dynamoDB": {
configKey: "PaymentMethodHandlerService"
      "storageType": "dynamoDB",
configTag: xxx // paymentMethodHandlerServiceNameTag, eg: "PaymentMethodGeneric"
      "tableName": "UserPaymentMethodsRecords",
configValue: {
      "serviceTag": "PaymentMethodManager"
serviceName: xxx // eg: "PaymentMethodGeneric", this is the actual deployed service name
    }
}
  },
  "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>


== paymentMethod ==
== RelationshipSchemas ==


Records which Handler manages each payment method


=== isPaymentMethod ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
paymentMethodId,
  "relationshipServiceTag": "PaymentMethodManager",
    currencyId,
  "fieldNames": {},
paymentMethodHandlerServiceNameTag
  "storageResources": {
}
    "graph": {
</syntaxhighlight>
      "storageType": "graph",
 
      "graphServerTag": "GraphHandler"
* partition key: paymentMethodId
    }
* sort key: (none)
  },
* all Handler services are expected to create a paymentMethod node in the shared Products graph
  "links": [
 
    {
== UserPaymentMethods ==
      "storageResourceTags": [
 
        "graph"
Records which Handler manages each user payment method
      ],
 
      "from": {
<syntaxhighlight lang="JavaScript">
        "objType": {
{
          "serviceTag": "PaymentMethodManager",
userPaymentMethodId
          "objectType": "userPaymentMethod"
paymentMethodHandlerServiceNameTag
        },
}
        "requiredOnCreate": true,
</syntaxhighlight>
        "linkType": "many",
 
        "handler": true
* partition key: userPaymentMethodId
      },
* sort key: (none)
      "to": {
* all Handler services are expected to create a userPaymentMethod node in the shared Products graph
        "objType": {
 
          "serviceTag": "PaymentMethodManager",
= Complex Filter requests =
          "objectType": "paymentMethod"
 
        },
* 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
        "linkType": "one",
 
        "handler": true,
<syntaxhighlight lang="JavaScript">
        "requiredOnCreate": false
{
      },
filterType: "managerPaymentMethod" //unique id is paymentMethodId
      "canDelete": false
type: "group",
    }
elements:
  ],
[
  "canMove": false
{
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