@paynext/sdk 0.0.42 → 0.0.44

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
@@ -56,6 +56,7 @@ export const CheckoutComponent: FC<Readonly<IProps> = (props) => {
56
56
 
57
57
  checkout.mount({
58
58
  clientToken,
59
+ environment: 'sandbox',
59
60
  locale: 'en',
60
61
  onCheckoutComplete: (result: PaymentResult) => {
61
62
  // Handle successful payment
@@ -77,12 +78,13 @@ export const CheckoutComponent: FC<Readonly<IProps> = (props) => {
77
78
 
78
79
  ```typescript
79
80
  interface PayNextConfig {
80
- clientToken: string // Required
81
- supportedCardTypes?: CardType[] // Optional: restrict card types
82
- variant?: 'default' | 'compact' // Optional: UI variant
83
- locale?: Locale // Optional: language (en, de, fr, etc.)
84
- translate?: CheckoutTranslate // Optional: custom translations
85
- styles?: StylesConfig // Optional: custom styles
81
+ clientToken: string
82
+ supportedCardTypes?: CardType[]
83
+ variant?: 'default' | 'compact'
84
+ environment?: 'sandbox' | 'production',
85
+ locale?: Locale
86
+ translate?: CheckoutTranslate
87
+ styles?: StylesConfig
86
88
  onCheckoutComplete?: (result: PaymentResult) => void
87
89
  onCheckoutFail?: (error: Error) => void
88
90
  }
package/dist/index.d.ts CHANGED
@@ -295,14 +295,7 @@ export declare interface PaymentResult {
295
295
  };
296
296
  payment_method: {
297
297
  id: string;
298
- apple_pay?: {
299
- cryptogram: string;
300
- eci: string;
301
- exp_month: number;
302
- exp_year: number;
303
- token: string;
304
- token_service_provider: string;
305
- };
298
+ type: 'CARD' | 'PAYPAL' | 'APPLEPAY' | 'GPAY';
306
299
  billing_address: {
307
300
  city: string;
308
301
  country: string;
@@ -311,34 +304,22 @@ export declare interface PaymentResult {
311
304
  postal_code: string;
312
305
  state: string;
313
306
  };
314
- card?: {
315
- bin: string;
316
- bin_data: {
317
- brand: string;
318
- country: string;
319
- currency_code: string;
320
- description: string;
321
- funding: string;
322
- issuer: string;
323
- type: string;
324
- };
325
- cvc?: string;
326
- exp_month: number;
327
- exp_year: number;
328
- is_network_tokenized: boolean;
307
+ phone: string;
308
+ details: {
309
+ bin?: string;
329
310
  last4?: string;
330
- number?: string;
331
- };
332
- google_pay?: {
333
- cryptogram: string;
334
- eci: string;
335
311
  exp_month: number;
336
312
  exp_year: number;
337
- token: string;
338
- token_service_provider: string;
339
- };
340
- paypal?: {
341
- billing_agreement_id: string;
313
+ is_network_tokenized: boolean;
314
+ number: string;
315
+ cvc?: string;
316
+ token?: string;
317
+ token_service_provider?: string;
318
+ cryptogram?: string;
319
+ eci?: string;
320
+ token_exp_month?: number;
321
+ token_exp_year?: number;
322
+ billing_agreement_id?: string;
342
323
  payer_info: {
343
324
  email: string;
344
325
  first_name: string;
@@ -346,12 +327,19 @@ export declare interface PaymentResult {
346
327
  payer_id: string;
347
328
  tenant: string;
348
329
  };
330
+ bin_data: {
331
+ brand: string;
332
+ country: string;
333
+ currency_code: string;
334
+ description?: string;
335
+ funding: string;
336
+ issuer: string;
337
+ type: string;
338
+ };
349
339
  };
350
- phone?: string;
351
340
  threed_secure_authentication?: {
352
341
  response_code: string;
353
342
  };
354
- type: 'CARD' | 'PAYPAL' | 'APPLEPAY' | 'GPAY';
355
343
  };
356
344
  payment_status: string;
357
345
  payment_token_type: string;
@@ -431,6 +419,7 @@ export declare class PayNextCheckout {
431
419
 
432
420
  export declare interface PayNextConfig {
433
421
  clientToken: string;
422
+ environment?: 'develop' | 'sandbox' | 'production';
434
423
  supportedCardTypes?: CardType[];
435
424
  variant?: 'default' | 'compact';
436
425
  styles?: StylesConfig;
@@ -508,7 +497,7 @@ export declare interface TransactionConfigResponse extends TransactionConfig {
508
497
  declare class TransactionState extends State<TransactionConfig | null> {
509
498
  private clientToken;
510
499
  constructor(state?: TransactionConfig);
511
- updateTransaction(clientToken: string): Promise<TransactionConfig | null>;
500
+ updateTransaction(clientToken: string, environment?: 'develop' | 'sandbox' | 'production'): Promise<TransactionConfig | null>;
512
501
  }
513
502
 
514
503
  declare class TranslateState extends State<CheckoutTranslateState> {