@delopay/sdk 0.238.0 → 0.240.0
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/dist/{chunk-H7EC7OQF.js → chunk-K6P7MQ7K.js} +108 -1
- package/dist/chunk-K6P7MQ7K.js.map +1 -0
- package/dist/index.cjs +107 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +442 -1
- package/dist/index.d.ts +442 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +107 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +17 -18
- package/dist/chunk-H7EC7OQF.js.map +0 -1
|
@@ -619,6 +619,42 @@ var Connectors = class {
|
|
|
619
619
|
{ body: params }
|
|
620
620
|
);
|
|
621
621
|
}
|
|
622
|
+
/**
|
|
623
|
+
* Share a connector with more shops of the same merchant (todos#320).
|
|
624
|
+
* `POST /account/{accountId}/connectors/{connectorId}/shops`
|
|
625
|
+
*
|
|
626
|
+
* Nothing is copied: every shop sends payments to the same account, on the
|
|
627
|
+
* same credentials and webhook, and the account's limits count them all.
|
|
628
|
+
*/
|
|
629
|
+
async addShops(accountId, connectorId, params) {
|
|
630
|
+
return this.request(
|
|
631
|
+
"POST",
|
|
632
|
+
`/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops`,
|
|
633
|
+
{ body: params }
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Switch a connector off, or back on, in one shop it serves.
|
|
638
|
+
* `POST /account/{accountId}/connectors/{connectorId}/shops/{profileId}`
|
|
639
|
+
*/
|
|
640
|
+
async setShopDisabled(accountId, connectorId, profileId, params) {
|
|
641
|
+
return this.request(
|
|
642
|
+
"POST",
|
|
643
|
+
`/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`,
|
|
644
|
+
{ body: params }
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Stop a connector serving one shop it is shared with. The home shop is
|
|
649
|
+
* refused: it holds the connector's name, limits and webhook.
|
|
650
|
+
* `DELETE /account/{accountId}/connectors/{connectorId}/shops/{profileId}`
|
|
651
|
+
*/
|
|
652
|
+
async removeShop(accountId, connectorId, profileId) {
|
|
653
|
+
return this.request(
|
|
654
|
+
"DELETE",
|
|
655
|
+
`/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`
|
|
656
|
+
);
|
|
657
|
+
}
|
|
622
658
|
// --- Advanced operations (Task 4.8) ---
|
|
623
659
|
/**
|
|
624
660
|
* Run the configuration checks for a vault (VGS) connector account:
|
|
@@ -804,6 +840,77 @@ var Connectors = class {
|
|
|
804
840
|
`/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/sync-events`
|
|
805
841
|
);
|
|
806
842
|
}
|
|
843
|
+
/**
|
|
844
|
+
* Read the callback addresses of a connector's payment provider.
|
|
845
|
+
* `GET /account/{merchantId}/connectors/webhooks/{connectorId}/address`
|
|
846
|
+
*
|
|
847
|
+
* One entry per environment: the saved mode and identifier, and for every
|
|
848
|
+
* credential group the URL the policy asks for (`desired_url`) beside the URL
|
|
849
|
+
* actually registered at the provider (`registered_url`) with its `status`.
|
|
850
|
+
* Only `registered` means the provider delivers to the desired URL.
|
|
851
|
+
*
|
|
852
|
+
* Available for providers whose webhooks Delopay manages (Stripe, PayPal,
|
|
853
|
+
* Airwallex, Whop) and for hand-configured ones (Creem, NomuPay,
|
|
854
|
+
* MicroPayment). Other connectors are refused with a 400.
|
|
855
|
+
*/
|
|
856
|
+
async getWebhookAddress(merchantId, connectorId) {
|
|
857
|
+
return this.request(
|
|
858
|
+
"GET",
|
|
859
|
+
`/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address`
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Validate a proposed callback address without saving it.
|
|
864
|
+
* `POST /account/{merchantId}/connectors/webhooks/{connectorId}/address/preview`
|
|
865
|
+
*
|
|
866
|
+
* Returns the validation errors as `{ field, code }` pairs, the URL every
|
|
867
|
+
* affected credential group would get, the connector accounts that share it,
|
|
868
|
+
* and whether saving needs `confirm_shared: true`. Needs the same permission
|
|
869
|
+
* as saving.
|
|
870
|
+
*
|
|
871
|
+
* @example
|
|
872
|
+
* ```typescript
|
|
873
|
+
* const preview = await delopay.connectors.previewWebhookAddress('mer_abc', 'mca_xyz', {
|
|
874
|
+
* environment: 'live',
|
|
875
|
+
* mode: 'anonymous',
|
|
876
|
+
* format: { prefix: 'wh-', style: 'alphanumeric', length: 16 },
|
|
877
|
+
* });
|
|
878
|
+
* if (!preview.valid) console.warn(preview.errors);
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
881
|
+
async previewWebhookAddress(merchantId, connectorId, params) {
|
|
882
|
+
return this.request(
|
|
883
|
+
"POST",
|
|
884
|
+
`/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address/preview`,
|
|
885
|
+
{ body: params }
|
|
886
|
+
);
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Save the callback address of a connector's payment provider for one
|
|
890
|
+
* environment.
|
|
891
|
+
* `PUT /account/{merchantId}/connectors/webhooks/{connectorId}/address`
|
|
892
|
+
*
|
|
893
|
+
* The address applies to every connector account of that provider and
|
|
894
|
+
* environment, so `confirm_shared: true` is required when other accounts are
|
|
895
|
+
* affected. For a managed provider Delopay then registers the new URL and
|
|
896
|
+
* keeps the former one accepted; the response reports each credential
|
|
897
|
+
* group's outcome in `status`. A `pending` or `failed` group keeps receiving
|
|
898
|
+
* on its previous URL and is retried. For a hand-configured provider the
|
|
899
|
+
* merchant enters the new `desired_url` at the provider.
|
|
900
|
+
*
|
|
901
|
+
* A refused proposal answers 422 with error code `IR_06` and the message
|
|
902
|
+
* `Webhook address refused: field:code,…`. A save that lost to a concurrent
|
|
903
|
+
* change of the same address answers 422 with error code `HE_00` and can be
|
|
904
|
+
* repeated. A caller who may not edit every affected account answers 403.
|
|
905
|
+
* Address changes are limited per provider and environment (`rate_limit`).
|
|
906
|
+
*/
|
|
907
|
+
async updateWebhookAddress(merchantId, connectorId, params) {
|
|
908
|
+
return this.request(
|
|
909
|
+
"PUT",
|
|
910
|
+
`/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address`,
|
|
911
|
+
{ body: params }
|
|
912
|
+
);
|
|
913
|
+
}
|
|
807
914
|
/** List available payment methods. `GET /account/payment-methods` */
|
|
808
915
|
async listPaymentMethods() {
|
|
809
916
|
return this.request("GET", "/account/payment-methods");
|
|
@@ -12706,4 +12813,4 @@ export {
|
|
|
12706
12813
|
decodeNativePanes,
|
|
12707
12814
|
encodeNativePanes
|
|
12708
12815
|
};
|
|
12709
|
-
//# sourceMappingURL=chunk-
|
|
12816
|
+
//# sourceMappingURL=chunk-K6P7MQ7K.js.map
|