@paynext/sdk 0.0.58 → 0.0.60

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/dist/index.d.ts CHANGED
@@ -268,6 +268,22 @@ export declare class Core {
268
268
 
269
269
  declare type CSSProperties = Record<string, string>;
270
270
 
271
+ declare enum DeclineCode {
272
+ INSUFFICIENT_FUNDS = "insufficient_funds",
273
+ AUTHENTICATION_REQUIRED = "authentication_required",
274
+ CARD_ISSUER_DECLINE = "card_issuer_decline",
275
+ GENERIC_DECLINE = "generic_decline",
276
+ WITHDRAWAL_LIMIT_EXCEEDED = "withdrawal_limit_exceeded",
277
+ DO_NOT_HONOR = "do_not_honor",
278
+ EXPIRED_CARD = "expired_card",
279
+ SUSPECTED_FRAUD = "suspected_fraud",
280
+ INCORRECT_CVC = "incorrect_cvc",
281
+ INVALID_CARD_NUMBER = "invalid_card_number",
282
+ ISSUER_UNAVAILABLE = "issuer_unavailable",
283
+ CARD_LOST_OR_STOLEN = "card_lost_or_stolen",
284
+ CARD_DECLINED = "card_declined"
285
+ }
286
+
271
287
  declare type DeepPartial<T> = T extends object ? {
272
288
  [P in keyof T]?: DeepPartial<T[P]>;
273
289
  } : T;
@@ -361,12 +377,12 @@ declare type Listener<TData> = (data: TData) => void;
361
377
 
362
378
  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' | 'nb' | 'no' | 'nl' | 'pl' | 'pt' | 'ro' | 'ua' | 'sk' | 'sl' | 'sv' | 'th' | 'tr' | 'vi' | 'zh';
363
379
 
364
- declare enum PaymentMethod {
365
- PAYPAL = "paypal",
366
- APPLE_PAY = "apple-pay",
367
- GOOGLE_PAY = "google-pay",
368
- CARD = "card",
369
- VENMO = "venmo"
380
+ export declare enum PaymentMethod {
381
+ PAYPAL = "PAYPAL",
382
+ APPLE_PAY = "APPLEPAY",
383
+ GOOGLE_PAY = "GPAY",
384
+ CARD = "CARD",
385
+ VENMO = "VENMO"
370
386
  }
371
387
 
372
388
  export declare interface PaymentResult {
@@ -418,7 +434,7 @@ export declare interface PaymentResult {
418
434
  };
419
435
  payment_method: {
420
436
  id: string;
421
- type: 'CARD' | 'PAYPAL' | 'APPLEPAY' | 'GPAY';
437
+ type: PaymentMethod;
422
438
  billing_address: {
423
439
  city: string;
424
440
  country: string;
@@ -464,7 +480,7 @@ export declare interface PaymentResult {
464
480
  response_code: string;
465
481
  };
466
482
  };
467
- payment_status: string;
483
+ payment_status: PaymentStatus;
468
484
  payment_token_type: string;
469
485
  payment_type: 'MIT' | 'CIT';
470
486
  processor: {
@@ -475,9 +491,12 @@ export declare interface PaymentResult {
475
491
  };
476
492
  refunded_amount: number;
477
493
  status_reason: {
478
- code: string;
479
- decline_type: string;
480
- message: string;
494
+ status: 'declined' | 'failed';
495
+ status_reason: {
496
+ advice_code: 'try_again_later' | 'do_not_try_again';
497
+ decline_code: DeclineCode;
498
+ message: string;
499
+ };
481
500
  };
482
501
  subscription?: {
483
502
  id: string;
@@ -528,6 +547,16 @@ export declare interface PaymentResult {
528
547
  };
529
548
  }
530
549
 
550
+ declare enum PaymentStatus {
551
+ PENDING = "PENDING",
552
+ FAILED = "FAILED",
553
+ AUTHORIZED = "AUTHORIZED",
554
+ SETTLING = "SETTLING",
555
+ SETTLED = "SETTLED",
556
+ DECLINED = "DECLINED",
557
+ CANCELLED = "CANCELLED"
558
+ }
559
+
531
560
  export declare class PayNextCheckout {
532
561
  private readonly parent;
533
562
  private readonly core;
@@ -546,7 +575,6 @@ export declare interface PayNextConfig {
546
575
  locale?: Locale;
547
576
  onCheckoutComplete?: (result: PaymentResult) => void;
548
577
  onCheckoutFail?: (error: Error) => void;
549
- useWorkflows?: boolean;
550
578
  }
551
579
 
552
580
  declare class PayPalService {