@t-0/provider-starter-ts 1.1.14 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/template/package.json +1 -1
- package/template/src/confirm_funds_received.ts +2 -2
- package/template/src/create_payment_intent.ts +4 -4
- package/template/src/get_payment_intent_quote.ts +3 -3
- package/template/src/service.ts +1 -1
- package/template/tsconfig.typecheck.json +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t-0/provider-starter-ts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.16",
|
|
4
4
|
"description": "CLI tool to scaffold a Node.js t-0 Network integration service",
|
|
5
5
|
"main": "dist/create.js",
|
|
6
6
|
"bin": {
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"chalk": "^5.6.2",
|
|
34
34
|
"commander": "^14.0.3",
|
|
35
35
|
"fs-extra": "^11.3.4",
|
|
36
|
-
"inquirer": "^13.
|
|
36
|
+
"inquirer": "^13.4.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/fs-extra": "^11.0.4",
|
|
40
40
|
"@types/inquirer": "^9.0.9",
|
|
41
|
-
"@types/node": "^25.
|
|
42
|
-
"typescript": "^6.0.
|
|
41
|
+
"@types/node": "^25.6.0",
|
|
42
|
+
"typescript": "^6.0.3"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/template/package.json
CHANGED
|
@@ -18,12 +18,12 @@ export default async function confirmFundsReceived(
|
|
|
18
18
|
// optional: if your provider has multiple legal entities, set originatorProviderLegalEntityId
|
|
19
19
|
})
|
|
20
20
|
|
|
21
|
-
switch (response.
|
|
21
|
+
switch (response.result.case) {
|
|
22
22
|
case 'accept':
|
|
23
23
|
console.log(`Funds accepted for payment intent ${paymentIntentId}`)
|
|
24
24
|
break;
|
|
25
25
|
case 'reject':
|
|
26
|
-
console.log(`Funds rejected for payment intent ${paymentIntentId}: ${response.
|
|
26
|
+
console.log(`Funds rejected for payment intent ${paymentIntentId}: ${response.result.value.reason}`)
|
|
27
27
|
break;
|
|
28
28
|
default:
|
|
29
29
|
console.error("unexpected result type")
|
|
@@ -19,17 +19,17 @@ export default async function createPaymentIntent(
|
|
|
19
19
|
},
|
|
20
20
|
})
|
|
21
21
|
|
|
22
|
-
switch (response.
|
|
22
|
+
switch (response.result.case) {
|
|
23
23
|
case 'success':
|
|
24
24
|
console.log(
|
|
25
|
-
`Created payment intent id=${response.
|
|
26
|
-
`with ${response.
|
|
25
|
+
`Created payment intent id=${response.result.value.paymentIntentId}`,
|
|
26
|
+
`with ${response.result.value.payInDetails.length} pay-in option(s)`,
|
|
27
27
|
)
|
|
28
28
|
// TODO: persist (paymentIntentId, externalReference) and present the
|
|
29
29
|
// payInDetails options to your end-user.
|
|
30
30
|
break;
|
|
31
31
|
case 'failure':
|
|
32
|
-
console.log(`Failed to create payment intent: ${response.
|
|
32
|
+
console.log(`Failed to create payment intent: ${response.result.value.reason}`)
|
|
33
33
|
break;
|
|
34
34
|
default:
|
|
35
35
|
console.error("unexpected result type")
|
|
@@ -12,11 +12,11 @@ export default async function getPaymentIntentQuote(
|
|
|
12
12
|
amount: toProtoDecimal(500, 0), // end-user pays 500 EUR
|
|
13
13
|
})
|
|
14
14
|
|
|
15
|
-
switch (response.
|
|
15
|
+
switch (response.result.case) {
|
|
16
16
|
case 'success':
|
|
17
17
|
console.log(
|
|
18
|
-
`Got ${response.
|
|
19
|
-
`and ${response.
|
|
18
|
+
`Got ${response.result.value.bestQuotes.length} best pay-in quotes`,
|
|
19
|
+
`and ${response.result.value.allQuotes.length} total quotes`,
|
|
20
20
|
)
|
|
21
21
|
break;
|
|
22
22
|
case 'quoteNotFound':
|
package/template/src/service.ts
CHANGED
|
@@ -69,7 +69,7 @@ const CreateProviderService = (networkClient: Client<typeof NetworkService>) =>
|
|
|
69
69
|
return {} as AppendLedgerEntriesResponse
|
|
70
70
|
},
|
|
71
71
|
|
|
72
|
-
async
|
|
72
|
+
async approvePaymentQuotes(req: ApprovePaymentQuoteRequest, _: HandlerContext) {
|
|
73
73
|
// TODO: when the payment goes through the Manual AML Check on the pay-out provider side, the provider submitted the payment will have a last look to approve final quote
|
|
74
74
|
// The request includes payOutFix — the fixed charge in USD for this payout.
|
|
75
75
|
// Consider it alongside payOutRate and payOutAmount when deciding to accept.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
// CI-only typecheck config used by .github/workflows/ci.yaml to validate
|
|
3
|
+
// this template against the local SDK before publishing. The shipped
|
|
4
|
+
// tsconfig.json uses module=commonjs (matching providers' typical Node
|
|
5
|
+
// runtime deployments) which conflicts with moduleResolution=bundler
|
|
6
|
+
// (TS5095). This override flips module to esnext so tsc can run; it is
|
|
7
|
+
// not used at build/runtime by providers and is safe to ignore or delete
|
|
8
|
+
// in a scaffolded project.
|
|
9
|
+
"extends": "./tsconfig.json",
|
|
10
|
+
"compilerOptions": {
|
|
11
|
+
"module": "esnext"
|
|
12
|
+
}
|
|
13
|
+
}
|