@pay-com/js 1.2.0 → 1.2.1
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/lib/dts/types/index.d.ts +65 -0
- package/lib/index.d.ts +65 -0
- package/package.json +1 -1
package/lib/dts/types/index.d.ts
CHANGED
|
@@ -556,6 +556,69 @@ export type HeadlessCtpObject = {
|
|
|
556
556
|
STATUS_DECLINED: CtpCompletePaymentStatus.declined
|
|
557
557
|
}
|
|
558
558
|
|
|
559
|
+
export type CustomFieldType = 'input' | 'date' | 'checkbox' | 'radio' | 'select'
|
|
560
|
+
|
|
561
|
+
export type CustomFieldsOptions = {
|
|
562
|
+
label: string
|
|
563
|
+
value: string
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export type CustomField = {
|
|
567
|
+
id: string
|
|
568
|
+
placeholder?: string
|
|
569
|
+
label?: string
|
|
570
|
+
type?: CustomFieldType
|
|
571
|
+
inputType?: string
|
|
572
|
+
options?: CustomFieldsOptions[]
|
|
573
|
+
description?: string
|
|
574
|
+
validation?: CustomFieldsValidation
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export type CustomFieldsValidation = {
|
|
578
|
+
required?: boolean
|
|
579
|
+
max?: number
|
|
580
|
+
min?: number
|
|
581
|
+
maxLength?: number
|
|
582
|
+
minLength?: number
|
|
583
|
+
pattern?: string
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export type PaymentMethod = {
|
|
587
|
+
paymentMethodType: string
|
|
588
|
+
name: string
|
|
589
|
+
redirect?: boolean
|
|
590
|
+
fields?: CustomField[]
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export type CardBrand =
|
|
594
|
+
| 'visa'
|
|
595
|
+
| 'mastercard'
|
|
596
|
+
| 'amex'
|
|
597
|
+
| 'discover'
|
|
598
|
+
| 'jcl'
|
|
599
|
+
| 'unionpay'
|
|
600
|
+
|
|
601
|
+
export type ExistingCard = {
|
|
602
|
+
bin: string
|
|
603
|
+
brand: CardBrand
|
|
604
|
+
cardholderCurrency: string
|
|
605
|
+
country: string
|
|
606
|
+
issuerName: string
|
|
607
|
+
expMonth: string
|
|
608
|
+
expYear: string
|
|
609
|
+
last4: string
|
|
610
|
+
fingerprint: string
|
|
611
|
+
funding: 'prepaid' | 'debit' | 'credit' | 'charge'
|
|
612
|
+
network: CardBrand
|
|
613
|
+
payout: string
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export type ExistingSource = {
|
|
617
|
+
id: string
|
|
618
|
+
type: string
|
|
619
|
+
card?: ExistingCard
|
|
620
|
+
}
|
|
621
|
+
|
|
559
622
|
export type CheckoutObject = {
|
|
560
623
|
on: ListenerFn
|
|
561
624
|
once: ListenerFn
|
|
@@ -576,6 +639,8 @@ export type CheckoutObject = {
|
|
|
576
639
|
pay: PayFn
|
|
577
640
|
headless: HeadlessFn
|
|
578
641
|
ctp: (params: InitHeadlessCtpParams) => Promise<HeadlessCtpObject>
|
|
642
|
+
getPaymentMethods: () => Promise<PaymentMethod[]>
|
|
643
|
+
getExistingSources: () => Promise<ExistingSource[]>
|
|
579
644
|
}
|
|
580
645
|
|
|
581
646
|
export type CheckoutFunction = (opts: CheckoutOpts) => CheckoutObject
|
package/lib/index.d.ts
CHANGED
|
@@ -555,6 +555,69 @@ type HeadlessCtpObject = {
|
|
|
555
555
|
STATUS_DECLINED: CtpCompletePaymentStatus.declined
|
|
556
556
|
}
|
|
557
557
|
|
|
558
|
+
type CustomFieldType = 'input' | 'date' | 'checkbox' | 'radio' | 'select'
|
|
559
|
+
|
|
560
|
+
type CustomFieldsOptions = {
|
|
561
|
+
label: string
|
|
562
|
+
value: string
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
type CustomField = {
|
|
566
|
+
id: string
|
|
567
|
+
placeholder?: string
|
|
568
|
+
label?: string
|
|
569
|
+
type?: CustomFieldType
|
|
570
|
+
inputType?: string
|
|
571
|
+
options?: CustomFieldsOptions[]
|
|
572
|
+
description?: string
|
|
573
|
+
validation?: CustomFieldsValidation
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
type CustomFieldsValidation = {
|
|
577
|
+
required?: boolean
|
|
578
|
+
max?: number
|
|
579
|
+
min?: number
|
|
580
|
+
maxLength?: number
|
|
581
|
+
minLength?: number
|
|
582
|
+
pattern?: string
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
type PaymentMethod = {
|
|
586
|
+
paymentMethodType: string
|
|
587
|
+
name: string
|
|
588
|
+
redirect?: boolean
|
|
589
|
+
fields?: CustomField[]
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
type CardBrand =
|
|
593
|
+
| 'visa'
|
|
594
|
+
| 'mastercard'
|
|
595
|
+
| 'amex'
|
|
596
|
+
| 'discover'
|
|
597
|
+
| 'jcl'
|
|
598
|
+
| 'unionpay'
|
|
599
|
+
|
|
600
|
+
type ExistingCard = {
|
|
601
|
+
bin: string
|
|
602
|
+
brand: CardBrand
|
|
603
|
+
cardholderCurrency: string
|
|
604
|
+
country: string
|
|
605
|
+
issuerName: string
|
|
606
|
+
expMonth: string
|
|
607
|
+
expYear: string
|
|
608
|
+
last4: string
|
|
609
|
+
fingerprint: string
|
|
610
|
+
funding: 'prepaid' | 'debit' | 'credit' | 'charge'
|
|
611
|
+
network: CardBrand
|
|
612
|
+
payout: string
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
type ExistingSource = {
|
|
616
|
+
id: string
|
|
617
|
+
type: string
|
|
618
|
+
card?: ExistingCard
|
|
619
|
+
}
|
|
620
|
+
|
|
558
621
|
type CheckoutObject = {
|
|
559
622
|
on: ListenerFn
|
|
560
623
|
once: ListenerFn
|
|
@@ -575,6 +638,8 @@ type CheckoutObject = {
|
|
|
575
638
|
pay: PayFn
|
|
576
639
|
headless: HeadlessFn
|
|
577
640
|
ctp: (params: InitHeadlessCtpParams) => Promise<HeadlessCtpObject>
|
|
641
|
+
getPaymentMethods: () => Promise<PaymentMethod[]>
|
|
642
|
+
getExistingSources: () => Promise<ExistingSource[]>
|
|
578
643
|
}
|
|
579
644
|
|
|
580
645
|
type CheckoutFunction = (opts: CheckoutOpts) => CheckoutObject
|