Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Resources follow the pattern `fintoc [v2] <resource> <action> [args] [flags]`. A
| `v2 entities` | create, get, list, settlement_account |
| `v2 onboardings` | create, get, list, submit, upload_document, add_document, delete_document, upload_shareholder_document, upload_legal_representative_document |
| `v2 payment_intents` | create, get, list, cancel, voucher_url, check_eligibility |
| `v2 payment_methods` | create, get, list, cancel, mandate_document |
| `v2 payment_methods` | create, get, list, cancel, mandate_document, installments |
| `v2 products` | create, get, list, update |
| `v2 subscriptions` | create, get, list, update, cancel, detach_payment_method |
| `v2 invoices` | create, get, list, update, finalize, pay, void, mark_uncollectible, add_lines, remove_lines |
Expand All @@ -126,7 +126,7 @@ Resources follow the pattern `fintoc [v2] <resource> <action> [args] [flags]`. A
| `v2 simulate` | receive_transfer |
| `v2 crossborder_beneficiaries` | create, get, list, delete |
| `v2 crossborder_quotes` | create, get |
| `v2 crossborder_transfers` | create, get, list |
| `v2 crossborder_transfers` | create, get, list, cancel, simulate_credit |

`organizations create` preserves the published `--products <json>` and `--metadata <json>` flags. Updating organizations requires a future SDK release; fintoc 1.31.0 only supports creation.

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@inquirer/prompts": "^8.4.2",
"commander": "^14.0.3",
"es-toolkit": "^1.46.1",
"fintoc": "^1.33.0",
"fintoc": "^1.35.0",
"smol-toml": "^1.6.1",
"ws": "^8.20.0",
"zod": "^4.4.3"
Expand Down
21 changes: 21 additions & 0 deletions src/resources/__tests__/registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,27 @@ describe('resource registry', () => {
}
})

test('v2 payment_methods installments is a read that requires amount and currency', () => {
const installments = find('payment_methods', 'v2').actions!.find(
(a) => a.name === 'installments',
)!
expect(installments.sdkMethod).toBe('installments')
expect(installments.kind).toBe('read')
expect(installments.flags!.filter((f) => f.required).map((f) => f.name)).toEqual([
'amount',
'currency',
])
})

test.each([
['cancel', 'cancel'],
['simulate_credit', 'simulateCredit'],
])('v2 crossborder_transfers %s is an idempotent write', (name, sdkMethod) => {
const action = find('crossborder_transfers', 'v2').actions!.find((a) => a.name === name)!
expect(action.sdkMethod).toBe(sdkMethod)
expect(action.idempotencyKey).toBe(true)
})

test('payment_methods create requires the four consent documents as files', () => {
const files = find('payment_methods', 'v2').createFiles!
expect(files.map((f) => f.field)).toEqual([
Expand Down
56 changes: 56 additions & 0 deletions src/resources/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,18 @@ export const resources: ResourceDef[] = [
required: true,
description: 'ID of the payment method to charge',
},
{
name: 'off-session',
type: 'boolean',
description:
'Charge while the customer is absent (defaults to true; false only for CLP card payments in Chile)',
},
{
name: 'card-installments',
type: 'integer',
nestedPath: 'payment_method_options.card.installments',
description: 'Number of installments to charge the card in (only with off-session false)',
},
{
name: 'metadata',
type: 'map',
Expand Down Expand Up @@ -2352,6 +2364,12 @@ export const resources: ResourceDef[] = [
nestedPath: 'payment_options.amount',
description: 'Only payment methods that can pay this amount',
},
{
name: 'payment-options-off-session',
type: 'boolean',
nestedPath: 'payment_options.off_session',
description: 'Set to false to list only cards the customer can pay with while present',
},
],
createFlags: [
{
Expand Down Expand Up @@ -2456,6 +2474,26 @@ export const resources: ResourceDef[] = [
description: 'Get the download URL of the mandate contract',
kind: 'read',
},
{
name: 'installments',
sdkMethod: 'installments',
description: 'Get the numbers of installments a saved card accepts for an amount',
kind: 'read',
flags: [
{
name: 'amount',
type: 'integer',
required: true,
description: 'Amount to charge in the smallest currency unit',
},
{
name: 'currency',
type: 'string',
required: true,
description: 'Currency code (CLP)',
},
],
},
],
},
{
Expand Down Expand Up @@ -3562,6 +3600,24 @@ export const resources: ResourceDef[] = [
description: 'Filter by direction (mx_to_usd, usd_to_mx)',
},
],
actions: [
{
name: 'cancel',
idempotencyKey: true,
sdkMethod: 'cancel',
description: 'Cancel a usdt_to_mx transfer that is waiting for its USDT',
confirm: true,
successMessage: "{resource} '{id}' canceled",
},
{
name: 'simulate_credit',
idempotencyKey: true,
sdkMethod: 'simulateCredit',
description:
'Simulate the credit of the pesos of a usd_to_mx or usdt_to_mx transfer (test mode)',
successMessage: "Credit of {resource} '{id}' simulated",
},
],
},
]

Expand Down
Loading