@paynext/sdk 0.0.73 → 0.0.75
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/README.md +4 -4
- package/dist/index.d.ts +10 -10
- package/dist/index.es.js +1706 -1787
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +49 -121
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ await checkout.mount({
|
|
|
25
25
|
// Handle successful payment
|
|
26
26
|
console.log('Payment successful!', result)
|
|
27
27
|
},
|
|
28
|
-
onCheckoutFail: (error:
|
|
28
|
+
onCheckoutFail: (error: IErrorInterface) => {
|
|
29
29
|
// Handle payment failure
|
|
30
30
|
console.error('Payment failed:', error)
|
|
31
31
|
}
|
|
@@ -57,12 +57,12 @@ export const CheckoutComponent: FC<Readonly<IProps> = (props) => {
|
|
|
57
57
|
checkout.mount({
|
|
58
58
|
clientToken,
|
|
59
59
|
environment: 'sandbox',
|
|
60
|
-
apiVersion: '1.0.0'
|
|
60
|
+
apiVersion: '1.0.0',
|
|
61
61
|
onCheckoutComplete: (result: PaymentResult) => {
|
|
62
62
|
// Handle successful payment
|
|
63
63
|
console.log('Payment completed:', result)
|
|
64
64
|
},
|
|
65
|
-
onCheckoutFail: (error:
|
|
65
|
+
onCheckoutFail: (error: IErrorInterface) => {
|
|
66
66
|
// Handle payment failure
|
|
67
67
|
console.error('Payment failed:', error)
|
|
68
68
|
}
|
|
@@ -90,7 +90,7 @@ interface PayNextConfig {
|
|
|
90
90
|
translate?: CheckoutTranslate
|
|
91
91
|
styles?: StylesConfig
|
|
92
92
|
onCheckoutComplete?: (result: PaymentResult) => void
|
|
93
|
-
onCheckoutFail?: (error:
|
|
93
|
+
onCheckoutFail?: (error: IErrorInterface) => void
|
|
94
94
|
}
|
|
95
95
|
```
|
|
96
96
|
|
package/dist/index.d.ts
CHANGED
|
@@ -57,8 +57,6 @@ declare class BraintreeService {
|
|
|
57
57
|
export declare enum CardType {
|
|
58
58
|
Visa = "visa",
|
|
59
59
|
Mastercard = "mastercard",
|
|
60
|
-
AmericanExpress = "american-express",
|
|
61
|
-
Discover = "discover",
|
|
62
60
|
JCB = "jcb",
|
|
63
61
|
DinersClub = "diners-club",
|
|
64
62
|
UnionPay = "unionpay",
|
|
@@ -248,7 +246,7 @@ declare type HTMLStyles = {
|
|
|
248
246
|
};
|
|
249
247
|
|
|
250
248
|
declare interface IApplePayButtonStyles {
|
|
251
|
-
styles?: Pick<ApplePayOptions, 'type' | 'style' | 'padding' | 'borderRadius' | 'size'
|
|
249
|
+
styles?: Partial<Pick<ApplePayOptions, 'type' | 'style' | 'padding' | 'borderRadius' | 'size'>>;
|
|
252
250
|
}
|
|
253
251
|
|
|
254
252
|
declare interface IButtonActionsHandler<TSuccess = void> {
|
|
@@ -265,8 +263,14 @@ declare interface ICheckoutState {
|
|
|
265
263
|
styles: StylesState;
|
|
266
264
|
}
|
|
267
265
|
|
|
266
|
+
declare interface IErrorInterface {
|
|
267
|
+
advice_code: 'try_again_later' | 'do_not_try_again';
|
|
268
|
+
decline_code: DeclineCode;
|
|
269
|
+
message: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
268
272
|
declare interface IGooglePayButtonStyles {
|
|
269
|
-
styles?: Pick<GooglePayOptions, 'type' | 'color' | 'borderRadius' | 'size'
|
|
273
|
+
styles?: Partial<Pick<GooglePayOptions, 'type' | 'color' | 'borderRadius' | 'size'>>;
|
|
270
274
|
}
|
|
271
275
|
|
|
272
276
|
declare interface InputStyles {
|
|
@@ -404,11 +408,7 @@ export declare interface PaymentResult {
|
|
|
404
408
|
refunded_amount: number;
|
|
405
409
|
status_reason: {
|
|
406
410
|
status: 'declined' | 'failed';
|
|
407
|
-
status_reason:
|
|
408
|
-
advice_code: 'try_again_later' | 'do_not_try_again';
|
|
409
|
-
decline_code: DeclineCode;
|
|
410
|
-
message: string;
|
|
411
|
-
};
|
|
411
|
+
status_reason: IErrorInterface;
|
|
412
412
|
};
|
|
413
413
|
subscription?: {
|
|
414
414
|
id: string;
|
|
@@ -486,7 +486,7 @@ export declare interface PayNextConfig {
|
|
|
486
486
|
translate?: DeepPartial<CheckoutTranslate>;
|
|
487
487
|
locale?: Locale;
|
|
488
488
|
onCheckoutComplete?: (result: PaymentResult) => void;
|
|
489
|
-
onCheckoutFail?: (error:
|
|
489
|
+
onCheckoutFail?: (error: IErrorInterface) => void;
|
|
490
490
|
}
|
|
491
491
|
|
|
492
492
|
declare class PayPalService {
|