@xpayeg/sdk 2.0.0 → 2.1.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 +15 -0
- package/dist/index.d.cts +143 -5
- package/dist/index.d.mts +143 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @xpayeg/sdk
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#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.
|
|
9
|
+
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
- [#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.
|
|
17
|
+
|
|
3
18
|
## 2.0.0
|
|
4
19
|
### Major Changes
|
|
5
20
|
|
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
|
} | {
|
|
@@ -3702,6 +3834,12 @@ interface CheckoutInstance {
|
|
|
3702
3834
|
/** Result of a successful payment via drop-in checkout */
|
|
3703
3835
|
interface CheckoutCompleteResult {
|
|
3704
3836
|
status: "succeeded";
|
|
3837
|
+
/**
|
|
3838
|
+
* Whether the money has arrived. `paid` for cards and other instant methods.
|
|
3839
|
+
* `unpaid` when the customer holds a reference they pay afterwards (Fawry): the
|
|
3840
|
+
* checkout is over, but fulfil only on `checkout.session.async_payment_succeeded`.
|
|
3841
|
+
*/
|
|
3842
|
+
paymentStatus: "paid" | "unpaid" | "no_payment_required";
|
|
3705
3843
|
/** The payment intent ID for server-side verification */
|
|
3706
3844
|
paymentIntentId: string;
|
|
3707
3845
|
/** The charge ID (if available) */
|
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
|
} | {
|
|
@@ -3702,6 +3834,12 @@ interface CheckoutInstance {
|
|
|
3702
3834
|
/** Result of a successful payment via drop-in checkout */
|
|
3703
3835
|
interface CheckoutCompleteResult {
|
|
3704
3836
|
status: "succeeded";
|
|
3837
|
+
/**
|
|
3838
|
+
* Whether the money has arrived. `paid` for cards and other instant methods.
|
|
3839
|
+
* `unpaid` when the customer holds a reference they pay afterwards (Fawry): the
|
|
3840
|
+
* checkout is over, but fulfil only on `checkout.session.async_payment_succeeded`.
|
|
3841
|
+
*/
|
|
3842
|
+
paymentStatus: "paid" | "unpaid" | "no_payment_required";
|
|
3705
3843
|
/** The payment intent ID for server-side verification */
|
|
3706
3844
|
paymentIntentId: string;
|
|
3707
3845
|
/** The charge ID (if available) */
|