@xpayeg/sdk 2.0.0 → 2.2.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/CHANGELOG.md +24 -0
- package/dist/index.d.cts +221 -8
- package/dist/index.d.mts +221 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @xpayeg/sdk
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#462](https://github.com/xpayeg/xpay/pull/462) [`f083704`](https://github.com/xpayeg/xpay/commit/f08370434ff93c52450cfaee17f249c11b5cd46c) Thanks [@Elmosh](https://github.com/Elmosh)! - Deferred-mount Payment Element: `xpay.elements({ mode: "payment", amount, currency })` renders the payment form with no checkout session — your server creates the session with the final total when the customer clicks Pay, and its clientSecret is passed to `confirmPayment({ elements, clientSecret })` (a plain string). The session's total must equal the amount the element displays, or the confirmation fails with `amount_reconfirmation_required` and nothing is charged. Adds `elements.update({ amount, currency })` for deferred display updates. `XPayProvider` accepts the new options form; deferred amount/currency prop changes flow through `elements.update()` without recreating the instance. The existing `{ clientSecret }` path is unchanged.
|
|
9
|
+
|
|
10
|
+
Also in this release: the overlay scroll lock (3DS/action overlay and drop-in modal, now one shared implementation) pins the page at its measured geometry and preserves the scrollbar gutter, so centered boxed themes no longer shift when an overlay opens; `elements.fetchUpdates()` now genuinely re-fetches the session from the server (it previously answered from the iframe's local state; failures now resolve the error arm instead of returning stale data), and `CheckoutSession` gains optional `presentmentDetails` — the customer-facing amounts, present only when the merchant prices in a currency other than the processing currency. Read amounts presentment-first.
|
|
11
|
+
|
|
12
|
+
## 2.1.0
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- [#224](https://github.com/xpayeg/xpay/pull/224) [`40beff5`](https://github.com/xpayeg/xpay/commit/40beff5ee4660914dff5c0f7c43480083bf331c4) Thanks [@mariamkamel](https://github.com/mariamkamel)! - `CheckoutCompleteResult` (drop-in `onComplete`) and the `session` in `confirmPayment()`'s success result now carry `paymentStatus`. Methods the customer pays afterwards, such as Fawry, complete checkout as `unpaid` and are paid later. Fulfil on `paymentStatus: "paid"`, never on completion alone.
|
|
18
|
+
|
|
19
|
+
Drop-in `onError` now fires when an attempt fails (declined, canceled, processing error) and when the session is expired or already complete on load. The modal unlocks after a failed attempt so the customer can close it; previously it stayed locked until a successful payment.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
- [#453](https://github.com/xpayeg/xpay/pull/453) [`5445718`](https://github.com/xpayeg/xpay/commit/5445718b5027cba56f1d645cba6f42904d2c2f2c) Thanks [@Elmosh](https://github.com/Elmosh)! - `@xpayeg/react` now declares its `@xpayeg/sdk` peer dependency as `^2.0.0` instead of an exact pinned version, so the two packages no longer have to be upgraded in lockstep within a major.
|
|
26
|
+
|
|
3
27
|
## 2.0.0
|
|
4
28
|
### Major Changes
|
|
5
29
|
|
package/dist/index.d.cts
CHANGED
|
@@ -907,6 +907,55 @@ interface ValuDetailsDto {
|
|
|
907
907
|
*/
|
|
908
908
|
type PaymentMethodDetailsDtoValu = ValuDetailsDto | null;
|
|
909
909
|
|
|
910
|
+
/**
|
|
911
|
+
* Generated by orval v7.21.0 🍺
|
|
912
|
+
* Do not edit manually.
|
|
913
|
+
* XPay Checkout API
|
|
914
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
915
|
+
* OpenAPI spec version: 1.0
|
|
916
|
+
*/
|
|
917
|
+
interface FawryDetailsDto {
|
|
918
|
+
/**
|
|
919
|
+
* Fawry-generated reference number the customer paid with
|
|
920
|
+
* @nullable
|
|
921
|
+
*/
|
|
922
|
+
fawryRefNumber?: string | null;
|
|
923
|
+
/**
|
|
924
|
+
* Kiosk receipt/confirmation number (paymentRefrenceNumber in Fawry API)
|
|
925
|
+
* @nullable
|
|
926
|
+
*/
|
|
927
|
+
paymentReferenceNumber?: string | null;
|
|
928
|
+
/**
|
|
929
|
+
* Payment channel used (e.g. PAYATFAWRY)
|
|
930
|
+
* @nullable
|
|
931
|
+
*/
|
|
932
|
+
paymentMethod?: string | null;
|
|
933
|
+
/**
|
|
934
|
+
* Epoch millis when the customer paid at the kiosk
|
|
935
|
+
* @nullable
|
|
936
|
+
*/
|
|
937
|
+
paymentTime?: number | null;
|
|
938
|
+
/**
|
|
939
|
+
* When the reference stops being payable.
|
|
940
|
+
* @nullable
|
|
941
|
+
*/
|
|
942
|
+
expiresAt?: string | null;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Generated by orval v7.21.0 🍺
|
|
947
|
+
* Do not edit manually.
|
|
948
|
+
* XPay Checkout API
|
|
949
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
950
|
+
* OpenAPI spec version: 1.0
|
|
951
|
+
*/
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Fawry details (if type is 'fawry')
|
|
955
|
+
* @nullable
|
|
956
|
+
*/
|
|
957
|
+
type PaymentMethodDetailsDtoFawry = FawryDetailsDto | null;
|
|
958
|
+
|
|
910
959
|
/**
|
|
911
960
|
* Generated by orval v7.21.0 🍺
|
|
912
961
|
* Do not edit manually.
|
|
@@ -925,6 +974,11 @@ interface PaymentMethodDetailsDto {
|
|
|
925
974
|
* @nullable
|
|
926
975
|
*/
|
|
927
976
|
valu?: PaymentMethodDetailsDtoValu;
|
|
977
|
+
/**
|
|
978
|
+
* Fawry details (if type is 'fawry')
|
|
979
|
+
* @nullable
|
|
980
|
+
*/
|
|
981
|
+
fawry?: PaymentMethodDetailsDtoFawry;
|
|
928
982
|
}
|
|
929
983
|
|
|
930
984
|
/**
|
|
@@ -1242,6 +1296,10 @@ interface RefundResponseDto {
|
|
|
1242
1296
|
reason?: RefundResponseDtoReason;
|
|
1243
1297
|
/** Reason for refund failure */
|
|
1244
1298
|
failureReason?: RefundResponseDtoFailureReason;
|
|
1299
|
+
/** Error code describing why the refund failed. Same code vocabulary as payment failures. */
|
|
1300
|
+
failureCode?: string;
|
|
1301
|
+
/** Human-readable message for the refund failure */
|
|
1302
|
+
failureMessage?: string;
|
|
1245
1303
|
/** Reason for pending status */
|
|
1246
1304
|
pendingReason?: RefundResponseDtoPendingReason;
|
|
1247
1305
|
/** Description for non-card refunds */
|
|
@@ -1521,7 +1579,7 @@ declare const CheckoutSessionResponseDtoCustomerCreation: {
|
|
|
1521
1579
|
* OpenAPI spec version: 1.0
|
|
1522
1580
|
*/
|
|
1523
1581
|
/**
|
|
1524
|
-
*
|
|
1582
|
+
* Whether the customer is done with checkout. `open` while they are still on the page; `complete` once they have paid or, for methods paid later such as a Fawry reference, once they hold the reference; `expired` if the session timed out while still open. `complete` does not mean paid: read `paymentStatus` for that.
|
|
1525
1583
|
*/
|
|
1526
1584
|
type CheckoutSessionResponseDtoStatus = typeof CheckoutSessionResponseDtoStatus[keyof typeof CheckoutSessionResponseDtoStatus];
|
|
1527
1585
|
declare const CheckoutSessionResponseDtoStatus: {
|
|
@@ -1538,7 +1596,7 @@ declare const CheckoutSessionResponseDtoStatus: {
|
|
|
1538
1596
|
* OpenAPI spec version: 1.0
|
|
1539
1597
|
*/
|
|
1540
1598
|
/**
|
|
1541
|
-
*
|
|
1599
|
+
* Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone.
|
|
1542
1600
|
*/
|
|
1543
1601
|
type CheckoutSessionResponseDtoPaymentStatus = typeof CheckoutSessionResponseDtoPaymentStatus[keyof typeof CheckoutSessionResponseDtoPaymentStatus];
|
|
1544
1602
|
declare const CheckoutSessionResponseDtoPaymentStatus: {
|
|
@@ -1928,6 +1986,20 @@ type PaymentMethodObjectDtoCard = PaymentMethodCardDto | null;
|
|
|
1928
1986
|
*/
|
|
1929
1987
|
type PaymentMethodObjectDtoValu = ValuDetailsDto | null;
|
|
1930
1988
|
|
|
1989
|
+
/**
|
|
1990
|
+
* Generated by orval v7.21.0 🍺
|
|
1991
|
+
* Do not edit manually.
|
|
1992
|
+
* XPay Checkout API
|
|
1993
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
1994
|
+
* OpenAPI spec version: 1.0
|
|
1995
|
+
*/
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* Fawry details (if type is 'fawry')
|
|
1999
|
+
* @nullable
|
|
2000
|
+
*/
|
|
2001
|
+
type PaymentMethodObjectDtoFawry = FawryDetailsDto | null;
|
|
2002
|
+
|
|
1931
2003
|
/**
|
|
1932
2004
|
* Generated by orval v7.21.0 🍺
|
|
1933
2005
|
* Do not edit manually.
|
|
@@ -1974,6 +2046,11 @@ interface PaymentMethodObjectDto {
|
|
|
1974
2046
|
* @nullable
|
|
1975
2047
|
*/
|
|
1976
2048
|
valu?: PaymentMethodObjectDtoValu;
|
|
2049
|
+
/**
|
|
2050
|
+
* Fawry details (if type is 'fawry')
|
|
2051
|
+
* @nullable
|
|
2052
|
+
*/
|
|
2053
|
+
fawry?: PaymentMethodObjectDtoFawry;
|
|
1977
2054
|
billingDetails: BillingDetailsDto;
|
|
1978
2055
|
type: PaymentMethodObjectDtoType;
|
|
1979
2056
|
/** Created timestamp (ISO 8601) */
|
|
@@ -2066,6 +2143,49 @@ interface NextActionRedirectDto {
|
|
|
2066
2143
|
*/
|
|
2067
2144
|
type NextActionDetailDtoRedirectToUrl = NextActionRedirectDto | null;
|
|
2068
2145
|
|
|
2146
|
+
/**
|
|
2147
|
+
* Generated by orval v7.21.0 🍺
|
|
2148
|
+
* Do not edit manually.
|
|
2149
|
+
* XPay Checkout API
|
|
2150
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
2151
|
+
* OpenAPI spec version: 1.0
|
|
2152
|
+
*/
|
|
2153
|
+
interface NextActionVoucherDto {
|
|
2154
|
+
/** Payment method the reference is paid through, as its payment method type (e.g. `fawry`). */
|
|
2155
|
+
provider: string;
|
|
2156
|
+
/** Reference number the customer pays with at the kiosk or in the provider's app. */
|
|
2157
|
+
reference: string;
|
|
2158
|
+
/**
|
|
2159
|
+
* When the reference stops being payable. `null` if the provider set no expiry.
|
|
2160
|
+
* @nullable
|
|
2161
|
+
*/
|
|
2162
|
+
expiresAt?: string | null;
|
|
2163
|
+
/**
|
|
2164
|
+
* Human-readable payment instructions for the customer. `null` if none.
|
|
2165
|
+
* @nullable
|
|
2166
|
+
*/
|
|
2167
|
+
instructions?: string | null;
|
|
2168
|
+
/**
|
|
2169
|
+
* URL of a hosted voucher page, when the provider offers one. `null` otherwise.
|
|
2170
|
+
* @nullable
|
|
2171
|
+
*/
|
|
2172
|
+
hostedVoucherUrl?: string | null;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* Generated by orval v7.21.0 🍺
|
|
2177
|
+
* Do not edit manually.
|
|
2178
|
+
* XPay Checkout API
|
|
2179
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
2180
|
+
* OpenAPI spec version: 1.0
|
|
2181
|
+
*/
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* Voucher details when `type` is `display_voucher_details`. `null` for any other action type.
|
|
2185
|
+
* @nullable
|
|
2186
|
+
*/
|
|
2187
|
+
type NextActionDetailDtoDisplayVoucherDetails = NextActionVoucherDto | null;
|
|
2188
|
+
|
|
2069
2189
|
/**
|
|
2070
2190
|
* Generated by orval v7.21.0 🍺
|
|
2071
2191
|
* Do not edit manually.
|
|
@@ -2075,13 +2195,18 @@ type NextActionDetailDtoRedirectToUrl = NextActionRedirectDto | null;
|
|
|
2075
2195
|
*/
|
|
2076
2196
|
|
|
2077
2197
|
interface NextActionDetailDto {
|
|
2078
|
-
/** Kind of action the customer must take next
|
|
2198
|
+
/** Kind of action the customer must take next: `redirect_to_url` (3-D Secure, hosted payment pages) or `display_voucher_details` (a reference paid out-of-band, e.g. Fawry). */
|
|
2079
2199
|
type: string;
|
|
2080
2200
|
/**
|
|
2081
2201
|
* Redirect details when `type` is `redirect_to_url`. `null` for any other action type.
|
|
2082
2202
|
* @nullable
|
|
2083
2203
|
*/
|
|
2084
2204
|
redirectToUrl?: NextActionDetailDtoRedirectToUrl;
|
|
2205
|
+
/**
|
|
2206
|
+
* Voucher details when `type` is `display_voucher_details`. `null` for any other action type.
|
|
2207
|
+
* @nullable
|
|
2208
|
+
*/
|
|
2209
|
+
displayVoucherDetails?: NextActionDetailDtoDisplayVoucherDetails;
|
|
2085
2210
|
}
|
|
2086
2211
|
|
|
2087
2212
|
/**
|
|
@@ -3148,9 +3273,9 @@ interface CheckoutSessionResponseDto {
|
|
|
3148
3273
|
submitType: CheckoutSessionResponseDtoSubmitType;
|
|
3149
3274
|
/** Customer creation mode */
|
|
3150
3275
|
customerCreation: CheckoutSessionResponseDtoCustomerCreation;
|
|
3151
|
-
/**
|
|
3276
|
+
/** Whether the customer is done with checkout. `open` while they are still on the page; `complete` once they have paid or, for methods paid later such as a Fawry reference, once they hold the reference; `expired` if the session timed out while still open. `complete` does not mean paid: read `paymentStatus` for that. */
|
|
3152
3277
|
status: CheckoutSessionResponseDtoStatus;
|
|
3153
|
-
/**
|
|
3278
|
+
/** Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone. */
|
|
3154
3279
|
paymentStatus: CheckoutSessionResponseDtoPaymentStatus;
|
|
3155
3280
|
/** Currency code (ISO 4217) */
|
|
3156
3281
|
currency?: CheckoutSessionResponseDtoCurrency;
|
|
@@ -3289,6 +3414,13 @@ type Appearance = Pick<BrandingSettingsResponseDto, "colorMode" | "borderStyle"
|
|
|
3289
3414
|
* }
|
|
3290
3415
|
* ```
|
|
3291
3416
|
*/
|
|
3417
|
+
/**
|
|
3418
|
+
* `complete` means the customer is done with checkout, not that the money has
|
|
3419
|
+
* arrived. Cards and other instant methods complete as `paid`; a method the customer
|
|
3420
|
+
* pays afterwards (a Fawry reference) completes as `unpaid`, and the session turns
|
|
3421
|
+
* `paid` later — announced by `checkout.session.async_payment_succeeded`. Fulfil on
|
|
3422
|
+
* `paymentStatus === "paid"`, never on `type === "complete"` alone.
|
|
3423
|
+
*/
|
|
3292
3424
|
type SessionStatus = {
|
|
3293
3425
|
type: "open";
|
|
3294
3426
|
} | {
|
|
@@ -3322,6 +3454,13 @@ type CheckoutSession = Pick<CheckoutSessionResponseDto, "id" | "amountSubtotal"
|
|
|
3322
3454
|
canConfirm: boolean;
|
|
3323
3455
|
/** Available payment methods */
|
|
3324
3456
|
paymentMethods: PaymentMethodInfo[];
|
|
3457
|
+
/**
|
|
3458
|
+
* Customer-facing amounts, present only when the merchant prices in a
|
|
3459
|
+
* currency other than the processing currency — read amounts
|
|
3460
|
+
* presentment-first (`presentmentDetails.amountTotal` when present,
|
|
3461
|
+
* top-level `amountTotal` otherwise).
|
|
3462
|
+
*/
|
|
3463
|
+
presentmentDetails?: CheckoutSessionResponseDto["presentmentDetails"];
|
|
3325
3464
|
/** Line items in the session */
|
|
3326
3465
|
lineItems?: CheckoutSessionResponseDto["lineItems"];
|
|
3327
3466
|
/** Totals breakdown (subtotal, tax, shipping, etc.) */
|
|
@@ -3452,7 +3591,7 @@ interface XPayInstance {
|
|
|
3452
3591
|
initCheckout(options: InitCheckoutOptions): Promise<InitCheckoutResult>;
|
|
3453
3592
|
}
|
|
3454
3593
|
/**
|
|
3455
|
-
* Options for creating an Elements instance.
|
|
3594
|
+
* Options for creating an Elements instance from an existing checkout session.
|
|
3456
3595
|
*
|
|
3457
3596
|
* @example
|
|
3458
3597
|
* ```ts
|
|
@@ -3463,14 +3602,67 @@ interface XPayInstance {
|
|
|
3463
3602
|
* });
|
|
3464
3603
|
* ```
|
|
3465
3604
|
*/
|
|
3466
|
-
interface
|
|
3605
|
+
interface ElementsOptionsClientSecret {
|
|
3467
3606
|
/** The client secret from a checkout session. Can be a string or a Promise. */
|
|
3468
3607
|
clientSecret: string | Promise<string>;
|
|
3608
|
+
/** Either use mode or clientSecret when creating an Elements group. */
|
|
3609
|
+
mode?: never;
|
|
3610
|
+
/** Amount is only applicable in deferred mode (`mode: "payment"`). */
|
|
3611
|
+
amount?: never;
|
|
3612
|
+
/** Currency is only applicable in deferred mode (`mode: "payment"`). */
|
|
3613
|
+
currency?: never;
|
|
3469
3614
|
/** Appearance overrides for the checkout UI */
|
|
3470
3615
|
appearance?: Appearance;
|
|
3471
3616
|
/** Locale for the payment form — `"en"` (default) or `"ar"` */
|
|
3472
3617
|
locale?: "en" | "ar";
|
|
3473
3618
|
}
|
|
3619
|
+
/**
|
|
3620
|
+
* Options for creating a DEFERRED Elements instance — no checkout session
|
|
3621
|
+
* exists yet. The Payment Element renders immediately from the amount and
|
|
3622
|
+
* currency alone; your server creates the session with the final total when
|
|
3623
|
+
* the customer clicks Pay, and its clientSecret is passed to
|
|
3624
|
+
* `confirmPayment({ elements, clientSecret })`.
|
|
3625
|
+
*
|
|
3626
|
+
* The amount shown is the amount charged: if the session your server creates
|
|
3627
|
+
* has a different total, the confirmation fails with
|
|
3628
|
+
* `amount_reconfirmation_required` and nothing is charged.
|
|
3629
|
+
*
|
|
3630
|
+
* @example
|
|
3631
|
+
* ```ts
|
|
3632
|
+
* const elements = xpay.elements({
|
|
3633
|
+
* mode: "payment",
|
|
3634
|
+
* amount: 250000, // piasters
|
|
3635
|
+
* currency: "EGP",
|
|
3636
|
+
* });
|
|
3637
|
+
* ```
|
|
3638
|
+
*/
|
|
3639
|
+
interface ElementsOptionsMode {
|
|
3640
|
+
/** Deferred mode. Only `"payment"` is supported. */
|
|
3641
|
+
mode: "payment";
|
|
3642
|
+
/** The amount to display and charge, in the currency's smallest unit (piasters). Integer, greater than zero. */
|
|
3643
|
+
amount: number;
|
|
3644
|
+
/** Three-letter currency code (e.g. `"EGP"`). */
|
|
3645
|
+
currency: string;
|
|
3646
|
+
/** Either use mode or clientSecret when creating an Elements group. */
|
|
3647
|
+
clientSecret?: never;
|
|
3648
|
+
/** Appearance overrides for the checkout UI */
|
|
3649
|
+
appearance?: Appearance;
|
|
3650
|
+
/** Locale for the payment form — `"en"` (default) or `"ar"` */
|
|
3651
|
+
locale?: "en" | "ar";
|
|
3652
|
+
}
|
|
3653
|
+
/**
|
|
3654
|
+
* Options for creating an Elements instance — with a session's
|
|
3655
|
+
* `clientSecret`, or session-less with `{ mode, amount, currency }`
|
|
3656
|
+
* (deferred). The two forms are mutually exclusive.
|
|
3657
|
+
*/
|
|
3658
|
+
type ElementsOptions = ElementsOptionsClientSecret | ElementsOptionsMode;
|
|
3659
|
+
/** Options for `elements.update()` — deferred mode only. */
|
|
3660
|
+
interface ElementsUpdateOptions {
|
|
3661
|
+
/** New display amount in the currency's smallest unit. Integer, greater than zero. */
|
|
3662
|
+
amount?: number;
|
|
3663
|
+
/** New three-letter currency code. */
|
|
3664
|
+
currency?: string;
|
|
3665
|
+
}
|
|
3474
3666
|
/**
|
|
3475
3667
|
* Manages the lifecycle of the PaymentElement.
|
|
3476
3668
|
*
|
|
@@ -3518,6 +3710,12 @@ interface Elements {
|
|
|
3518
3710
|
fetchUpdates(): Promise<ActionResult>;
|
|
3519
3711
|
/** Update the appearance at runtime without recreating elements */
|
|
3520
3712
|
changeAppearance(appearance: Appearance): void;
|
|
3713
|
+
/**
|
|
3714
|
+
* Update the displayed amount/currency of a DEFERRED Elements instance
|
|
3715
|
+
* (created with `{ mode: "payment" }`). Throws when the instance was
|
|
3716
|
+
* created with a `clientSecret` — session amounts are server-owned.
|
|
3717
|
+
*/
|
|
3718
|
+
update(options: ElementsUpdateOptions): Promise<void>;
|
|
3521
3719
|
/** Destroy the Elements instance and clean up all resources */
|
|
3522
3720
|
destroy(): void;
|
|
3523
3721
|
}
|
|
@@ -3631,6 +3829,15 @@ interface PaymentElement extends BaseElement {
|
|
|
3631
3829
|
interface ConfirmPaymentOptions {
|
|
3632
3830
|
/** The Elements instance managing the payment form */
|
|
3633
3831
|
elements: Elements;
|
|
3832
|
+
/**
|
|
3833
|
+
* DEFERRED mode only, and required there: the clientSecret of the checkout
|
|
3834
|
+
* session your server just created with the final total. A plain string —
|
|
3835
|
+
* await your own fetch before calling. The session's total must equal the
|
|
3836
|
+
* amount the element displays, or the confirmation fails with
|
|
3837
|
+
* `amount_reconfirmation_required` and nothing is charged. Ignored when the
|
|
3838
|
+
* elements were created with a clientSecret.
|
|
3839
|
+
*/
|
|
3840
|
+
clientSecret?: string;
|
|
3634
3841
|
/** Customer details collected by the merchant's form */
|
|
3635
3842
|
customerDetails?: CustomerDetails;
|
|
3636
3843
|
/** Custom field values for the session */
|
|
@@ -3702,6 +3909,12 @@ interface CheckoutInstance {
|
|
|
3702
3909
|
/** Result of a successful payment via drop-in checkout */
|
|
3703
3910
|
interface CheckoutCompleteResult {
|
|
3704
3911
|
status: "succeeded";
|
|
3912
|
+
/**
|
|
3913
|
+
* Whether the money has arrived. `paid` for cards and other instant methods.
|
|
3914
|
+
* `unpaid` when the customer holds a reference they pay afterwards (Fawry): the
|
|
3915
|
+
* checkout is over, but fulfil only on `checkout.session.async_payment_succeeded`.
|
|
3916
|
+
*/
|
|
3917
|
+
paymentStatus: "paid" | "unpaid" | "no_payment_required";
|
|
3705
3918
|
/** The payment intent ID for server-side verification */
|
|
3706
3919
|
paymentIntentId: string;
|
|
3707
3920
|
/** The charge ID (if available) */
|
|
@@ -3857,4 +4070,4 @@ declare global {
|
|
|
3857
4070
|
declare function loadXPay(publishableKey: string): Promise<XPayInstance | null>;
|
|
3858
4071
|
|
|
3859
4072
|
export { loadXPay };
|
|
3860
|
-
export type { ActionResult, Address, Appearance, BaseElement, CheckoutActions, CheckoutCompleteResult, DiscountResponseDto as CheckoutDiscount, CheckoutError, FeesResponseDto as CheckoutFees, CheckoutInstance, LineItemDto as CheckoutLineItem, CheckoutOptions, CheckoutSession, TotalDetailsResponseDto as CheckoutTotalDetails, ConfirmPaymentOptions, CustomerDetails, Elements, ElementsLoadErrorEvent, ElementsOptions, ElementsReadyEvent, InitCheckoutOptions, InitCheckoutResult, PaymentElement, PaymentElementChangeEvent, PaymentElementOptions, PaymentMethodInfo, SessionStatus, XPayError, XPayInstance };
|
|
4073
|
+
export type { ActionResult, Address, Appearance, BaseElement, CheckoutActions, CheckoutCompleteResult, DiscountResponseDto as CheckoutDiscount, CheckoutError, FeesResponseDto as CheckoutFees, CheckoutInstance, LineItemDto as CheckoutLineItem, CheckoutOptions, CheckoutSession, TotalDetailsResponseDto as CheckoutTotalDetails, ConfirmPaymentOptions, CustomerDetails, Elements, ElementsLoadErrorEvent, ElementsOptions, ElementsOptionsClientSecret, ElementsOptionsMode, ElementsReadyEvent, ElementsUpdateOptions, InitCheckoutOptions, InitCheckoutResult, PaymentElement, PaymentElementChangeEvent, PaymentElementOptions, PaymentMethodInfo, SessionStatus, XPayError, XPayInstance };
|
package/dist/index.d.mts
CHANGED
|
@@ -907,6 +907,55 @@ interface ValuDetailsDto {
|
|
|
907
907
|
*/
|
|
908
908
|
type PaymentMethodDetailsDtoValu = ValuDetailsDto | null;
|
|
909
909
|
|
|
910
|
+
/**
|
|
911
|
+
* Generated by orval v7.21.0 🍺
|
|
912
|
+
* Do not edit manually.
|
|
913
|
+
* XPay Checkout API
|
|
914
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
915
|
+
* OpenAPI spec version: 1.0
|
|
916
|
+
*/
|
|
917
|
+
interface FawryDetailsDto {
|
|
918
|
+
/**
|
|
919
|
+
* Fawry-generated reference number the customer paid with
|
|
920
|
+
* @nullable
|
|
921
|
+
*/
|
|
922
|
+
fawryRefNumber?: string | null;
|
|
923
|
+
/**
|
|
924
|
+
* Kiosk receipt/confirmation number (paymentRefrenceNumber in Fawry API)
|
|
925
|
+
* @nullable
|
|
926
|
+
*/
|
|
927
|
+
paymentReferenceNumber?: string | null;
|
|
928
|
+
/**
|
|
929
|
+
* Payment channel used (e.g. PAYATFAWRY)
|
|
930
|
+
* @nullable
|
|
931
|
+
*/
|
|
932
|
+
paymentMethod?: string | null;
|
|
933
|
+
/**
|
|
934
|
+
* Epoch millis when the customer paid at the kiosk
|
|
935
|
+
* @nullable
|
|
936
|
+
*/
|
|
937
|
+
paymentTime?: number | null;
|
|
938
|
+
/**
|
|
939
|
+
* When the reference stops being payable.
|
|
940
|
+
* @nullable
|
|
941
|
+
*/
|
|
942
|
+
expiresAt?: string | null;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Generated by orval v7.21.0 🍺
|
|
947
|
+
* Do not edit manually.
|
|
948
|
+
* XPay Checkout API
|
|
949
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
950
|
+
* OpenAPI spec version: 1.0
|
|
951
|
+
*/
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Fawry details (if type is 'fawry')
|
|
955
|
+
* @nullable
|
|
956
|
+
*/
|
|
957
|
+
type PaymentMethodDetailsDtoFawry = FawryDetailsDto | null;
|
|
958
|
+
|
|
910
959
|
/**
|
|
911
960
|
* Generated by orval v7.21.0 🍺
|
|
912
961
|
* Do not edit manually.
|
|
@@ -925,6 +974,11 @@ interface PaymentMethodDetailsDto {
|
|
|
925
974
|
* @nullable
|
|
926
975
|
*/
|
|
927
976
|
valu?: PaymentMethodDetailsDtoValu;
|
|
977
|
+
/**
|
|
978
|
+
* Fawry details (if type is 'fawry')
|
|
979
|
+
* @nullable
|
|
980
|
+
*/
|
|
981
|
+
fawry?: PaymentMethodDetailsDtoFawry;
|
|
928
982
|
}
|
|
929
983
|
|
|
930
984
|
/**
|
|
@@ -1242,6 +1296,10 @@ interface RefundResponseDto {
|
|
|
1242
1296
|
reason?: RefundResponseDtoReason;
|
|
1243
1297
|
/** Reason for refund failure */
|
|
1244
1298
|
failureReason?: RefundResponseDtoFailureReason;
|
|
1299
|
+
/** Error code describing why the refund failed. Same code vocabulary as payment failures. */
|
|
1300
|
+
failureCode?: string;
|
|
1301
|
+
/** Human-readable message for the refund failure */
|
|
1302
|
+
failureMessage?: string;
|
|
1245
1303
|
/** Reason for pending status */
|
|
1246
1304
|
pendingReason?: RefundResponseDtoPendingReason;
|
|
1247
1305
|
/** Description for non-card refunds */
|
|
@@ -1521,7 +1579,7 @@ declare const CheckoutSessionResponseDtoCustomerCreation: {
|
|
|
1521
1579
|
* OpenAPI spec version: 1.0
|
|
1522
1580
|
*/
|
|
1523
1581
|
/**
|
|
1524
|
-
*
|
|
1582
|
+
* Whether the customer is done with checkout. `open` while they are still on the page; `complete` once they have paid or, for methods paid later such as a Fawry reference, once they hold the reference; `expired` if the session timed out while still open. `complete` does not mean paid: read `paymentStatus` for that.
|
|
1525
1583
|
*/
|
|
1526
1584
|
type CheckoutSessionResponseDtoStatus = typeof CheckoutSessionResponseDtoStatus[keyof typeof CheckoutSessionResponseDtoStatus];
|
|
1527
1585
|
declare const CheckoutSessionResponseDtoStatus: {
|
|
@@ -1538,7 +1596,7 @@ declare const CheckoutSessionResponseDtoStatus: {
|
|
|
1538
1596
|
* OpenAPI spec version: 1.0
|
|
1539
1597
|
*/
|
|
1540
1598
|
/**
|
|
1541
|
-
*
|
|
1599
|
+
* Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone.
|
|
1542
1600
|
*/
|
|
1543
1601
|
type CheckoutSessionResponseDtoPaymentStatus = typeof CheckoutSessionResponseDtoPaymentStatus[keyof typeof CheckoutSessionResponseDtoPaymentStatus];
|
|
1544
1602
|
declare const CheckoutSessionResponseDtoPaymentStatus: {
|
|
@@ -1928,6 +1986,20 @@ type PaymentMethodObjectDtoCard = PaymentMethodCardDto | null;
|
|
|
1928
1986
|
*/
|
|
1929
1987
|
type PaymentMethodObjectDtoValu = ValuDetailsDto | null;
|
|
1930
1988
|
|
|
1989
|
+
/**
|
|
1990
|
+
* Generated by orval v7.21.0 🍺
|
|
1991
|
+
* Do not edit manually.
|
|
1992
|
+
* XPay Checkout API
|
|
1993
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
1994
|
+
* OpenAPI spec version: 1.0
|
|
1995
|
+
*/
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* Fawry details (if type is 'fawry')
|
|
1999
|
+
* @nullable
|
|
2000
|
+
*/
|
|
2001
|
+
type PaymentMethodObjectDtoFawry = FawryDetailsDto | null;
|
|
2002
|
+
|
|
1931
2003
|
/**
|
|
1932
2004
|
* Generated by orval v7.21.0 🍺
|
|
1933
2005
|
* Do not edit manually.
|
|
@@ -1974,6 +2046,11 @@ interface PaymentMethodObjectDto {
|
|
|
1974
2046
|
* @nullable
|
|
1975
2047
|
*/
|
|
1976
2048
|
valu?: PaymentMethodObjectDtoValu;
|
|
2049
|
+
/**
|
|
2050
|
+
* Fawry details (if type is 'fawry')
|
|
2051
|
+
* @nullable
|
|
2052
|
+
*/
|
|
2053
|
+
fawry?: PaymentMethodObjectDtoFawry;
|
|
1977
2054
|
billingDetails: BillingDetailsDto;
|
|
1978
2055
|
type: PaymentMethodObjectDtoType;
|
|
1979
2056
|
/** Created timestamp (ISO 8601) */
|
|
@@ -2066,6 +2143,49 @@ interface NextActionRedirectDto {
|
|
|
2066
2143
|
*/
|
|
2067
2144
|
type NextActionDetailDtoRedirectToUrl = NextActionRedirectDto | null;
|
|
2068
2145
|
|
|
2146
|
+
/**
|
|
2147
|
+
* Generated by orval v7.21.0 🍺
|
|
2148
|
+
* Do not edit manually.
|
|
2149
|
+
* XPay Checkout API
|
|
2150
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
2151
|
+
* OpenAPI spec version: 1.0
|
|
2152
|
+
*/
|
|
2153
|
+
interface NextActionVoucherDto {
|
|
2154
|
+
/** Payment method the reference is paid through, as its payment method type (e.g. `fawry`). */
|
|
2155
|
+
provider: string;
|
|
2156
|
+
/** Reference number the customer pays with at the kiosk or in the provider's app. */
|
|
2157
|
+
reference: string;
|
|
2158
|
+
/**
|
|
2159
|
+
* When the reference stops being payable. `null` if the provider set no expiry.
|
|
2160
|
+
* @nullable
|
|
2161
|
+
*/
|
|
2162
|
+
expiresAt?: string | null;
|
|
2163
|
+
/**
|
|
2164
|
+
* Human-readable payment instructions for the customer. `null` if none.
|
|
2165
|
+
* @nullable
|
|
2166
|
+
*/
|
|
2167
|
+
instructions?: string | null;
|
|
2168
|
+
/**
|
|
2169
|
+
* URL of a hosted voucher page, when the provider offers one. `null` otherwise.
|
|
2170
|
+
* @nullable
|
|
2171
|
+
*/
|
|
2172
|
+
hostedVoucherUrl?: string | null;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* Generated by orval v7.21.0 🍺
|
|
2177
|
+
* Do not edit manually.
|
|
2178
|
+
* XPay Checkout API
|
|
2179
|
+
* API for the XPay checkout flow — client endpoints and SSR
|
|
2180
|
+
* OpenAPI spec version: 1.0
|
|
2181
|
+
*/
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* Voucher details when `type` is `display_voucher_details`. `null` for any other action type.
|
|
2185
|
+
* @nullable
|
|
2186
|
+
*/
|
|
2187
|
+
type NextActionDetailDtoDisplayVoucherDetails = NextActionVoucherDto | null;
|
|
2188
|
+
|
|
2069
2189
|
/**
|
|
2070
2190
|
* Generated by orval v7.21.0 🍺
|
|
2071
2191
|
* Do not edit manually.
|
|
@@ -2075,13 +2195,18 @@ type NextActionDetailDtoRedirectToUrl = NextActionRedirectDto | null;
|
|
|
2075
2195
|
*/
|
|
2076
2196
|
|
|
2077
2197
|
interface NextActionDetailDto {
|
|
2078
|
-
/** Kind of action the customer must take next
|
|
2198
|
+
/** Kind of action the customer must take next: `redirect_to_url` (3-D Secure, hosted payment pages) or `display_voucher_details` (a reference paid out-of-band, e.g. Fawry). */
|
|
2079
2199
|
type: string;
|
|
2080
2200
|
/**
|
|
2081
2201
|
* Redirect details when `type` is `redirect_to_url`. `null` for any other action type.
|
|
2082
2202
|
* @nullable
|
|
2083
2203
|
*/
|
|
2084
2204
|
redirectToUrl?: NextActionDetailDtoRedirectToUrl;
|
|
2205
|
+
/**
|
|
2206
|
+
* Voucher details when `type` is `display_voucher_details`. `null` for any other action type.
|
|
2207
|
+
* @nullable
|
|
2208
|
+
*/
|
|
2209
|
+
displayVoucherDetails?: NextActionDetailDtoDisplayVoucherDetails;
|
|
2085
2210
|
}
|
|
2086
2211
|
|
|
2087
2212
|
/**
|
|
@@ -3148,9 +3273,9 @@ interface CheckoutSessionResponseDto {
|
|
|
3148
3273
|
submitType: CheckoutSessionResponseDtoSubmitType;
|
|
3149
3274
|
/** Customer creation mode */
|
|
3150
3275
|
customerCreation: CheckoutSessionResponseDtoCustomerCreation;
|
|
3151
|
-
/**
|
|
3276
|
+
/** Whether the customer is done with checkout. `open` while they are still on the page; `complete` once they have paid or, for methods paid later such as a Fawry reference, once they hold the reference; `expired` if the session timed out while still open. `complete` does not mean paid: read `paymentStatus` for that. */
|
|
3152
3277
|
status: CheckoutSessionResponseDtoStatus;
|
|
3153
|
-
/**
|
|
3278
|
+
/** Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone. */
|
|
3154
3279
|
paymentStatus: CheckoutSessionResponseDtoPaymentStatus;
|
|
3155
3280
|
/** Currency code (ISO 4217) */
|
|
3156
3281
|
currency?: CheckoutSessionResponseDtoCurrency;
|
|
@@ -3289,6 +3414,13 @@ type Appearance = Pick<BrandingSettingsResponseDto, "colorMode" | "borderStyle"
|
|
|
3289
3414
|
* }
|
|
3290
3415
|
* ```
|
|
3291
3416
|
*/
|
|
3417
|
+
/**
|
|
3418
|
+
* `complete` means the customer is done with checkout, not that the money has
|
|
3419
|
+
* arrived. Cards and other instant methods complete as `paid`; a method the customer
|
|
3420
|
+
* pays afterwards (a Fawry reference) completes as `unpaid`, and the session turns
|
|
3421
|
+
* `paid` later — announced by `checkout.session.async_payment_succeeded`. Fulfil on
|
|
3422
|
+
* `paymentStatus === "paid"`, never on `type === "complete"` alone.
|
|
3423
|
+
*/
|
|
3292
3424
|
type SessionStatus = {
|
|
3293
3425
|
type: "open";
|
|
3294
3426
|
} | {
|
|
@@ -3322,6 +3454,13 @@ type CheckoutSession = Pick<CheckoutSessionResponseDto, "id" | "amountSubtotal"
|
|
|
3322
3454
|
canConfirm: boolean;
|
|
3323
3455
|
/** Available payment methods */
|
|
3324
3456
|
paymentMethods: PaymentMethodInfo[];
|
|
3457
|
+
/**
|
|
3458
|
+
* Customer-facing amounts, present only when the merchant prices in a
|
|
3459
|
+
* currency other than the processing currency — read amounts
|
|
3460
|
+
* presentment-first (`presentmentDetails.amountTotal` when present,
|
|
3461
|
+
* top-level `amountTotal` otherwise).
|
|
3462
|
+
*/
|
|
3463
|
+
presentmentDetails?: CheckoutSessionResponseDto["presentmentDetails"];
|
|
3325
3464
|
/** Line items in the session */
|
|
3326
3465
|
lineItems?: CheckoutSessionResponseDto["lineItems"];
|
|
3327
3466
|
/** Totals breakdown (subtotal, tax, shipping, etc.) */
|
|
@@ -3452,7 +3591,7 @@ interface XPayInstance {
|
|
|
3452
3591
|
initCheckout(options: InitCheckoutOptions): Promise<InitCheckoutResult>;
|
|
3453
3592
|
}
|
|
3454
3593
|
/**
|
|
3455
|
-
* Options for creating an Elements instance.
|
|
3594
|
+
* Options for creating an Elements instance from an existing checkout session.
|
|
3456
3595
|
*
|
|
3457
3596
|
* @example
|
|
3458
3597
|
* ```ts
|
|
@@ -3463,14 +3602,67 @@ interface XPayInstance {
|
|
|
3463
3602
|
* });
|
|
3464
3603
|
* ```
|
|
3465
3604
|
*/
|
|
3466
|
-
interface
|
|
3605
|
+
interface ElementsOptionsClientSecret {
|
|
3467
3606
|
/** The client secret from a checkout session. Can be a string or a Promise. */
|
|
3468
3607
|
clientSecret: string | Promise<string>;
|
|
3608
|
+
/** Either use mode or clientSecret when creating an Elements group. */
|
|
3609
|
+
mode?: never;
|
|
3610
|
+
/** Amount is only applicable in deferred mode (`mode: "payment"`). */
|
|
3611
|
+
amount?: never;
|
|
3612
|
+
/** Currency is only applicable in deferred mode (`mode: "payment"`). */
|
|
3613
|
+
currency?: never;
|
|
3469
3614
|
/** Appearance overrides for the checkout UI */
|
|
3470
3615
|
appearance?: Appearance;
|
|
3471
3616
|
/** Locale for the payment form — `"en"` (default) or `"ar"` */
|
|
3472
3617
|
locale?: "en" | "ar";
|
|
3473
3618
|
}
|
|
3619
|
+
/**
|
|
3620
|
+
* Options for creating a DEFERRED Elements instance — no checkout session
|
|
3621
|
+
* exists yet. The Payment Element renders immediately from the amount and
|
|
3622
|
+
* currency alone; your server creates the session with the final total when
|
|
3623
|
+
* the customer clicks Pay, and its clientSecret is passed to
|
|
3624
|
+
* `confirmPayment({ elements, clientSecret })`.
|
|
3625
|
+
*
|
|
3626
|
+
* The amount shown is the amount charged: if the session your server creates
|
|
3627
|
+
* has a different total, the confirmation fails with
|
|
3628
|
+
* `amount_reconfirmation_required` and nothing is charged.
|
|
3629
|
+
*
|
|
3630
|
+
* @example
|
|
3631
|
+
* ```ts
|
|
3632
|
+
* const elements = xpay.elements({
|
|
3633
|
+
* mode: "payment",
|
|
3634
|
+
* amount: 250000, // piasters
|
|
3635
|
+
* currency: "EGP",
|
|
3636
|
+
* });
|
|
3637
|
+
* ```
|
|
3638
|
+
*/
|
|
3639
|
+
interface ElementsOptionsMode {
|
|
3640
|
+
/** Deferred mode. Only `"payment"` is supported. */
|
|
3641
|
+
mode: "payment";
|
|
3642
|
+
/** The amount to display and charge, in the currency's smallest unit (piasters). Integer, greater than zero. */
|
|
3643
|
+
amount: number;
|
|
3644
|
+
/** Three-letter currency code (e.g. `"EGP"`). */
|
|
3645
|
+
currency: string;
|
|
3646
|
+
/** Either use mode or clientSecret when creating an Elements group. */
|
|
3647
|
+
clientSecret?: never;
|
|
3648
|
+
/** Appearance overrides for the checkout UI */
|
|
3649
|
+
appearance?: Appearance;
|
|
3650
|
+
/** Locale for the payment form — `"en"` (default) or `"ar"` */
|
|
3651
|
+
locale?: "en" | "ar";
|
|
3652
|
+
}
|
|
3653
|
+
/**
|
|
3654
|
+
* Options for creating an Elements instance — with a session's
|
|
3655
|
+
* `clientSecret`, or session-less with `{ mode, amount, currency }`
|
|
3656
|
+
* (deferred). The two forms are mutually exclusive.
|
|
3657
|
+
*/
|
|
3658
|
+
type ElementsOptions = ElementsOptionsClientSecret | ElementsOptionsMode;
|
|
3659
|
+
/** Options for `elements.update()` — deferred mode only. */
|
|
3660
|
+
interface ElementsUpdateOptions {
|
|
3661
|
+
/** New display amount in the currency's smallest unit. Integer, greater than zero. */
|
|
3662
|
+
amount?: number;
|
|
3663
|
+
/** New three-letter currency code. */
|
|
3664
|
+
currency?: string;
|
|
3665
|
+
}
|
|
3474
3666
|
/**
|
|
3475
3667
|
* Manages the lifecycle of the PaymentElement.
|
|
3476
3668
|
*
|
|
@@ -3518,6 +3710,12 @@ interface Elements {
|
|
|
3518
3710
|
fetchUpdates(): Promise<ActionResult>;
|
|
3519
3711
|
/** Update the appearance at runtime without recreating elements */
|
|
3520
3712
|
changeAppearance(appearance: Appearance): void;
|
|
3713
|
+
/**
|
|
3714
|
+
* Update the displayed amount/currency of a DEFERRED Elements instance
|
|
3715
|
+
* (created with `{ mode: "payment" }`). Throws when the instance was
|
|
3716
|
+
* created with a `clientSecret` — session amounts are server-owned.
|
|
3717
|
+
*/
|
|
3718
|
+
update(options: ElementsUpdateOptions): Promise<void>;
|
|
3521
3719
|
/** Destroy the Elements instance and clean up all resources */
|
|
3522
3720
|
destroy(): void;
|
|
3523
3721
|
}
|
|
@@ -3631,6 +3829,15 @@ interface PaymentElement extends BaseElement {
|
|
|
3631
3829
|
interface ConfirmPaymentOptions {
|
|
3632
3830
|
/** The Elements instance managing the payment form */
|
|
3633
3831
|
elements: Elements;
|
|
3832
|
+
/**
|
|
3833
|
+
* DEFERRED mode only, and required there: the clientSecret of the checkout
|
|
3834
|
+
* session your server just created with the final total. A plain string —
|
|
3835
|
+
* await your own fetch before calling. The session's total must equal the
|
|
3836
|
+
* amount the element displays, or the confirmation fails with
|
|
3837
|
+
* `amount_reconfirmation_required` and nothing is charged. Ignored when the
|
|
3838
|
+
* elements were created with a clientSecret.
|
|
3839
|
+
*/
|
|
3840
|
+
clientSecret?: string;
|
|
3634
3841
|
/** Customer details collected by the merchant's form */
|
|
3635
3842
|
customerDetails?: CustomerDetails;
|
|
3636
3843
|
/** Custom field values for the session */
|
|
@@ -3702,6 +3909,12 @@ interface CheckoutInstance {
|
|
|
3702
3909
|
/** Result of a successful payment via drop-in checkout */
|
|
3703
3910
|
interface CheckoutCompleteResult {
|
|
3704
3911
|
status: "succeeded";
|
|
3912
|
+
/**
|
|
3913
|
+
* Whether the money has arrived. `paid` for cards and other instant methods.
|
|
3914
|
+
* `unpaid` when the customer holds a reference they pay afterwards (Fawry): the
|
|
3915
|
+
* checkout is over, but fulfil only on `checkout.session.async_payment_succeeded`.
|
|
3916
|
+
*/
|
|
3917
|
+
paymentStatus: "paid" | "unpaid" | "no_payment_required";
|
|
3705
3918
|
/** The payment intent ID for server-side verification */
|
|
3706
3919
|
paymentIntentId: string;
|
|
3707
3920
|
/** The charge ID (if available) */
|
|
@@ -3857,4 +4070,4 @@ declare global {
|
|
|
3857
4070
|
declare function loadXPay(publishableKey: string): Promise<XPayInstance | null>;
|
|
3858
4071
|
|
|
3859
4072
|
export { loadXPay };
|
|
3860
|
-
export type { ActionResult, Address, Appearance, BaseElement, CheckoutActions, CheckoutCompleteResult, DiscountResponseDto as CheckoutDiscount, CheckoutError, FeesResponseDto as CheckoutFees, CheckoutInstance, LineItemDto as CheckoutLineItem, CheckoutOptions, CheckoutSession, TotalDetailsResponseDto as CheckoutTotalDetails, ConfirmPaymentOptions, CustomerDetails, Elements, ElementsLoadErrorEvent, ElementsOptions, ElementsReadyEvent, InitCheckoutOptions, InitCheckoutResult, PaymentElement, PaymentElementChangeEvent, PaymentElementOptions, PaymentMethodInfo, SessionStatus, XPayError, XPayInstance };
|
|
4073
|
+
export type { ActionResult, Address, Appearance, BaseElement, CheckoutActions, CheckoutCompleteResult, DiscountResponseDto as CheckoutDiscount, CheckoutError, FeesResponseDto as CheckoutFees, CheckoutInstance, LineItemDto as CheckoutLineItem, CheckoutOptions, CheckoutSession, TotalDetailsResponseDto as CheckoutTotalDetails, ConfirmPaymentOptions, CustomerDetails, Elements, ElementsLoadErrorEvent, ElementsOptions, ElementsOptionsClientSecret, ElementsOptionsMode, ElementsReadyEvent, ElementsUpdateOptions, InitCheckoutOptions, InitCheckoutResult, PaymentElement, PaymentElementChangeEvent, PaymentElementOptions, PaymentMethodInfo, SessionStatus, XPayError, XPayInstance };
|