@tonder.io/rn-sdk 0.1.7 → 0.1.8
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 +152 -0
- package/lib/commonjs/core/3DSHandler.js +1 -2
- package/lib/commonjs/core/3DSHandler.js.map +1 -1
- package/lib/commonjs/core/BaseCheckout/index.js +5 -4
- package/lib/commonjs/core/BaseCheckout/index.js.map +1 -1
- package/lib/commonjs/core/BaseEnrollment/index.js +2 -2
- package/lib/commonjs/core/BaseEnrollment/index.js.map +1 -1
- package/lib/commonjs/core/BaseSDK/index.js +1 -3
- package/lib/commonjs/core/BaseSDK/index.js.map +1 -1
- package/lib/commonjs/core/EnrollmentContainer/index.js +24 -2
- package/lib/commonjs/core/EnrollmentContainer/index.js.map +1 -1
- package/lib/commonjs/core/PaymentInlineContainer/index.js +2 -2
- package/lib/commonjs/core/PaymentInlineContainer/index.js.map +1 -1
- package/lib/commonjs/core/PaymentLiteContainer/index.js +2 -2
- package/lib/commonjs/core/PaymentLiteContainer/index.js.map +1 -1
- package/lib/commonjs/infrastructure/HttpClient.js +1 -1
- package/lib/commonjs/infrastructure/HttpClient.js.map +1 -1
- package/lib/commonjs/services/SkyflowService.js +3 -3
- package/lib/commonjs/services/SkyflowService.js.map +1 -1
- package/lib/commonjs/shared/catalog/paymentMethodsCatalog.js +16 -0
- package/lib/commonjs/shared/catalog/paymentMethodsCatalog.js.map +1 -1
- package/lib/commonjs/shared/constants/environments.js +10 -1
- package/lib/commonjs/shared/constants/environments.js.map +1 -1
- package/lib/commonjs/shared/constants/paymentMethods.js +4 -1
- package/lib/commonjs/shared/constants/paymentMethods.js.map +1 -1
- package/lib/commonjs/shared/constants/skyflow.js +3 -3
- package/lib/commonjs/shared/constants/skyflow.js.map +1 -1
- package/lib/commonjs/ui/components/CardForm/index.js +2 -1
- package/lib/commonjs/ui/components/CardForm/index.js.map +1 -1
- package/lib/commonjs/ui/components/Input/CardCVVInput.js +9 -6
- package/lib/commonjs/ui/components/Input/CardCVVInput.js.map +1 -1
- package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js +6 -1
- package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js.map +1 -1
- package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js +6 -5
- package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
- package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js +6 -5
- package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js.map +1 -1
- package/lib/commonjs/ui/components/Input/CardHolderInput.js +6 -5
- package/lib/commonjs/ui/components/Input/CardHolderInput.js.map +1 -1
- package/lib/commonjs/ui/components/Input/CardNumberInput.js +9 -5
- package/lib/commonjs/ui/components/Input/CardNumberInput.js.map +1 -1
- package/lib/commonjs/ui/components/PaymentMethodsList/index.js +3 -1
- package/lib/commonjs/ui/components/PaymentMethodsList/index.js.map +1 -1
- package/lib/commonjs/ui/components/SavedCardsList/index.js +116 -29
- package/lib/commonjs/ui/components/SavedCardsList/index.js.map +1 -1
- package/lib/commonjs/ui/features/TonderEnrollment/index.js +53 -31
- package/lib/commonjs/ui/features/TonderEnrollment/index.js.map +1 -1
- package/lib/commonjs/ui/features/TonderPayment/index.js +55 -17
- package/lib/commonjs/ui/features/TonderPayment/index.js.map +1 -1
- package/lib/commonjs/ui/providers/SkyflowContainerWrapper/index.js +18 -18
- package/lib/commonjs/ui/providers/SkyflowContainerWrapper/index.js.map +1 -1
- package/lib/commonjs/ui/providers/TonderProvider/TonderProviderWrapper.js +32 -0
- package/lib/commonjs/ui/providers/TonderProvider/TonderProviderWrapper.js.map +1 -0
- package/lib/commonjs/ui/providers/TonderProvider/index.js +11 -23
- package/lib/commonjs/ui/providers/TonderProvider/index.js.map +1 -1
- package/lib/commonjs/ui/styles/payment.js +2 -1
- package/lib/commonjs/ui/styles/payment.js.map +1 -1
- package/lib/module/core/3DSHandler.js +1 -2
- package/lib/module/core/3DSHandler.js.map +1 -1
- package/lib/module/core/BaseCheckout/index.js +6 -5
- package/lib/module/core/BaseCheckout/index.js.map +1 -1
- package/lib/module/core/BaseEnrollment/index.js +2 -2
- package/lib/module/core/BaseEnrollment/index.js.map +1 -1
- package/lib/module/core/BaseSDK/index.js +1 -3
- package/lib/module/core/BaseSDK/index.js.map +1 -1
- package/lib/module/core/EnrollmentContainer/index.js +24 -2
- package/lib/module/core/EnrollmentContainer/index.js.map +1 -1
- package/lib/module/core/PaymentInlineContainer/index.js +2 -2
- package/lib/module/core/PaymentInlineContainer/index.js.map +1 -1
- package/lib/module/core/PaymentLiteContainer/index.js +2 -2
- package/lib/module/core/PaymentLiteContainer/index.js.map +1 -1
- package/lib/module/infrastructure/HttpClient.js +1 -1
- package/lib/module/infrastructure/HttpClient.js.map +1 -1
- package/lib/module/services/SkyflowService.js +1 -1
- package/lib/module/services/SkyflowService.js.map +1 -1
- package/lib/module/shared/catalog/paymentMethodsCatalog.js +16 -0
- package/lib/module/shared/catalog/paymentMethodsCatalog.js.map +1 -1
- package/lib/module/shared/constants/environments.js +9 -1
- package/lib/module/shared/constants/environments.js.map +1 -1
- package/lib/module/shared/constants/paymentMethods.js +4 -1
- package/lib/module/shared/constants/paymentMethods.js.map +1 -1
- package/lib/module/shared/constants/skyflow.js +1 -1
- package/lib/module/shared/constants/skyflow.js.map +1 -1
- package/lib/module/ui/components/CardForm/index.js +2 -1
- package/lib/module/ui/components/CardForm/index.js.map +1 -1
- package/lib/module/ui/components/Input/CardCVVInput.js +8 -5
- package/lib/module/ui/components/Input/CardCVVInput.js.map +1 -1
- package/lib/module/ui/components/Input/CardExpirationDateInput.js +6 -1
- package/lib/module/ui/components/Input/CardExpirationDateInput.js.map +1 -1
- package/lib/module/ui/components/Input/CardExpirationMonthInput.js +5 -4
- package/lib/module/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
- package/lib/module/ui/components/Input/CardExpirationYearInput.js +5 -4
- package/lib/module/ui/components/Input/CardExpirationYearInput.js.map +1 -1
- package/lib/module/ui/components/Input/CardHolderInput.js +5 -4
- package/lib/module/ui/components/Input/CardHolderInput.js.map +1 -1
- package/lib/module/ui/components/Input/CardNumberInput.js +8 -4
- package/lib/module/ui/components/Input/CardNumberInput.js.map +1 -1
- package/lib/module/ui/components/PaymentMethodsList/index.js +4 -2
- package/lib/module/ui/components/PaymentMethodsList/index.js.map +1 -1
- package/lib/module/ui/components/SavedCardsList/index.js +116 -29
- package/lib/module/ui/components/SavedCardsList/index.js.map +1 -1
- package/lib/module/ui/features/TonderEnrollment/index.js +53 -32
- package/lib/module/ui/features/TonderEnrollment/index.js.map +1 -1
- package/lib/module/ui/features/TonderPayment/index.js +57 -19
- package/lib/module/ui/features/TonderPayment/index.js.map +1 -1
- package/lib/module/ui/providers/SkyflowContainerWrapper/index.js +17 -16
- package/lib/module/ui/providers/SkyflowContainerWrapper/index.js.map +1 -1
- package/lib/module/ui/providers/TonderProvider/TonderProviderWrapper.js +27 -0
- package/lib/module/ui/providers/TonderProvider/TonderProviderWrapper.js.map +1 -0
- package/lib/module/ui/providers/TonderProvider/index.js +9 -21
- package/lib/module/ui/providers/TonderProvider/index.js.map +1 -1
- package/lib/module/ui/styles/payment.js +2 -1
- package/lib/module/ui/styles/payment.js.map +1 -1
- package/lib/typescript/commonjs/src/core/3DSHandler.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts +1 -2
- package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts +1 -2
- package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/BaseSDK/index.d.ts +1 -3
- package/lib/typescript/commonjs/src/core/BaseSDK/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/EnrollmentContainer/index.d.ts +3 -3
- package/lib/typescript/commonjs/src/core/EnrollmentContainer/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts +1 -2
- package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/PaymentLiteContainer/index.d.ts +1 -2
- package/lib/typescript/commonjs/src/core/PaymentLiteContainer/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/infrastructure/HttpClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/services/SkyflowService.d.ts +1 -1
- package/lib/typescript/commonjs/src/services/SkyflowService.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/shared/catalog/paymentMethodsCatalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/shared/constants/environments.d.ts +2 -1
- package/lib/typescript/commonjs/src/shared/constants/environments.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/shared/constants/paymentMethods.d.ts +3 -0
- package/lib/typescript/commonjs/src/shared/constants/paymentMethods.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/baseCheckout.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/baseCheckout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/baseEnrollment.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/baseEnrollment.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/baseSDK.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/baseSDK.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/enrollment.d.ts +8 -1
- package/lib/typescript/commonjs/src/types/enrollment.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/input.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/input.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/transaction.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/transaction.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts +3 -1
- package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/PaymentMethodsList/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/SavedCardsList/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/ui/components/SavedCardsList/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/features/TonderEnrollment/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/features/TonderPayment/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/providers/SkyflowContainerWrapper/index.d.ts +1 -8
- package/lib/typescript/commonjs/src/ui/providers/SkyflowContainerWrapper/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/TonderProviderWrapper.d.ts +10 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/TonderProviderWrapper.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/styles/payment.d.ts +1 -0
- package/lib/typescript/commonjs/src/ui/styles/payment.d.ts.map +1 -1
- package/lib/typescript/module/src/core/3DSHandler.d.ts.map +1 -1
- package/lib/typescript/module/src/core/BaseCheckout/index.d.ts +1 -2
- package/lib/typescript/module/src/core/BaseCheckout/index.d.ts.map +1 -1
- package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts +1 -2
- package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts.map +1 -1
- package/lib/typescript/module/src/core/BaseSDK/index.d.ts +1 -3
- package/lib/typescript/module/src/core/BaseSDK/index.d.ts.map +1 -1
- package/lib/typescript/module/src/core/EnrollmentContainer/index.d.ts +3 -3
- package/lib/typescript/module/src/core/EnrollmentContainer/index.d.ts.map +1 -1
- package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts +1 -2
- package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
- package/lib/typescript/module/src/core/PaymentLiteContainer/index.d.ts +1 -2
- package/lib/typescript/module/src/core/PaymentLiteContainer/index.d.ts.map +1 -1
- package/lib/typescript/module/src/infrastructure/HttpClient.d.ts.map +1 -1
- package/lib/typescript/module/src/services/SkyflowService.d.ts +1 -1
- package/lib/typescript/module/src/services/SkyflowService.d.ts.map +1 -1
- package/lib/typescript/module/src/shared/catalog/paymentMethodsCatalog.d.ts.map +1 -1
- package/lib/typescript/module/src/shared/constants/environments.d.ts +2 -1
- package/lib/typescript/module/src/shared/constants/environments.d.ts.map +1 -1
- package/lib/typescript/module/src/shared/constants/paymentMethods.d.ts +3 -0
- package/lib/typescript/module/src/shared/constants/paymentMethods.d.ts.map +1 -1
- package/lib/typescript/module/src/types/baseCheckout.d.ts +1 -1
- package/lib/typescript/module/src/types/baseCheckout.d.ts.map +1 -1
- package/lib/typescript/module/src/types/baseEnrollment.d.ts +1 -1
- package/lib/typescript/module/src/types/baseEnrollment.d.ts.map +1 -1
- package/lib/typescript/module/src/types/baseSDK.d.ts +1 -1
- package/lib/typescript/module/src/types/baseSDK.d.ts.map +1 -1
- package/lib/typescript/module/src/types/enrollment.d.ts +8 -1
- package/lib/typescript/module/src/types/enrollment.d.ts.map +1 -1
- package/lib/typescript/module/src/types/input.d.ts +1 -1
- package/lib/typescript/module/src/types/input.d.ts.map +1 -1
- package/lib/typescript/module/src/types/transaction.d.ts +2 -0
- package/lib/typescript/module/src/types/transaction.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/CardForm/index.d.ts +1 -1
- package/lib/typescript/module/src/ui/components/CardForm/index.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts +3 -1
- package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/PaymentMethodsList/index.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/SavedCardsList/index.d.ts +2 -1
- package/lib/typescript/module/src/ui/components/SavedCardsList/index.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/features/TonderEnrollment/index.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/features/TonderPayment/index.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/providers/SkyflowContainerWrapper/index.d.ts +1 -8
- package/lib/typescript/module/src/ui/providers/SkyflowContainerWrapper/index.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/providers/TonderProvider/TonderProviderWrapper.d.ts +10 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/TonderProviderWrapper.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/index.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/styles/payment.d.ts +1 -0
- package/lib/typescript/module/src/ui/styles/payment.d.ts.map +1 -1
- package/package.json +12 -5
- package/src/core/3DSHandler.ts +6 -5
- package/src/core/BaseCheckout/index.ts +10 -7
- package/src/core/BaseEnrollment/index.ts +2 -4
- package/src/core/BaseSDK/index.ts +1 -7
- package/src/core/EnrollmentContainer/index.ts +31 -7
- package/src/core/PaymentInlineContainer/index.ts +2 -7
- package/src/core/PaymentLiteContainer/index.ts +2 -7
- package/src/infrastructure/HttpClient.ts +10 -5
- package/src/services/SkyflowService.ts +2 -2
- package/src/shared/catalog/paymentMethodsCatalog.ts +16 -0
- package/src/shared/constants/environments.ts +10 -1
- package/src/shared/constants/paymentMethods.ts +3 -0
- package/src/shared/constants/skyflow.ts +1 -1
- package/src/types/baseCheckout.ts +1 -1
- package/src/types/baseEnrollment.ts +1 -1
- package/src/types/baseSDK.ts +1 -1
- package/src/types/enrollment.ts +19 -2
- package/src/types/input.ts +1 -1
- package/src/types/transaction.ts +2 -0
- package/src/ui/components/CardForm/index.tsx +6 -5
- package/src/ui/components/Input/CardCVVInput.tsx +6 -2
- package/src/ui/components/Input/CardExpirationDateInput.tsx +14 -8
- package/src/ui/components/Input/CardExpirationMonthInput.tsx +3 -1
- package/src/ui/components/Input/CardExpirationYearInput.tsx +3 -1
- package/src/ui/components/Input/CardHolderInput.tsx +3 -1
- package/src/ui/components/Input/CardNumberInput.tsx +6 -1
- package/src/ui/components/PaymentMethodsList/index.tsx +15 -3
- package/src/ui/components/SavedCardsList/index.tsx +186 -65
- package/src/ui/features/TonderEnrollment/index.tsx +63 -35
- package/src/ui/features/TonderPayment/index.tsx +81 -27
- package/src/ui/providers/SkyflowContainerWrapper/index.tsx +19 -24
- package/src/ui/providers/TonderProvider/TonderProviderWrapper.tsx +32 -0
- package/src/ui/providers/TonderProvider/index.tsx +8 -31
- package/src/ui/styles/payment.ts +1 -0
- package/lib/commonjs/ui/providers/InnerProvider/index.js +0 -25
- package/lib/commonjs/ui/providers/InnerProvider/index.js.map +0 -1
- package/lib/module/ui/providers/InnerProvider/index.js +0 -19
- package/lib/module/ui/providers/InnerProvider/index.js.map +0 -1
- package/lib/typescript/commonjs/src/ui/providers/InnerProvider/index.d.ts +0 -10
- package/lib/typescript/commonjs/src/ui/providers/InnerProvider/index.d.ts.map +0 -1
- package/lib/typescript/module/src/ui/providers/InnerProvider/index.d.ts +0 -10
- package/lib/typescript/module/src/ui/providers/InnerProvider/index.d.ts.map +0 -1
- package/src/ui/providers/InnerProvider/index.tsx +0 -24
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const PAYMENT_METHODS = Object.freeze({
|
|
2
2
|
SORIANA: 'SORIANA',
|
|
3
3
|
OXXO: 'OXXO',
|
|
4
|
+
OXXOPAY: 'OXXOPAY',
|
|
4
5
|
SPEI: 'SPEI',
|
|
5
6
|
CODI: 'CODI',
|
|
6
7
|
MERCADOPAGO: 'MERCADOPAGO',
|
|
@@ -58,6 +59,8 @@ const PAYMENT_METHODS = Object.freeze({
|
|
|
58
59
|
BAM: 'BAM',
|
|
59
60
|
REFACIL: 'REFACIL',
|
|
60
61
|
ACYVALORES: 'ACYVALORES',
|
|
62
|
+
SAFETYPAYCASH: 'SAFETYPAYCASH',
|
|
63
|
+
SAFETYPAYTRANSFER: 'SAFETYPAYTRANSFER',
|
|
61
64
|
});
|
|
62
65
|
|
|
63
66
|
export { PAYMENT_METHODS };
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
ICustomerResponse,
|
|
6
6
|
IEnrollmentCallbacks,
|
|
7
7
|
} from '.';
|
|
8
|
-
import type { IConfig } from '
|
|
8
|
+
import type { IConfig } from 'skyflow-react-native';
|
|
9
9
|
import { SDKType } from './base';
|
|
10
10
|
|
|
11
11
|
export interface IBaseEnrollmentState extends IBaseState<SDKType.ENROLLMENT> {
|
package/src/types/baseSDK.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Business, IBaseState, ICustomerResponse } from '.';
|
|
2
|
-
import type { IConfig } from '
|
|
2
|
+
import type { IConfig } from 'skyflow-react-native';
|
|
3
3
|
import { SDKType } from './base';
|
|
4
4
|
|
|
5
5
|
export interface IBaseSDKState<T extends SDKType> extends IBaseState<T> {
|
package/src/types/enrollment.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
IBaseCreateOptions,
|
|
3
|
+
IBaseResponse,
|
|
4
|
+
IEvents,
|
|
5
|
+
SDKOptions,
|
|
6
|
+
} from './base';
|
|
2
7
|
import type { IBaseEnrollmentState } from './baseEnrollment';
|
|
3
8
|
import { SDKType } from './base';
|
|
4
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
ICardsSummaryResponse,
|
|
11
|
+
ICustomerCardsResponse,
|
|
12
|
+
ISaveCardResponse,
|
|
13
|
+
} from './card';
|
|
5
14
|
import type { IFormLabels, IFormPlaceholder, IStyles } from './common';
|
|
6
15
|
import type { ICustomer } from './customer';
|
|
7
16
|
import TonderError from '../shared/utils/errors';
|
|
@@ -78,4 +87,12 @@ export interface IEnrollment {
|
|
|
78
87
|
* @public
|
|
79
88
|
*/
|
|
80
89
|
getCardSummary(id: string): Promise<IBaseResponse<ICardsSummaryResponse>>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves the list of cards associated with a customer.
|
|
93
|
+
* @returns {Promise<IBaseResponse<ICustomerCardsResponse>>} A promise that resolves with the customer's card data.
|
|
94
|
+
*
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
getCustomerCards(): Promise<IBaseResponse<ICustomerCardsResponse>>;
|
|
81
98
|
}
|
package/src/types/input.ts
CHANGED
package/src/types/transaction.ts
CHANGED
|
@@ -17,12 +17,14 @@ export interface ITransaction {
|
|
|
17
17
|
is_disputed?: boolean | null;
|
|
18
18
|
number_of_payment_attempts: number;
|
|
19
19
|
card_brand?: string | null;
|
|
20
|
+
is_route_finished?: boolean;
|
|
20
21
|
number_of_installments: number;
|
|
21
22
|
payment?: ITransactionPayment;
|
|
22
23
|
checkout: ITransactionCheckout;
|
|
23
24
|
currency: ITransactionCurrency;
|
|
24
25
|
payment_method?: ITransactionPaymentMethod | null;
|
|
25
26
|
issuing_country?: string | null;
|
|
27
|
+
is_apm?: boolean;
|
|
26
28
|
decline?: {
|
|
27
29
|
error_type?: string;
|
|
28
30
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import
|
|
4
|
-
ICardFormEvents,
|
|
5
|
-
ICardFormStyles,
|
|
6
|
-
IFormLabels,
|
|
7
|
-
IFormPlaceholder,
|
|
3
|
+
import {
|
|
4
|
+
type ICardFormEvents,
|
|
5
|
+
type ICardFormStyles,
|
|
6
|
+
type IFormLabels,
|
|
7
|
+
type IFormPlaceholder,
|
|
8
8
|
} from '../../../types';
|
|
9
9
|
import { CardHolderInput } from '../Input/CardHolderInput';
|
|
10
10
|
import { CardNumberInput } from '../Input/CardNumberInput';
|
|
@@ -90,6 +90,7 @@ const styles = StyleSheet.create({
|
|
|
90
90
|
container: {
|
|
91
91
|
padding: 20,
|
|
92
92
|
paddingVertical: 10,
|
|
93
|
+
minHeight: 250,
|
|
93
94
|
},
|
|
94
95
|
expirationRow: {
|
|
95
96
|
flexDirection: 'row',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CvvElement } from '
|
|
2
|
+
import { CvvElement } from 'skyflow-react-native';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import type { InputProps } from '../../../types';
|
|
5
5
|
import {
|
|
@@ -17,20 +17,23 @@ import {
|
|
|
17
17
|
SKYFLOW_HIDDEN_ERROR_TEXT_STYLES,
|
|
18
18
|
} from '../../styles/skyflow';
|
|
19
19
|
import useTonderContext from '../../providers/TonderProvider/hook';
|
|
20
|
+
import SkyflowContainerWrapper from '../../providers/SkyflowContainerWrapper';
|
|
20
21
|
|
|
21
|
-
export const CardCVVInput: React.FC<InputProps> = ({
|
|
22
|
+
export const CardCVVInput: React.FC<InputProps & { cardId?: string }> = ({
|
|
22
23
|
placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.cvvPlaceholder,
|
|
23
24
|
label = DEFAULT_SKYFLOW_lABELS.cvvLabel,
|
|
24
25
|
style,
|
|
25
26
|
onFocus,
|
|
26
27
|
onBlur,
|
|
27
28
|
onChange,
|
|
29
|
+
cardId,
|
|
28
30
|
}) => {
|
|
29
31
|
const [errorText, setErrorText] = useState('');
|
|
30
32
|
const { state } = useTonderContext();
|
|
31
33
|
|
|
32
34
|
return (
|
|
33
35
|
<>
|
|
36
|
+
<SkyflowContainerWrapper key={`cvvElement-${cardId}`} />
|
|
34
37
|
{state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
|
|
35
38
|
<View
|
|
36
39
|
style={{
|
|
@@ -46,6 +49,7 @@ export const CardCVVInput: React.FC<InputProps> = ({
|
|
|
46
49
|
column="cvv"
|
|
47
50
|
placeholder={placeholder}
|
|
48
51
|
label={label}
|
|
52
|
+
skyflowID={cardId}
|
|
49
53
|
validations={[regexMatchRule]}
|
|
50
54
|
inputStyles={{
|
|
51
55
|
...DEFAULT_SKYFLOW_INPUT_STYLES,
|
|
@@ -14,6 +14,8 @@ import { DEFAULT_INPUT_CONTAINER_STYLES } from '../../styles/payment';
|
|
|
14
14
|
import { CardExpirationMonthInput } from './CardExpirationMonthInput';
|
|
15
15
|
import { CardExpirationYearInput } from './CardExpirationYearInput';
|
|
16
16
|
import type { InputExpiryDateProps } from '../../../types';
|
|
17
|
+
import SkyflowContainerWrapper from '../../providers/SkyflowContainerWrapper';
|
|
18
|
+
import useTonderContext from '../../providers/TonderProvider/hook';
|
|
17
19
|
|
|
18
20
|
export const CardExpirationDateInput: React.FC<InputExpiryDateProps> = ({
|
|
19
21
|
yearPlaceholder = DEFAULT_SKYFLOW_PLACEHOLDERS.expiryYearPlaceholder,
|
|
@@ -22,16 +24,20 @@ export const CardExpirationDateInput: React.FC<InputExpiryDateProps> = ({
|
|
|
22
24
|
style,
|
|
23
25
|
events,
|
|
24
26
|
}) => {
|
|
27
|
+
const { state } = useTonderContext();
|
|
25
28
|
return (
|
|
26
29
|
<View style={styles.container}>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
<SkyflowContainerWrapper />
|
|
31
|
+
{state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
|
|
32
|
+
<Text
|
|
33
|
+
style={{
|
|
34
|
+
...(DEFAULT_SKYFLOW_lABEL_STYLES.base as StyleProp<TextStyle>),
|
|
35
|
+
...((style?.labelStyles?.base || {}) as StyleProp<TextStyle>),
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
{label}
|
|
39
|
+
</Text>
|
|
40
|
+
)}
|
|
35
41
|
<View style={styles.row}>
|
|
36
42
|
<CardExpirationMonthInput
|
|
37
43
|
label={''}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import type { InputProps } from '../../../types';
|
|
4
|
-
import { ExpirationMonthElement } from '
|
|
4
|
+
import { ExpirationMonthElement } from 'skyflow-react-native';
|
|
5
5
|
import {
|
|
6
6
|
getErrorField,
|
|
7
7
|
regexMatchRule,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
SKYFLOW_HIDDEN_ERROR_TEXT_STYLES,
|
|
20
20
|
} from '../../styles/skyflow';
|
|
21
21
|
import useTonderContext from '../../providers/TonderProvider/hook';
|
|
22
|
+
import SkyflowContainerWrapper from '../../providers/SkyflowContainerWrapper';
|
|
22
23
|
|
|
23
24
|
export const CardExpirationMonthInput: React.FC<InputProps> = ({
|
|
24
25
|
placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.expiryMonthPlaceholder,
|
|
@@ -33,6 +34,7 @@ export const CardExpirationMonthInput: React.FC<InputProps> = ({
|
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<>
|
|
37
|
+
<SkyflowContainerWrapper />
|
|
36
38
|
{state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
|
|
37
39
|
<View
|
|
38
40
|
style={{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import type { InputProps } from '../../../types';
|
|
4
|
-
import { ExpirationYearElement } from '
|
|
4
|
+
import { ExpirationYearElement } from 'skyflow-react-native';
|
|
5
5
|
import {
|
|
6
6
|
getErrorField,
|
|
7
7
|
regexMatchRule,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
SKYFLOW_HIDDEN_ERROR_TEXT_STYLES,
|
|
18
18
|
} from '../../styles/skyflow';
|
|
19
19
|
import useTonderContext from '../../providers/TonderProvider/hook';
|
|
20
|
+
import SkyflowContainerWrapper from '../../providers/SkyflowContainerWrapper';
|
|
20
21
|
|
|
21
22
|
export const CardExpirationYearInput: React.FC<InputProps> = ({
|
|
22
23
|
placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.expiryYearPlaceholder,
|
|
@@ -31,6 +32,7 @@ export const CardExpirationYearInput: React.FC<InputProps> = ({
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<>
|
|
35
|
+
<SkyflowContainerWrapper />
|
|
34
36
|
{state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
|
|
35
37
|
<View
|
|
36
38
|
style={{
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
DEFAULT_SKYFLOW_PLACEHOLDERS,
|
|
10
10
|
} from '../../../shared/constants/skyflow';
|
|
11
11
|
import { Text, View } from 'react-native';
|
|
12
|
-
import { CardHolderNameElement } from '
|
|
12
|
+
import { CardHolderNameElement } from 'skyflow-react-native';
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_SKYFLOW_ERROR_TEXT_STYLES,
|
|
15
15
|
DEFAULT_SKYFLOW_INPUT_STYLES,
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from '../../styles/skyflow';
|
|
19
19
|
import { DEFAULT_INPUT_CONTAINER_STYLES } from '../../styles/payment';
|
|
20
20
|
import useTonderContext from '../../providers/TonderProvider/hook';
|
|
21
|
+
import SkyflowContainerWrapper from '../../providers/SkyflowContainerWrapper';
|
|
21
22
|
|
|
22
23
|
export const CardHolderInput: React.FC<InputProps> = ({
|
|
23
24
|
placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.namePlaceholder,
|
|
@@ -32,6 +33,7 @@ export const CardHolderInput: React.FC<InputProps> = ({
|
|
|
32
33
|
const [errorText, setErrorText] = useState('');
|
|
33
34
|
return (
|
|
34
35
|
<>
|
|
36
|
+
<SkyflowContainerWrapper />
|
|
35
37
|
{state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
|
|
36
38
|
<View
|
|
37
39
|
style={{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import type { InputProps } from '../../../types';
|
|
4
|
-
import { CardNumberElement } from '
|
|
4
|
+
import { CardNumberElement } from 'skyflow-react-native';
|
|
5
5
|
import {
|
|
6
6
|
getErrorField,
|
|
7
7
|
regexMatchRule,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
SKYFLOW_HIDDEN_ERROR_TEXT_STYLES,
|
|
18
18
|
} from '../../styles/skyflow';
|
|
19
19
|
import useTonderContext from '../../providers/TonderProvider/hook';
|
|
20
|
+
import SkyflowContainerWrapper from '../../providers/SkyflowContainerWrapper';
|
|
20
21
|
|
|
21
22
|
export const CardNumberInput: React.FC<InputProps> = ({
|
|
22
23
|
placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.cardPlaceholder,
|
|
@@ -31,6 +32,7 @@ export const CardNumberInput: React.FC<InputProps> = ({
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<>
|
|
35
|
+
<SkyflowContainerWrapper />
|
|
34
36
|
{state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
|
|
35
37
|
<View
|
|
36
38
|
style={{
|
|
@@ -44,6 +46,9 @@ export const CardNumberInput: React.FC<InputProps> = ({
|
|
|
44
46
|
container={state.skyflowContainer}
|
|
45
47
|
table="cards"
|
|
46
48
|
column="card_number"
|
|
49
|
+
options={{
|
|
50
|
+
enableCardIcon: false,
|
|
51
|
+
}}
|
|
47
52
|
placeholder={placeholder}
|
|
48
53
|
label={label}
|
|
49
54
|
validations={[regexMatchRule]}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Text,
|
|
6
|
+
Image,
|
|
7
|
+
ScrollView,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
} from 'react-native';
|
|
3
10
|
import type { IPaymentMethod, StylesSelectVariant } from '../../../types';
|
|
4
11
|
import { getPaymentMethodDetails } from '../../../shared/catalog/paymentMethodsCatalog';
|
|
5
12
|
import { RadioButton } from '../RadioButton';
|
|
@@ -25,7 +32,12 @@ const PaymentMethodsList: React.FC<PaymentMethodsListProps> = ({
|
|
|
25
32
|
{methods.map((method) => {
|
|
26
33
|
const details = getPaymentMethodDetails(method.payment_method);
|
|
27
34
|
return (
|
|
28
|
-
<
|
|
35
|
+
<TouchableOpacity
|
|
36
|
+
key={method.id}
|
|
37
|
+
style={styles.methodItem}
|
|
38
|
+
onPress={() => onMethodSelect(method.payment_method)}
|
|
39
|
+
activeOpacity={0.7}
|
|
40
|
+
>
|
|
29
41
|
<RadioButton
|
|
30
42
|
style={{
|
|
31
43
|
base: style?.radioBase,
|
|
@@ -52,7 +64,7 @@ const PaymentMethodsList: React.FC<PaymentMethodsListProps> = ({
|
|
|
52
64
|
>
|
|
53
65
|
{details.label}
|
|
54
66
|
</Text>
|
|
55
|
-
</
|
|
67
|
+
</TouchableOpacity>
|
|
56
68
|
);
|
|
57
69
|
})}
|
|
58
70
|
</ScrollView>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useEffect, useRef } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
View,
|
|
5
5
|
StyleSheet,
|
|
@@ -7,16 +7,23 @@ import {
|
|
|
7
7
|
Text,
|
|
8
8
|
Image,
|
|
9
9
|
ActivityIndicator,
|
|
10
|
+
Animated,
|
|
10
11
|
} from 'react-native';
|
|
11
12
|
import { getCardType } from '../../../shared/catalog/cardBrandCatalog';
|
|
12
13
|
import { RadioButton } from '../RadioButton';
|
|
13
|
-
import
|
|
14
|
+
import {
|
|
15
|
+
type ICard,
|
|
16
|
+
type InputProps,
|
|
17
|
+
type StylesSavedCardsVariant,
|
|
18
|
+
} from '../../../types';
|
|
14
19
|
import { Trash2 } from 'lucide-react-native';
|
|
15
20
|
import { buildBaseStyleText } from '../../../shared/utils/styleUtils';
|
|
21
|
+
import { CardCVVInput } from '@tonder.io/rn-sdk';
|
|
16
22
|
|
|
17
23
|
interface SavedCardsListProps {
|
|
18
24
|
cards: ICard[];
|
|
19
25
|
selectedMethod: string;
|
|
26
|
+
cvvProps: InputProps;
|
|
20
27
|
onMethodSelect: (methodId: string) => void;
|
|
21
28
|
onDeleteCard: (cardId: string) => Promise<void>;
|
|
22
29
|
deletingCards?: string[];
|
|
@@ -25,6 +32,153 @@ interface SavedCardsListProps {
|
|
|
25
32
|
expirationLabel?: string;
|
|
26
33
|
}
|
|
27
34
|
|
|
35
|
+
interface CardItemProps {
|
|
36
|
+
card: ICard;
|
|
37
|
+
selectedMethod: string;
|
|
38
|
+
onMethodSelect: (methodId: string) => void;
|
|
39
|
+
onDeleteCard: (cardId: string) => Promise<void>;
|
|
40
|
+
deletingCards?: string[];
|
|
41
|
+
showDeleteButton: boolean;
|
|
42
|
+
style?: StylesSavedCardsVariant;
|
|
43
|
+
expirationLabel: string;
|
|
44
|
+
isLastItem: boolean;
|
|
45
|
+
replaceTextCardNumber: (cardNumber: string) => string;
|
|
46
|
+
cvvProps: InputProps;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const CardItem: React.FC<CardItemProps> = ({
|
|
50
|
+
card,
|
|
51
|
+
selectedMethod,
|
|
52
|
+
onMethodSelect,
|
|
53
|
+
onDeleteCard,
|
|
54
|
+
deletingCards,
|
|
55
|
+
showDeleteButton,
|
|
56
|
+
style,
|
|
57
|
+
expirationLabel,
|
|
58
|
+
isLastItem,
|
|
59
|
+
replaceTextCardNumber,
|
|
60
|
+
cvvProps,
|
|
61
|
+
}) => {
|
|
62
|
+
const isSelected = selectedMethod === card.fields.skyflow_id;
|
|
63
|
+
const animationScale = useRef(new Animated.Value(0)).current;
|
|
64
|
+
const animationOpacity = useRef(new Animated.Value(0)).current;
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
Animated.parallel([
|
|
68
|
+
Animated.spring(animationScale, {
|
|
69
|
+
toValue: isSelected ? 1 : 0,
|
|
70
|
+
useNativeDriver: true,
|
|
71
|
+
friction: 8,
|
|
72
|
+
tension: 40,
|
|
73
|
+
}),
|
|
74
|
+
Animated.timing(animationOpacity, {
|
|
75
|
+
toValue: isSelected ? 1 : 0,
|
|
76
|
+
duration: 100,
|
|
77
|
+
useNativeDriver: true,
|
|
78
|
+
}),
|
|
79
|
+
]).start();
|
|
80
|
+
}, [isSelected, animationScale, animationOpacity]);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<View
|
|
84
|
+
style={[
|
|
85
|
+
styles.cardItem,
|
|
86
|
+
{ ...{ ...(style?.cardItem?.base || {}) } },
|
|
87
|
+
isLastItem && styles.cardItemContainerLast,
|
|
88
|
+
]}
|
|
89
|
+
>
|
|
90
|
+
<TouchableOpacity
|
|
91
|
+
style={[styles.cardItemPreview]}
|
|
92
|
+
onPress={() => onMethodSelect(card.fields.skyflow_id)}
|
|
93
|
+
activeOpacity={0.7}
|
|
94
|
+
>
|
|
95
|
+
<RadioButton
|
|
96
|
+
style={{
|
|
97
|
+
base: style?.radioBase,
|
|
98
|
+
selected: style?.radioSelected,
|
|
99
|
+
inner: style?.radioInner,
|
|
100
|
+
}}
|
|
101
|
+
value={card.fields.skyflow_id}
|
|
102
|
+
selected={isSelected}
|
|
103
|
+
onSelect={() => onMethodSelect(card.fields.skyflow_id)}
|
|
104
|
+
/>
|
|
105
|
+
<Image
|
|
106
|
+
source={{ uri: getCardType(card.fields.card_scheme) }}
|
|
107
|
+
style={{ ...styles.cardImage, ...(style?.cardIcon || {}) }}
|
|
108
|
+
/>
|
|
109
|
+
<View style={styles.cardInfo}>
|
|
110
|
+
<Text
|
|
111
|
+
style={{
|
|
112
|
+
...styles.cardNumber,
|
|
113
|
+
...buildBaseStyleText(style),
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
{replaceTextCardNumber(card.fields.card_number)}
|
|
117
|
+
</Text>
|
|
118
|
+
<Text
|
|
119
|
+
style={{
|
|
120
|
+
...styles.cardExpiration,
|
|
121
|
+
...buildBaseStyleText(style),
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
{expirationLabel} {card.fields.expiration_month}/
|
|
125
|
+
{card.fields.expiration_year}
|
|
126
|
+
</Text>
|
|
127
|
+
</View>
|
|
128
|
+
{(deletingCards || []).includes(card.fields.skyflow_id) && (
|
|
129
|
+
<ActivityIndicator color="#000000" size="small" />
|
|
130
|
+
)}
|
|
131
|
+
{!(deletingCards || []).includes(card.fields.skyflow_id) &&
|
|
132
|
+
showDeleteButton && (
|
|
133
|
+
<TouchableOpacity
|
|
134
|
+
onPress={(e) => {
|
|
135
|
+
e.stopPropagation();
|
|
136
|
+
onDeleteCard(card.fields.skyflow_id);
|
|
137
|
+
}}
|
|
138
|
+
style={{
|
|
139
|
+
...styles.deleteButton,
|
|
140
|
+
...(style?.deleteButton || {}),
|
|
141
|
+
}}
|
|
142
|
+
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
143
|
+
>
|
|
144
|
+
<Trash2
|
|
145
|
+
size={style?.deleteIcon?.fontSize || 16}
|
|
146
|
+
color={style?.deleteIcon?.color || '#000000'}
|
|
147
|
+
/>
|
|
148
|
+
</TouchableOpacity>
|
|
149
|
+
)}
|
|
150
|
+
</TouchableOpacity>
|
|
151
|
+
|
|
152
|
+
{/* Contenido expandible del accordion */}
|
|
153
|
+
<Animated.View
|
|
154
|
+
style={[
|
|
155
|
+
styles.expandedContent,
|
|
156
|
+
{
|
|
157
|
+
opacity: animationOpacity,
|
|
158
|
+
transform: [{ scaleY: animationScale }],
|
|
159
|
+
},
|
|
160
|
+
]}
|
|
161
|
+
>
|
|
162
|
+
{isSelected && (
|
|
163
|
+
<View style={styles.expandedContentInner}>
|
|
164
|
+
<View style={styles.expandedBodyInner}>
|
|
165
|
+
<CardCVVInput
|
|
166
|
+
style={cvvProps?.style}
|
|
167
|
+
label={cvvProps?.label}
|
|
168
|
+
placeholder={cvvProps?.placeholder}
|
|
169
|
+
onBlur={cvvProps?.onBlur}
|
|
170
|
+
onChange={cvvProps?.onChange}
|
|
171
|
+
onFocus={cvvProps?.onFocus}
|
|
172
|
+
cardId={card.fields.skyflow_id}
|
|
173
|
+
/>
|
|
174
|
+
</View>
|
|
175
|
+
</View>
|
|
176
|
+
)}
|
|
177
|
+
</Animated.View>
|
|
178
|
+
</View>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
28
182
|
const SavedCardsList: React.FC<SavedCardsListProps> = ({
|
|
29
183
|
cards,
|
|
30
184
|
selectedMethod,
|
|
@@ -34,6 +188,7 @@ const SavedCardsList: React.FC<SavedCardsListProps> = ({
|
|
|
34
188
|
showDeleteButton = true,
|
|
35
189
|
style,
|
|
36
190
|
expirationLabel = 'Exp.',
|
|
191
|
+
cvvProps,
|
|
37
192
|
}) => {
|
|
38
193
|
if (!cards.length) return null;
|
|
39
194
|
|
|
@@ -45,69 +200,20 @@ const SavedCardsList: React.FC<SavedCardsListProps> = ({
|
|
|
45
200
|
return (
|
|
46
201
|
<View style={{ ...styles.container, ...(style?.base || {}) }}>
|
|
47
202
|
{cards.map((card, index) => (
|
|
48
|
-
<
|
|
203
|
+
<CardItem
|
|
49
204
|
key={card.fields.skyflow_id}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
inner: style?.radioInner,
|
|
63
|
-
}}
|
|
64
|
-
value={card.fields.skyflow_id}
|
|
65
|
-
selected={selectedMethod === card.fields.skyflow_id}
|
|
66
|
-
onSelect={() => onMethodSelect(card.fields.skyflow_id)}
|
|
67
|
-
/>
|
|
68
|
-
<Image
|
|
69
|
-
source={{ uri: getCardType(card.fields.card_scheme) }}
|
|
70
|
-
style={{ ...styles.cardImage, ...(style?.cardIcon || {}) }}
|
|
71
|
-
/>
|
|
72
|
-
<View style={styles.cardInfo}>
|
|
73
|
-
<Text
|
|
74
|
-
style={{
|
|
75
|
-
...styles.cardNumber,
|
|
76
|
-
...buildBaseStyleText(style),
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
{replaceTextCardNumber(card.fields.card_number)}
|
|
80
|
-
</Text>
|
|
81
|
-
<Text
|
|
82
|
-
style={{
|
|
83
|
-
...styles.cardExpiration,
|
|
84
|
-
...buildBaseStyleText(style),
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
{expirationLabel} {card.fields.expiration_month}/
|
|
88
|
-
{card.fields.expiration_year}
|
|
89
|
-
</Text>
|
|
90
|
-
</View>
|
|
91
|
-
{(deletingCards || []).includes(card.fields.skyflow_id) && (
|
|
92
|
-
<ActivityIndicator color="#000000" size="small" />
|
|
93
|
-
)}
|
|
94
|
-
{!(deletingCards || []).includes(card.fields.skyflow_id) &&
|
|
95
|
-
showDeleteButton && (
|
|
96
|
-
<TouchableOpacity
|
|
97
|
-
onPress={() => onDeleteCard(card.fields.skyflow_id)}
|
|
98
|
-
style={{
|
|
99
|
-
...styles.deleteButton,
|
|
100
|
-
...(style?.deleteButton || {}),
|
|
101
|
-
}}
|
|
102
|
-
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
103
|
-
>
|
|
104
|
-
<Trash2
|
|
105
|
-
size={style?.deleteIcon?.fontSize || 16}
|
|
106
|
-
color={style?.deleteIcon?.color || '#000000'}
|
|
107
|
-
/>
|
|
108
|
-
</TouchableOpacity>
|
|
109
|
-
)}
|
|
110
|
-
</View>
|
|
205
|
+
card={card}
|
|
206
|
+
selectedMethod={selectedMethod}
|
|
207
|
+
onMethodSelect={onMethodSelect}
|
|
208
|
+
onDeleteCard={onDeleteCard}
|
|
209
|
+
deletingCards={deletingCards}
|
|
210
|
+
showDeleteButton={showDeleteButton}
|
|
211
|
+
style={style}
|
|
212
|
+
expirationLabel={expirationLabel}
|
|
213
|
+
isLastItem={index === cards.length - 1}
|
|
214
|
+
replaceTextCardNumber={replaceTextCardNumber}
|
|
215
|
+
cvvProps={cvvProps}
|
|
216
|
+
/>
|
|
111
217
|
))}
|
|
112
218
|
</View>
|
|
113
219
|
);
|
|
@@ -117,9 +223,14 @@ const styles = StyleSheet.create({
|
|
|
117
223
|
container: {
|
|
118
224
|
paddingHorizontal: 0,
|
|
119
225
|
},
|
|
120
|
-
|
|
226
|
+
cardItemPreview: {
|
|
121
227
|
flexDirection: 'row',
|
|
122
228
|
alignItems: 'center',
|
|
229
|
+
},
|
|
230
|
+
cardItemContainerLast: {
|
|
231
|
+
borderBottomWidth: 0,
|
|
232
|
+
},
|
|
233
|
+
cardItem: {
|
|
123
234
|
paddingHorizontal: 20,
|
|
124
235
|
paddingVertical: 5,
|
|
125
236
|
borderBottomWidth: 1,
|
|
@@ -145,6 +256,16 @@ const styles = StyleSheet.create({
|
|
|
145
256
|
deleteButton: {
|
|
146
257
|
padding: 10,
|
|
147
258
|
},
|
|
259
|
+
expandedContent: {},
|
|
260
|
+
expandedContentInner: {
|
|
261
|
+
paddingHorizontal: 20,
|
|
262
|
+
paddingTop: 15,
|
|
263
|
+
},
|
|
264
|
+
expandedBodyInner: {
|
|
265
|
+
paddingHorizontal: 10,
|
|
266
|
+
minHeight: 75,
|
|
267
|
+
maxWidth: '60%',
|
|
268
|
+
},
|
|
148
269
|
});
|
|
149
270
|
|
|
150
271
|
export default SavedCardsList;
|