@paynext/sdk 0.0.93 → 0.0.95
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 +22 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.es.js +323 -286
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +32 -32
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,14 @@ await checkout.mount({
|
|
|
21
21
|
clientToken: '<you-client-token>',
|
|
22
22
|
environment: 'sandbox',
|
|
23
23
|
apiVersion: '1.0.0',
|
|
24
|
+
onCheckoutLoaded: (result) => {
|
|
25
|
+
// Handle checkout loaded state
|
|
26
|
+
if (result.success) {
|
|
27
|
+
console.info('Checkout loaded successfully')
|
|
28
|
+
} else {
|
|
29
|
+
console.error('Checkout loading failed:', result.error)
|
|
30
|
+
}
|
|
31
|
+
},
|
|
24
32
|
onCheckoutAttempt: (result: AttemptResult) => {
|
|
25
33
|
// Handle payment attempt
|
|
26
34
|
console.info('Payment attempt:', result)
|
|
@@ -62,6 +70,14 @@ export const CheckoutComponent: FC<Readonly<IProps> = (props) => {
|
|
|
62
70
|
clientToken,
|
|
63
71
|
environment: 'sandbox',
|
|
64
72
|
apiVersion: '1.0.0',
|
|
73
|
+
onCheckoutLoaded: (result) => {
|
|
74
|
+
// Handle checkout loaded state
|
|
75
|
+
if (result.success) {
|
|
76
|
+
console.info('Checkout loaded successfully')
|
|
77
|
+
} else {
|
|
78
|
+
console.error('Checkout loading failed:', result.error)
|
|
79
|
+
}
|
|
80
|
+
},
|
|
65
81
|
onCheckoutAttempt: (result: AttemptResult) => {
|
|
66
82
|
// Handle payment attempt
|
|
67
83
|
console.info('Payment attempt:', result)
|
|
@@ -97,10 +113,16 @@ interface PayNextConfig {
|
|
|
97
113
|
locale?: Locale
|
|
98
114
|
translate?: CheckoutTranslate
|
|
99
115
|
styles?: StylesConfig
|
|
116
|
+
onCheckoutLoaded?: (result: LoadedResult) => void
|
|
100
117
|
onCheckoutAttempt?: (result: AttemptResult) => void
|
|
101
118
|
onCheckoutComplete?: (result: PaymentResult) => void
|
|
102
119
|
onCheckoutFail?: (error: CheckoutError) => void
|
|
103
120
|
}
|
|
121
|
+
|
|
122
|
+
interface LoadedResult {
|
|
123
|
+
success: boolean
|
|
124
|
+
error?: CheckoutError
|
|
125
|
+
}
|
|
104
126
|
```
|
|
105
127
|
|
|
106
128
|
## Supported Payment Methods
|
package/dist/index.d.ts
CHANGED
|
@@ -310,8 +310,17 @@ declare interface IPayPalButtonStyles {
|
|
|
310
310
|
styles?: PayPalButtonStyle;
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
+
declare interface ISubmitButtonStyles extends HTMLStyles {
|
|
314
|
+
iconSvg?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
313
317
|
declare type Listener<TData> = (data: TData) => void;
|
|
314
318
|
|
|
319
|
+
declare interface LoadedResult {
|
|
320
|
+
success: boolean;
|
|
321
|
+
error?: CheckoutError;
|
|
322
|
+
}
|
|
323
|
+
|
|
315
324
|
export declare type Locale = 'ar' | 'en' | 'bg' | 'cs' | 'da' | 'de' | 'el' | 'es' | 'et' | 'fi' | 'fil' | 'fr' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lt' | 'lv' | 'ms' | 'ru' | 'mt' | 'no' | 'nl' | 'pl' | 'pt' | 'ro' | 'uk' | 'sk' | 'sl' | 'sv' | 'th' | 'tr' | 'vi' | 'zh';
|
|
316
325
|
|
|
317
326
|
export declare enum PaymentMethod {
|
|
@@ -503,6 +512,8 @@ export declare interface PayNextConfig {
|
|
|
503
512
|
styles?: StylesConfig;
|
|
504
513
|
translate?: CheckoutTranslateOverrides;
|
|
505
514
|
locale?: Locale;
|
|
515
|
+
errorMessageText?: string;
|
|
516
|
+
onCheckoutLoaded?: (result: LoadedResult) => void;
|
|
506
517
|
onCheckoutAttempt?: (result: AttemptResult) => void;
|
|
507
518
|
onCheckoutComplete?: (result: PaymentResult) => void;
|
|
508
519
|
onCheckoutFail?: (error: CheckoutError) => void;
|
|
@@ -528,7 +539,7 @@ declare abstract class State<TState> {
|
|
|
528
539
|
|
|
529
540
|
export declare interface StylesConfig {
|
|
530
541
|
Input?: InputStyles;
|
|
531
|
-
SubmitButton?:
|
|
542
|
+
SubmitButton?: ISubmitButtonStyles;
|
|
532
543
|
ApplePayButton?: IApplePayButtonStyles;
|
|
533
544
|
PayPalButton?: IPayPalButtonStyles;
|
|
534
545
|
GooglePayButton?: IGooglePayButtonStyles;
|