@paynext/sdk 0.0.93 → 0.0.94

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 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
@@ -312,6 +312,11 @@ declare interface IPayPalButtonStyles {
312
312
 
313
313
  declare type Listener<TData> = (data: TData) => void;
314
314
 
315
+ declare interface LoadedResult {
316
+ success: boolean;
317
+ error?: CheckoutError;
318
+ }
319
+
315
320
  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
321
 
317
322
  export declare enum PaymentMethod {
@@ -503,6 +508,7 @@ export declare interface PayNextConfig {
503
508
  styles?: StylesConfig;
504
509
  translate?: CheckoutTranslateOverrides;
505
510
  locale?: Locale;
511
+ onCheckoutLoaded?: (result: LoadedResult) => void;
506
512
  onCheckoutAttempt?: (result: AttemptResult) => void;
507
513
  onCheckoutComplete?: (result: PaymentResult) => void;
508
514
  onCheckoutFail?: (error: CheckoutError) => void;