@paynext/sdk 0.0.47 → 0.0.49

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
@@ -18,7 +18,10 @@ import '@paynext/sdk/styles'
18
18
  const checkout = new PayNextCheckout(document.getElementById('checkout-form'))
19
19
 
20
20
  await checkout.mount({
21
- clientToken: 'your-client-token',
21
+ clientToken: '<you-client-token>',
22
+ environment: 'sandbox',
23
+ apiVersion: '1.0.0'
24
+ locale: 'en',
22
25
  onCheckoutComplete: (result: PaymentResult) => {
23
26
  console.log('Payment successful!', result)
24
27
  },
@@ -48,15 +51,12 @@ export const CheckoutComponent: FC<Readonly<IProps> = (props) => {
48
51
  const checkoutRef = useRef<HTMLDivElement>(null)
49
52
 
50
53
  useEffect(() => {
51
- if (!clientToken) {
52
- return
53
- }
54
-
55
54
  const checkout = new PayNextCheckout(checkoutRef.current)
56
55
 
57
56
  checkout.mount({
58
57
  clientToken,
59
58
  environment: 'sandbox',
59
+ apiVersion: '1.0.0'
60
60
  locale: 'en',
61
61
  onCheckoutComplete: (result: PaymentResult) => {
62
62
  // Handle successful payment
@@ -80,8 +80,9 @@ export const CheckoutComponent: FC<Readonly<IProps> = (props) => {
80
80
  interface PayNextConfig {
81
81
  clientToken: string
82
82
  supportedCardTypes?: CardType[]
83
+ apiVersion: string
84
+ environment: 'sandbox' | 'production',
83
85
  variant?: 'default' | 'compact'
84
- environment?: 'sandbox' | 'production',
85
86
  locale?: Locale
86
87
  translate?: CheckoutTranslate
87
88
  styles?: StylesConfig
package/dist/index.d.ts CHANGED
@@ -435,7 +435,8 @@ export declare class PayNextCheckout {
435
435
 
436
436
  export declare interface PayNextConfig {
437
437
  clientToken: string;
438
- environment?: 'develop' | 'sandbox' | 'production';
438
+ environment: TEnvironment;
439
+ apiVersion: string;
439
440
  supportedCardTypes?: CardType[];
440
441
  variant?: 'default' | 'compact';
441
442
  styles?: StylesConfig;
@@ -476,6 +477,8 @@ declare class StylesState extends State<StylesConfig> {
476
477
  constructor(state?: StylesConfig);
477
478
  }
478
479
 
480
+ declare type TEnvironment = 'develop' | 'sandbox' | 'production';
481
+
479
482
  declare interface ThreeDsConfig {
480
483
  readonly threeDsId: string;
481
484
  readonly onReady?: () => void;
@@ -516,7 +519,7 @@ export declare interface TransactionConfigResponse extends TransactionConfig {
516
519
  declare class TransactionState extends State<TransactionConfig | null> {
517
520
  private clientToken;
518
521
  constructor(state?: TransactionConfig);
519
- updateTransaction(clientToken: string, environment?: 'develop' | 'sandbox' | 'production'): Promise<TransactionConfig | null>;
522
+ updateTransaction(clientToken: string, environment: TEnvironment, apiVersion: string): Promise<TransactionConfig | null>;
520
523
  }
521
524
 
522
525
  declare class TranslateState extends State<CheckoutTranslateState> {
@@ -538,6 +541,7 @@ declare interface VenmoConfig {
538
541
  paymentMethodUsage?: 'single_use' | 'multi_use';
539
542
  mobileWebFallBack?: boolean;
540
543
  allowNewBrowserTab?: boolean;
544
+ deepLinkReturnUrl?: string;
541
545
  }
542
546
 
543
547
  declare interface VenmoTokenizePayload {