react-native-tpay 0.3.0
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/LICENSE +22 -0
- package/README.md +555 -0
- package/android/build.gradle +95 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/tpay/TpayAmbiguousBLIKPaymentHandler.kt +21 -0
- package/android/src/main/java/com/tpay/TpayModule.kt +528 -0
- package/android/src/main/java/com/tpay/TpayPackage.kt +17 -0
- package/android/src/main/java/com/tpay/TpayResult.kt +12 -0
- package/android/src/main/java/com/tpay/TpayScreenlessPaymentHandler.kt +102 -0
- package/android/src/main/java/com/tpay/TpayScreenlessResult.kt +25 -0
- package/android/src/main/java/com/tpay/TpayScreenlessResultHandler.kt +121 -0
- package/android/src/main/java/com/tpay/delegate/AddCardDelegateImpl.kt +30 -0
- package/android/src/main/java/com/tpay/delegate/PaymentDelegateImpl.kt +33 -0
- package/android/src/main/java/com/tpay/extension/AmbiguousAlias+.kt +11 -0
- package/android/src/main/java/com/tpay/extension/BlikAlias+.kt +18 -0
- package/android/src/main/java/com/tpay/extension/CardTokenTransaction+.kt +19 -0
- package/android/src/main/java/com/tpay/extension/Exception.kt +3 -0
- package/android/src/main/java/com/tpay/extension/JSONObject+.kt +10 -0
- package/android/src/main/java/com/tpay/extension/PaymentChannel+.kt +22 -0
- package/android/src/main/java/com/tpay/extension/PaymentConstraint+.kt +24 -0
- package/android/src/main/java/com/tpay/extension/PaymentGroup+.kt +21 -0
- package/android/src/main/java/com/tpay/extension/SingleTransaction+.kt +14 -0
- package/android/src/main/java/com/tpay/extension/String+.kt +30 -0
- package/android/src/main/java/com/tpay/model/CertificateConfiguration.kt +20 -0
- package/android/src/main/java/com/tpay/model/Configuration.kt +5 -0
- package/android/src/main/java/com/tpay/model/ConfigurationMerchant.kt +33 -0
- package/android/src/main/java/com/tpay/model/Languages.kt +24 -0
- package/android/src/main/java/com/tpay/model/LocalizedString.kt +21 -0
- package/android/src/main/java/com/tpay/model/MerchantAuthorization.kt +20 -0
- package/android/src/main/java/com/tpay/model/MerchantDetails.kt +32 -0
- package/android/src/main/java/com/tpay/model/PaymentMethods.kt +90 -0
- package/android/src/main/java/com/tpay/model/TpayConfiguration.kt +50 -0
- package/android/src/main/java/com/tpay/model/WalletConfiguration.kt +14 -0
- package/android/src/main/java/com/tpay/model/googlePay/GooglePayConfiguration.kt +13 -0
- package/android/src/main/java/com/tpay/model/googlePay/GooglePayConfigureResult.kt +6 -0
- package/android/src/main/java/com/tpay/model/googlePay/GooglePayUtilsConfiguration.kt +57 -0
- package/android/src/main/java/com/tpay/model/screenless/AmbiguousBLIKAlias.kt +35 -0
- package/android/src/main/java/com/tpay/model/screenless/AmbiguousBLIKPayment.kt +26 -0
- package/android/src/main/java/com/tpay/model/screenless/BLIKScreenlessPayment.kt +28 -0
- package/android/src/main/java/com/tpay/model/screenless/CreditCardData.kt +10 -0
- package/android/src/main/java/com/tpay/model/screenless/CreditCardScreenlessPayment.kt +75 -0
- package/android/src/main/java/com/tpay/model/screenless/ExpirationDate.kt +22 -0
- package/android/src/main/java/com/tpay/model/screenless/GooglePayScreenlessPayment.kt +19 -0
- package/android/src/main/java/com/tpay/model/screenless/PaymentConstraintType.kt +5 -0
- package/android/src/main/java/com/tpay/model/screenless/RatyPekaoScreenlessPayment.kt +9 -0
- package/android/src/main/java/com/tpay/model/screenless/ScreenlessPayment.kt +87 -0
- package/android/src/main/java/com/tpay/model/screenless/TransferScreenlessPayment.kt +9 -0
- package/android/src/main/java/com/tpay/util/JsonUtil.kt +178 -0
- package/android/src/main/java/com/tpay/util/TpayBackpressUtil.kt +23 -0
- package/android/src/main/java/com/tpay/util/TpayUtil.kt +67 -0
- package/android/src/main/java/com/tpay/util/ValidationMessages.kt +19 -0
- package/ios/Source/Configuration/MerchantConfiguration.swift +120 -0
- package/ios/Source/Configuration/PaymentMethodConfiguration.swift +41 -0
- package/ios/Source/Configuration/TransactionConfiguration.swift +200 -0
- package/ios/Source/Extension/TPay+Setup.swift +32 -0
- package/ios/Source/Model/Domain/BankPayment.swift +12 -0
- package/ios/Source/Model/Domain/BlikPayment.swift +14 -0
- package/ios/Source/Model/Domain/CardPayment.swift +14 -0
- package/ios/Source/Model/Domain/ConfigurationResult.swift +98 -0
- package/ios/Source/Model/Domain/ContinuePayment.swift +10 -0
- package/ios/Source/Model/Domain/DigitalWalletPayment.swift +13 -0
- package/ios/Source/Model/Domain/PaymentChannelResult.swift +44 -0
- package/ios/Source/Model/Domain/ScreenlessResult.swift +67 -0
- package/ios/Source/Model/Domain/TokenisationData.swift +16 -0
- package/ios/Source/Model/Transportation/Transportation+AmbiguousAlias.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+Bank.swift +11 -0
- package/ios/Source/Model/Transportation/Transportation+BankPayment.swift +13 -0
- package/ios/Source/Model/Transportation/Transportation+BlikPayment+Alias.swift +9 -0
- package/ios/Source/Model/Transportation/Transportation+BlikPayment.swift +13 -0
- package/ios/Source/Model/Transportation/Transportation+Callbacks+Notifications.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+Callbacks+Redirects.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+Callbacks.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+CardDetails+Configuration.swift +9 -0
- package/ios/Source/Model/Transportation/Transportation+CardDetails+ExpiryDate.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+CardDetails.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation+CardPayment.swift +13 -0
- package/ios/Source/Model/Transportation/Transportation+CardToken.swift +11 -0
- package/ios/Source/Model/Transportation/Transportation+ContinuePayment.swift +11 -0
- package/ios/Source/Model/Transportation/Transportation+DigitalWalletPayment.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation+Environment.swift +23 -0
- package/ios/Source/Model/Transportation/Transportation+Languages.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+Merchant+Authorization.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+Merchant+CertificatePinning.swift +9 -0
- package/ios/Source/Model/Transportation/Transportation+Merchant+WalletConfiguration+ApplePay.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+Merchant+WalletConfiguration.swift +9 -0
- package/ios/Source/Model/Transportation/Transportation+Merchant.swift +13 -0
- package/ios/Source/Model/Transportation/Transportation+MerchantConfiguration.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation+MerchantDetails+Detail.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+MerchantDetails.swift +11 -0
- package/ios/Source/Model/Transportation/Transportation+Payer+Address.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation+Payer.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation+PayerContext+AutomaticPaymentMethods+BlikAlias.swift +9 -0
- package/ios/Source/Model/Transportation/Transportation+PayerContext+AutomaticPaymentMethods.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+PayerContext.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+PaymentChannel.swift +21 -0
- package/ios/Source/Model/Transportation/Transportation+PaymentDetails.swift +10 -0
- package/ios/Source/Model/Transportation/Transportation+PaymentMethod.swift +47 -0
- package/ios/Source/Model/Transportation/Transportation+PaymentMethods.swift +11 -0
- package/ios/Source/Model/Transportation/Transportation+PaymentMethodsInfo.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation+SingleTransaction.swift +11 -0
- package/ios/Source/Model/Transportation/Transportation+TokenPayment.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation+Tokenisation.swift +12 -0
- package/ios/Source/Model/Transportation/Transportation.swift +3 -0
- package/ios/Source/Presentation/AddCardPresentation.swift +43 -0
- package/ios/Source/Presentation/CardTokenPresentation.swift +48 -0
- package/ios/Source/Presentation/PaymentPresentation.swift +48 -0
- package/ios/Source/Provider/DefaultMerchantDetailsProvider.swift +32 -0
- package/ios/Source/Provider/DefaultSSLCertificatesProvider.swift +14 -0
- package/ios/Source/TpaySDK.mm +35 -0
- package/ios/Source/TpaySDK.swift +324 -0
- package/ios/Tpay-Bridging-Header.h +2 -0
- package/lib/commonjs/assets/tpay_logo.png +0 -0
- package/lib/commonjs/assets/tpay_logo@2x.png +0 -0
- package/lib/commonjs/assets/tpay_logo@3x.png +0 -0
- package/lib/commonjs/component/tpay_button.js +38 -0
- package/lib/commonjs/component/tpay_button.js.map +1 -0
- package/lib/commonjs/index.js +856 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/model/language/language.js +12 -0
- package/lib/commonjs/model/language/language.js.map +1 -0
- package/lib/commonjs/model/language/languages.js +21 -0
- package/lib/commonjs/model/language/languages.js.map +1 -0
- package/lib/commonjs/model/language/localized_string.js +17 -0
- package/lib/commonjs/model/language/localized_string.js.map +1 -0
- package/lib/commonjs/model/merchant/apple_pay_configuration.js +22 -0
- package/lib/commonjs/model/merchant/apple_pay_configuration.js.map +1 -0
- package/lib/commonjs/model/merchant/certificate_configuration.js +20 -0
- package/lib/commonjs/model/merchant/certificate_configuration.js.map +1 -0
- package/lib/commonjs/model/merchant/google_pay_configuration.js +19 -0
- package/lib/commonjs/model/merchant/google_pay_configuration.js.map +1 -0
- package/lib/commonjs/model/merchant/merchant.js +27 -0
- package/lib/commonjs/model/merchant/merchant.js.map +1 -0
- package/lib/commonjs/model/merchant/merchant_authorization.js +21 -0
- package/lib/commonjs/model/merchant/merchant_authorization.js.map +1 -0
- package/lib/commonjs/model/merchant/merchant_details.js +23 -0
- package/lib/commonjs/model/merchant/merchant_details.js.map +1 -0
- package/lib/commonjs/model/merchant/tpay_environment.js +12 -0
- package/lib/commonjs/model/merchant/tpay_environment.js.map +1 -0
- package/lib/commonjs/model/merchant/wallet_configuration.js +21 -0
- package/lib/commonjs/model/merchant/wallet_configuration.js.map +1 -0
- package/lib/commonjs/model/payer/address.js +25 -0
- package/lib/commonjs/model/payer/address.js.map +1 -0
- package/lib/commonjs/model/payer/payer.js +25 -0
- package/lib/commonjs/model/payer/payer.js.map +1 -0
- package/lib/commonjs/model/payer/payer_context.js +21 -0
- package/lib/commonjs/model/payer/payer_context.js.map +1 -0
- package/lib/commonjs/model/payment_channel/payment_channel.js +35 -0
- package/lib/commonjs/model/payment_channel/payment_channel.js.map +1 -0
- package/lib/commonjs/model/payment_channel/payment_constraint.js +47 -0
- package/lib/commonjs/model/payment_channel/payment_constraint.js.map +1 -0
- package/lib/commonjs/model/payment_channel/payment_group.js +30 -0
- package/lib/commonjs/model/payment_channel/payment_group.js.map +1 -0
- package/lib/commonjs/model/payment_method/automatic_payment_methods.js +21 -0
- package/lib/commonjs/model/payment_method/automatic_payment_methods.js.map +1 -0
- package/lib/commonjs/model/payment_method/blik_alias.js +23 -0
- package/lib/commonjs/model/payment_method/blik_alias.js.map +1 -0
- package/lib/commonjs/model/payment_method/credit_card_brand.js +16 -0
- package/lib/commonjs/model/payment_method/credit_card_brand.js.map +1 -0
- package/lib/commonjs/model/payment_method/digital_wallet.js +15 -0
- package/lib/commonjs/model/payment_method/digital_wallet.js.map +1 -0
- package/lib/commonjs/model/payment_method/installment_payment.js +14 -0
- package/lib/commonjs/model/payment_method/installment_payment.js.map +1 -0
- package/lib/commonjs/model/payment_method/payment_method.js +16 -0
- package/lib/commonjs/model/payment_method/payment_method.js.map +1 -0
- package/lib/commonjs/model/payment_method/payment_methods.js +23 -0
- package/lib/commonjs/model/payment_method/payment_methods.js.map +1 -0
- package/lib/commonjs/model/payment_method/tokenized_card.js +23 -0
- package/lib/commonjs/model/payment_method/tokenized_card.js.map +1 -0
- package/lib/commonjs/model/result/google_pay_configure_result.js +33 -0
- package/lib/commonjs/model/result/google_pay_configure_result.js.map +1 -0
- package/lib/commonjs/model/result/google_pay_open_result.js +61 -0
- package/lib/commonjs/model/result/google_pay_open_result.js.map +1 -0
- package/lib/commonjs/model/result/payment_channels_result.js +42 -0
- package/lib/commonjs/model/result/payment_channels_result.js.map +1 -0
- package/lib/commonjs/model/result/result.js +96 -0
- package/lib/commonjs/model/result/result.js.map +1 -0
- package/lib/commonjs/model/result/screenless_result.js +141 -0
- package/lib/commonjs/model/result/screenless_result.js.map +1 -0
- package/lib/commonjs/model/screenless/ambiguous_alias.js +25 -0
- package/lib/commonjs/model/screenless/ambiguous_alias.js.map +1 -0
- package/lib/commonjs/model/screenless/ambiguous_blik_payment.js +23 -0
- package/lib/commonjs/model/screenless/ambiguous_blik_payment.js.map +1 -0
- package/lib/commonjs/model/screenless/apple_pay_payment.js +21 -0
- package/lib/commonjs/model/screenless/apple_pay_payment.js.map +1 -0
- package/lib/commonjs/model/screenless/blik_payment.js +26 -0
- package/lib/commonjs/model/screenless/blik_payment.js.map +1 -0
- package/lib/commonjs/model/screenless/callbacks.js +21 -0
- package/lib/commonjs/model/screenless/callbacks.js.map +1 -0
- package/lib/commonjs/model/screenless/credit_card.js +25 -0
- package/lib/commonjs/model/screenless/credit_card.js.map +1 -0
- package/lib/commonjs/model/screenless/credit_card_config.js +22 -0
- package/lib/commonjs/model/screenless/credit_card_config.js.map +1 -0
- package/lib/commonjs/model/screenless/credit_card_payment.js +26 -0
- package/lib/commonjs/model/screenless/credit_card_payment.js.map +1 -0
- package/lib/commonjs/model/screenless/expiration_date.js +21 -0
- package/lib/commonjs/model/screenless/expiration_date.js.map +1 -0
- package/lib/commonjs/model/screenless/frequency.js +18 -0
- package/lib/commonjs/model/screenless/frequency.js.map +1 -0
- package/lib/commonjs/model/screenless/google_pay_environment.js +15 -0
- package/lib/commonjs/model/screenless/google_pay_environment.js.map +1 -0
- package/lib/commonjs/model/screenless/google_pay_payment.js +21 -0
- package/lib/commonjs/model/screenless/google_pay_payment.js.map +1 -0
- package/lib/commonjs/model/screenless/google_pay_utils_configuration.js +27 -0
- package/lib/commonjs/model/screenless/google_pay_utils_configuration.js.map +1 -0
- package/lib/commonjs/model/screenless/notifications.js +21 -0
- package/lib/commonjs/model/screenless/notifications.js.map +1 -0
- package/lib/commonjs/model/screenless/payment_details.js +25 -0
- package/lib/commonjs/model/screenless/payment_details.js.map +1 -0
- package/lib/commonjs/model/screenless/raty_pekao_payment.js +21 -0
- package/lib/commonjs/model/screenless/raty_pekao_payment.js.map +1 -0
- package/lib/commonjs/model/screenless/recursive.js +23 -0
- package/lib/commonjs/model/screenless/recursive.js.map +1 -0
- package/lib/commonjs/model/screenless/redirects.js +21 -0
- package/lib/commonjs/model/screenless/redirects.js.map +1 -0
- package/lib/commonjs/model/screenless/screenless_payment.js +23 -0
- package/lib/commonjs/model/screenless/screenless_payment.js.map +1 -0
- package/lib/commonjs/model/screenless/transfer_payment.js +21 -0
- package/lib/commonjs/model/screenless/transfer_payment.js.map +1 -0
- package/lib/commonjs/model/tokenization/tokenization.js +21 -0
- package/lib/commonjs/model/tokenization/tokenization.js.map +1 -0
- package/lib/commonjs/model/tpay_configuration.js +25 -0
- package/lib/commonjs/model/tpay_configuration.js.map +1 -0
- package/lib/commonjs/model/transaction/single_transaction.js +24 -0
- package/lib/commonjs/model/transaction/single_transaction.js.map +1 -0
- package/lib/commonjs/model/transaction/token_payment.js +26 -0
- package/lib/commonjs/model/transaction/token_payment.js.map +1 -0
- package/lib/commonjs/model/transaction/transaction.js +23 -0
- package/lib/commonjs/model/transaction/transaction.js.map +1 -0
- package/lib/commonjs/util/google_pay_configuration_util.js +22 -0
- package/lib/commonjs/util/google_pay_configuration_util.js.map +1 -0
- package/lib/commonjs/util/google_pay_open_util.js +24 -0
- package/lib/commonjs/util/google_pay_open_util.js.map +1 -0
- package/lib/commonjs/util/payment_channels_util.js +22 -0
- package/lib/commonjs/util/payment_channels_util.js.map +1 -0
- package/lib/commonjs/util/result_util.js +40 -0
- package/lib/commonjs/util/result_util.js.map +1 -0
- package/lib/commonjs/util/screenless_result_util.js +38 -0
- package/lib/commonjs/util/screenless_result_util.js.map +1 -0
- package/lib/module/assets/tpay_logo.png +0 -0
- package/lib/module/assets/tpay_logo@2x.png +0 -0
- package/lib/module/assets/tpay_logo@3x.png +0 -0
- package/lib/module/component/tpay_button.js +31 -0
- package/lib/module/component/tpay_button.js.map +1 -0
- package/lib/module/index.js +204 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/model/language/language.js +6 -0
- package/lib/module/model/language/language.js.map +1 -0
- package/lib/module/model/language/languages.js +14 -0
- package/lib/module/model/language/languages.js.map +1 -0
- package/lib/module/model/language/localized_string.js +10 -0
- package/lib/module/model/language/localized_string.js.map +1 -0
- package/lib/module/model/merchant/apple_pay_configuration.js +15 -0
- package/lib/module/model/merchant/apple_pay_configuration.js.map +1 -0
- package/lib/module/model/merchant/certificate_configuration.js +13 -0
- package/lib/module/model/merchant/certificate_configuration.js.map +1 -0
- package/lib/module/model/merchant/google_pay_configuration.js +12 -0
- package/lib/module/model/merchant/google_pay_configuration.js.map +1 -0
- package/lib/module/model/merchant/merchant.js +20 -0
- package/lib/module/model/merchant/merchant.js.map +1 -0
- package/lib/module/model/merchant/merchant_authorization.js +14 -0
- package/lib/module/model/merchant/merchant_authorization.js.map +1 -0
- package/lib/module/model/merchant/merchant_details.js +16 -0
- package/lib/module/model/merchant/merchant_details.js.map +1 -0
- package/lib/module/model/merchant/tpay_environment.js +6 -0
- package/lib/module/model/merchant/tpay_environment.js.map +1 -0
- package/lib/module/model/merchant/wallet_configuration.js +14 -0
- package/lib/module/model/merchant/wallet_configuration.js.map +1 -0
- package/lib/module/model/payer/address.js +18 -0
- package/lib/module/model/payer/address.js.map +1 -0
- package/lib/module/model/payer/payer.js +18 -0
- package/lib/module/model/payer/payer.js.map +1 -0
- package/lib/module/model/payer/payer_context.js +14 -0
- package/lib/module/model/payer/payer_context.js.map +1 -0
- package/lib/module/model/payment_channel/payment_channel.js +28 -0
- package/lib/module/model/payment_channel/payment_channel.js.map +1 -0
- package/lib/module/model/payment_channel/payment_constraint.js +40 -0
- package/lib/module/model/payment_channel/payment_constraint.js.map +1 -0
- package/lib/module/model/payment_channel/payment_group.js +23 -0
- package/lib/module/model/payment_channel/payment_group.js.map +1 -0
- package/lib/module/model/payment_method/automatic_payment_methods.js +14 -0
- package/lib/module/model/payment_method/automatic_payment_methods.js.map +1 -0
- package/lib/module/model/payment_method/blik_alias.js +16 -0
- package/lib/module/model/payment_method/blik_alias.js.map +1 -0
- package/lib/module/model/payment_method/credit_card_brand.js +10 -0
- package/lib/module/model/payment_method/credit_card_brand.js.map +1 -0
- package/lib/module/model/payment_method/digital_wallet.js +9 -0
- package/lib/module/model/payment_method/digital_wallet.js.map +1 -0
- package/lib/module/model/payment_method/installment_payment.js +8 -0
- package/lib/module/model/payment_method/installment_payment.js.map +1 -0
- package/lib/module/model/payment_method/payment_method.js +10 -0
- package/lib/module/model/payment_method/payment_method.js.map +1 -0
- package/lib/module/model/payment_method/payment_methods.js +16 -0
- package/lib/module/model/payment_method/payment_methods.js.map +1 -0
- package/lib/module/model/payment_method/tokenized_card.js +16 -0
- package/lib/module/model/payment_method/tokenized_card.js.map +1 -0
- package/lib/module/model/result/google_pay_configure_result.js +24 -0
- package/lib/module/model/result/google_pay_configure_result.js.map +1 -0
- package/lib/module/model/result/google_pay_open_result.js +50 -0
- package/lib/module/model/result/google_pay_open_result.js.map +1 -0
- package/lib/module/model/result/payment_channels_result.js +33 -0
- package/lib/module/model/result/payment_channels_result.js.map +1 -0
- package/lib/module/model/result/result.js +81 -0
- package/lib/module/model/result/result.js.map +1 -0
- package/lib/module/model/result/screenless_result.js +127 -0
- package/lib/module/model/result/screenless_result.js.map +1 -0
- package/lib/module/model/screenless/ambiguous_alias.js +18 -0
- package/lib/module/model/screenless/ambiguous_alias.js.map +1 -0
- package/lib/module/model/screenless/ambiguous_blik_payment.js +16 -0
- package/lib/module/model/screenless/ambiguous_blik_payment.js.map +1 -0
- package/lib/module/model/screenless/apple_pay_payment.js +15 -0
- package/lib/module/model/screenless/apple_pay_payment.js.map +1 -0
- package/lib/module/model/screenless/blik_payment.js +20 -0
- package/lib/module/model/screenless/blik_payment.js.map +1 -0
- package/lib/module/model/screenless/callbacks.js +14 -0
- package/lib/module/model/screenless/callbacks.js.map +1 -0
- package/lib/module/model/screenless/credit_card.js +18 -0
- package/lib/module/model/screenless/credit_card.js.map +1 -0
- package/lib/module/model/screenless/credit_card_config.js +15 -0
- package/lib/module/model/screenless/credit_card_config.js.map +1 -0
- package/lib/module/model/screenless/credit_card_payment.js +20 -0
- package/lib/module/model/screenless/credit_card_payment.js.map +1 -0
- package/lib/module/model/screenless/expiration_date.js +14 -0
- package/lib/module/model/screenless/expiration_date.js.map +1 -0
- package/lib/module/model/screenless/frequency.js +12 -0
- package/lib/module/model/screenless/frequency.js.map +1 -0
- package/lib/module/model/screenless/google_pay_environment.js +9 -0
- package/lib/module/model/screenless/google_pay_environment.js.map +1 -0
- package/lib/module/model/screenless/google_pay_payment.js +15 -0
- package/lib/module/model/screenless/google_pay_payment.js.map +1 -0
- package/lib/module/model/screenless/google_pay_utils_configuration.js +20 -0
- package/lib/module/model/screenless/google_pay_utils_configuration.js.map +1 -0
- package/lib/module/model/screenless/notifications.js +14 -0
- package/lib/module/model/screenless/notifications.js.map +1 -0
- package/lib/module/model/screenless/payment_details.js +18 -0
- package/lib/module/model/screenless/payment_details.js.map +1 -0
- package/lib/module/model/screenless/raty_pekao_payment.js +15 -0
- package/lib/module/model/screenless/raty_pekao_payment.js.map +1 -0
- package/lib/module/model/screenless/recursive.js +16 -0
- package/lib/module/model/screenless/recursive.js.map +1 -0
- package/lib/module/model/screenless/redirects.js +14 -0
- package/lib/module/model/screenless/redirects.js.map +1 -0
- package/lib/module/model/screenless/screenless_payment.js +16 -0
- package/lib/module/model/screenless/screenless_payment.js.map +1 -0
- package/lib/module/model/screenless/transfer_payment.js +15 -0
- package/lib/module/model/screenless/transfer_payment.js.map +1 -0
- package/lib/module/model/tokenization/tokenization.js +14 -0
- package/lib/module/model/tokenization/tokenization.js.map +1 -0
- package/lib/module/model/tpay_configuration.js +18 -0
- package/lib/module/model/tpay_configuration.js.map +1 -0
- package/lib/module/model/transaction/single_transaction.js +18 -0
- package/lib/module/model/transaction/single_transaction.js.map +1 -0
- package/lib/module/model/transaction/token_payment.js +20 -0
- package/lib/module/model/transaction/token_payment.js.map +1 -0
- package/lib/module/model/transaction/transaction.js +16 -0
- package/lib/module/model/transaction/transaction.js.map +1 -0
- package/lib/module/util/google_pay_configuration_util.js +16 -0
- package/lib/module/util/google_pay_configuration_util.js.map +1 -0
- package/lib/module/util/google_pay_open_util.js +18 -0
- package/lib/module/util/google_pay_open_util.js.map +1 -0
- package/lib/module/util/payment_channels_util.js +16 -0
- package/lib/module/util/payment_channels_util.js.map +1 -0
- package/lib/module/util/result_util.js +41 -0
- package/lib/module/util/result_util.js.map +1 -0
- package/lib/module/util/screenless_result_util.js +32 -0
- package/lib/module/util/screenless_result_util.js.map +1 -0
- package/lib/typescript/src/component/tpay_button.d.ts +13 -0
- package/lib/typescript/src/component/tpay_button.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +147 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/model/language/language.d.ts +5 -0
- package/lib/typescript/src/model/language/language.d.ts.map +1 -0
- package/lib/typescript/src/model/language/languages.d.ts +14 -0
- package/lib/typescript/src/model/language/languages.d.ts.map +1 -0
- package/lib/typescript/src/model/language/localized_string.d.ts +10 -0
- package/lib/typescript/src/model/language/localized_string.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/apple_pay_configuration.d.ts +14 -0
- package/lib/typescript/src/model/merchant/apple_pay_configuration.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/certificate_configuration.d.ts +12 -0
- package/lib/typescript/src/model/merchant/certificate_configuration.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/google_pay_configuration.d.ts +11 -0
- package/lib/typescript/src/model/merchant/google_pay_configuration.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/merchant.d.ts +23 -0
- package/lib/typescript/src/model/merchant/merchant.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/merchant_authorization.d.ts +13 -0
- package/lib/typescript/src/model/merchant/merchant_authorization.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/merchant_details.d.ts +16 -0
- package/lib/typescript/src/model/merchant/merchant_details.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/tpay_environment.d.ts +5 -0
- package/lib/typescript/src/model/merchant/tpay_environment.d.ts.map +1 -0
- package/lib/typescript/src/model/merchant/wallet_configuration.d.ts +15 -0
- package/lib/typescript/src/model/merchant/wallet_configuration.d.ts.map +1 -0
- package/lib/typescript/src/model/payer/address.d.ts +17 -0
- package/lib/typescript/src/model/payer/address.d.ts.map +1 -0
- package/lib/typescript/src/model/payer/payer.d.ts +18 -0
- package/lib/typescript/src/model/payer/payer.d.ts.map +1 -0
- package/lib/typescript/src/model/payer/payer_context.d.ts +15 -0
- package/lib/typescript/src/model/payer/payer_context.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_channel/payment_channel.d.ts +24 -0
- package/lib/typescript/src/model/payment_channel/payment_channel.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_channel/payment_constraint.d.ts +31 -0
- package/lib/typescript/src/model/payment_channel/payment_constraint.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_channel/payment_group.d.ts +19 -0
- package/lib/typescript/src/model/payment_channel/payment_group.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/automatic_payment_methods.d.ts +15 -0
- package/lib/typescript/src/model/payment_method/automatic_payment_methods.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/blik_alias.d.ts +15 -0
- package/lib/typescript/src/model/payment_method/blik_alias.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/credit_card_brand.d.ts +9 -0
- package/lib/typescript/src/model/payment_method/credit_card_brand.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/digital_wallet.d.ts +8 -0
- package/lib/typescript/src/model/payment_method/digital_wallet.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/installment_payment.d.ts +7 -0
- package/lib/typescript/src/model/payment_method/installment_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/payment_method.d.ts +9 -0
- package/lib/typescript/src/model/payment_method/payment_method.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/payment_methods.d.ts +18 -0
- package/lib/typescript/src/model/payment_method/payment_methods.d.ts.map +1 -0
- package/lib/typescript/src/model/payment_method/tokenized_card.d.ts +16 -0
- package/lib/typescript/src/model/payment_method/tokenized_card.d.ts.map +1 -0
- package/lib/typescript/src/model/result/google_pay_configure_result.d.ts +21 -0
- package/lib/typescript/src/model/result/google_pay_configure_result.d.ts.map +1 -0
- package/lib/typescript/src/model/result/google_pay_open_result.d.ts +44 -0
- package/lib/typescript/src/model/result/google_pay_open_result.d.ts.map +1 -0
- package/lib/typescript/src/model/result/payment_channels_result.d.ts +27 -0
- package/lib/typescript/src/model/result/payment_channels_result.d.ts.map +1 -0
- package/lib/typescript/src/model/result/result.d.ts +66 -0
- package/lib/typescript/src/model/result/result.d.ts.map +1 -0
- package/lib/typescript/src/model/result/screenless_result.d.ts +98 -0
- package/lib/typescript/src/model/result/screenless_result.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/ambiguous_alias.d.ts +15 -0
- package/lib/typescript/src/model/screenless/ambiguous_alias.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/ambiguous_blik_payment.d.ts +17 -0
- package/lib/typescript/src/model/screenless/ambiguous_blik_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/apple_pay_payment.d.ts +15 -0
- package/lib/typescript/src/model/screenless/apple_pay_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/blik_payment.d.ts +21 -0
- package/lib/typescript/src/model/screenless/blik_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/callbacks.d.ts +15 -0
- package/lib/typescript/src/model/screenless/callbacks.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/credit_card.d.ts +19 -0
- package/lib/typescript/src/model/screenless/credit_card.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/credit_card_config.d.ts +14 -0
- package/lib/typescript/src/model/screenless/credit_card_config.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/credit_card_payment.d.ts +21 -0
- package/lib/typescript/src/model/screenless/credit_card_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/expiration_date.d.ts +13 -0
- package/lib/typescript/src/model/screenless/expiration_date.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/frequency.d.ts +11 -0
- package/lib/typescript/src/model/screenless/frequency.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/google_pay_environment.d.ts +8 -0
- package/lib/typescript/src/model/screenless/google_pay_environment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/google_pay_payment.d.ts +15 -0
- package/lib/typescript/src/model/screenless/google_pay_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/google_pay_utils_configuration.d.ts +20 -0
- package/lib/typescript/src/model/screenless/google_pay_utils_configuration.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/notifications.d.ts +13 -0
- package/lib/typescript/src/model/screenless/notifications.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/payment_details.d.ts +18 -0
- package/lib/typescript/src/model/screenless/payment_details.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/raty_pekao_payment.d.ts +15 -0
- package/lib/typescript/src/model/screenless/raty_pekao_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/recursive.d.ts +16 -0
- package/lib/typescript/src/model/screenless/recursive.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/redirects.d.ts +13 -0
- package/lib/typescript/src/model/screenless/redirects.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/screenless_payment.d.ts +18 -0
- package/lib/typescript/src/model/screenless/screenless_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/screenless/transfer_payment.d.ts +15 -0
- package/lib/typescript/src/model/screenless/transfer_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/tokenization/tokenization.d.ts +14 -0
- package/lib/typescript/src/model/tokenization/tokenization.d.ts.map +1 -0
- package/lib/typescript/src/model/tpay_configuration.d.ts +21 -0
- package/lib/typescript/src/model/tpay_configuration.d.ts.map +1 -0
- package/lib/typescript/src/model/transaction/single_transaction.d.ts +17 -0
- package/lib/typescript/src/model/transaction/single_transaction.d.ts.map +1 -0
- package/lib/typescript/src/model/transaction/token_payment.d.ts +19 -0
- package/lib/typescript/src/model/transaction/token_payment.d.ts.map +1 -0
- package/lib/typescript/src/model/transaction/transaction.d.ts +16 -0
- package/lib/typescript/src/model/transaction/transaction.d.ts.map +1 -0
- package/lib/typescript/src/util/google_pay_configuration_util.d.ts +3 -0
- package/lib/typescript/src/util/google_pay_configuration_util.d.ts.map +1 -0
- package/lib/typescript/src/util/google_pay_open_util.d.ts +3 -0
- package/lib/typescript/src/util/google_pay_open_util.d.ts.map +1 -0
- package/lib/typescript/src/util/payment_channels_util.d.ts +3 -0
- package/lib/typescript/src/util/payment_channels_util.d.ts.map +1 -0
- package/lib/typescript/src/util/result_util.d.ts +3 -0
- package/lib/typescript/src/util/result_util.d.ts.map +1 -0
- package/lib/typescript/src/util/screenless_result_util.d.ts +3 -0
- package/lib/typescript/src/util/screenless_result_util.d.ts.map +1 -0
- package/package.json +164 -0
- package/react-native-tpay.podspec +42 -0
- package/src/assets/tpay_logo.png +0 -0
- package/src/assets/tpay_logo@2x.png +0 -0
- package/src/assets/tpay_logo@3x.png +0 -0
- package/src/component/tpay_button.tsx +44 -0
- package/src/index.tsx +267 -0
- package/src/model/language/language.ts +4 -0
- package/src/model/language/languages.ts +21 -0
- package/src/model/language/localized_string.ts +14 -0
- package/src/model/merchant/apple_pay_configuration.ts +17 -0
- package/src/model/merchant/certificate_configuration.ts +15 -0
- package/src/model/merchant/google_pay_configuration.ts +13 -0
- package/src/model/merchant/merchant.ts +36 -0
- package/src/model/merchant/merchant_authorization.ts +16 -0
- package/src/model/merchant/merchant_details.ts +25 -0
- package/src/model/merchant/tpay_environment.ts +4 -0
- package/src/model/merchant/wallet_configuration.ts +22 -0
- package/src/model/payer/address.ts +27 -0
- package/src/model/payer/payer.ts +29 -0
- package/src/model/payer/payer_context.ts +22 -0
- package/src/model/payment_channel/payment_channel.ts +38 -0
- package/src/model/payment_channel/payment_constraint.ts +41 -0
- package/src/model/payment_channel/payment_group.ts +25 -0
- package/src/model/payment_method/automatic_payment_methods.ts +22 -0
- package/src/model/payment_method/blik_alias.ts +19 -0
- package/src/model/payment_method/credit_card_brand.ts +8 -0
- package/src/model/payment_method/digital_wallet.ts +7 -0
- package/src/model/payment_method/installment_payment.ts +6 -0
- package/src/model/payment_method/payment_method.ts +8 -0
- package/src/model/payment_method/payment_methods.ts +27 -0
- package/src/model/payment_method/tokenized_card.ts +21 -0
- package/src/model/result/google_pay_configure_result.ts +25 -0
- package/src/model/result/google_pay_open_result.ts +58 -0
- package/src/model/result/payment_channels_result.ts +36 -0
- package/src/model/result/result.ts +84 -0
- package/src/model/result/screenless_result.ts +138 -0
- package/src/model/screenless/ambiguous_alias.ts +19 -0
- package/src/model/screenless/ambiguous_blik_payment.ts +26 -0
- package/src/model/screenless/apple_pay_payment.ts +24 -0
- package/src/model/screenless/blik_payment.ts +32 -0
- package/src/model/screenless/callbacks.ts +22 -0
- package/src/model/screenless/credit_card.ts +30 -0
- package/src/model/screenless/credit_card_config.ts +18 -0
- package/src/model/screenless/credit_card_payment.ts +32 -0
- package/src/model/screenless/expiration_date.ts +16 -0
- package/src/model/screenless/frequency.ts +10 -0
- package/src/model/screenless/google_pay_environment.ts +7 -0
- package/src/model/screenless/google_pay_payment.ts +24 -0
- package/src/model/screenless/google_pay_utils_configuration.ts +33 -0
- package/src/model/screenless/notifications.ts +16 -0
- package/src/model/screenless/payment_details.ts +29 -0
- package/src/model/screenless/raty_pekao_payment.ts +24 -0
- package/src/model/screenless/recursive.ts +21 -0
- package/src/model/screenless/redirects.ts +16 -0
- package/src/model/screenless/screenless_payment.ts +27 -0
- package/src/model/screenless/transfer_payment.ts +24 -0
- package/src/model/tokenization/tokenization.ts +18 -0
- package/src/model/tpay_configuration.ts +32 -0
- package/src/model/transaction/single_transaction.ts +26 -0
- package/src/model/transaction/token_payment.ts +30 -0
- package/src/model/transaction/transaction.ts +25 -0
- package/src/util/google_pay_configuration_util.ts +25 -0
- package/src/util/google_pay_open_util.ts +31 -0
- package/src/util/payment_channels_util.ts +22 -0
- package/src/util/result_util.ts +44 -0
- package/src/util/screenless_result_util.ts +50 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React
|
|
2
|
+
import Tpay
|
|
3
|
+
|
|
4
|
+
final class AddCardPresentation: AddCardDelegate {
|
|
5
|
+
|
|
6
|
+
// MARK: - Properties
|
|
7
|
+
|
|
8
|
+
var addCardResult: ((String) -> Void)?
|
|
9
|
+
|
|
10
|
+
private var addCardSheet: AddCard.Sheet?
|
|
11
|
+
private let currnetViewController = RCTPresentedViewController()
|
|
12
|
+
|
|
13
|
+
// MARK: - API
|
|
14
|
+
|
|
15
|
+
func presentAddCard(for payer: Payer) throws {
|
|
16
|
+
addCardSheet = AddCard.Sheet(payer: payer, delegate: self)
|
|
17
|
+
|
|
18
|
+
guard let currnetViewController = currnetViewController else {
|
|
19
|
+
return
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try addCardSheet?.present(from: currnetViewController)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// MARK: - AddCardDelegate
|
|
26
|
+
|
|
27
|
+
func onTokenizationCompleted() {
|
|
28
|
+
addCardResult?(ConfigurationResult.tokenizationCompleted().toJson())
|
|
29
|
+
complete()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
func onTokenizationCancelled() {
|
|
33
|
+
addCardResult?(ConfigurationResult.tokenizationCancelled().toJson())
|
|
34
|
+
complete()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// MARK: - Private
|
|
38
|
+
|
|
39
|
+
private func complete() {
|
|
40
|
+
addCardSheet?.dismiss()
|
|
41
|
+
addCardSheet = nil
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React
|
|
2
|
+
import Tpay
|
|
3
|
+
|
|
4
|
+
final class CardTokenPresentation: CardTokenPaymentDelegate {
|
|
5
|
+
|
|
6
|
+
// MARK: - Properties
|
|
7
|
+
|
|
8
|
+
var cardTokenPaymentResult: ((String) -> Void)?
|
|
9
|
+
|
|
10
|
+
private var cardTokenSheet: CardTokenPayment.Sheet?
|
|
11
|
+
private let currnetViewController = RCTPresentedViewController()
|
|
12
|
+
|
|
13
|
+
// MARK: - API
|
|
14
|
+
|
|
15
|
+
func presentPayment(for transaction: Transaction) throws {
|
|
16
|
+
cardTokenSheet = CardTokenPayment.Sheet(transaction: transaction, delegate: self)
|
|
17
|
+
|
|
18
|
+
guard let currnetViewController = currnetViewController else {
|
|
19
|
+
return
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try cardTokenSheet?.present(from: currnetViewController)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// MARK: - CardTokenPaymentDelegate
|
|
26
|
+
|
|
27
|
+
func onCardTokenPaymentCompleted(transactionId: TransactionId) {
|
|
28
|
+
cardTokenPaymentResult?(ConfigurationResult.tokenPaymentCompleted(transactionId: transactionId).toJson())
|
|
29
|
+
complete()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
func onCardTokenPaymentCancelled(transactionId: TransactionId) {
|
|
33
|
+
cardTokenPaymentResult?(ConfigurationResult.tokenPaymentCancelled(transactionId: transactionId).toJson())
|
|
34
|
+
complete()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
func onCardTokenErrorOccured(error: ModuleError) {
|
|
38
|
+
cardTokenPaymentResult?(ConfigurationResult.tokenPayment(error: error).toJson())
|
|
39
|
+
complete()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// MARK: - Private
|
|
43
|
+
|
|
44
|
+
private func complete() {
|
|
45
|
+
cardTokenSheet?.dismiss()
|
|
46
|
+
cardTokenSheet = nil
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React
|
|
2
|
+
import Tpay
|
|
3
|
+
|
|
4
|
+
final class PaymentPresentation: PaymentDelegate {
|
|
5
|
+
|
|
6
|
+
// MARK: - Properties
|
|
7
|
+
|
|
8
|
+
var paymentResult: ((String) -> Void)?
|
|
9
|
+
|
|
10
|
+
private var paymentSheet: Payment.Sheet?
|
|
11
|
+
private let currnetViewController = RCTPresentedViewController()
|
|
12
|
+
|
|
13
|
+
// MARK: - API
|
|
14
|
+
|
|
15
|
+
func presentPayment(for transaction: Transaction) throws {
|
|
16
|
+
paymentSheet = Payment.Sheet(transaction: transaction, delegate: self)
|
|
17
|
+
|
|
18
|
+
guard let currnetViewController = currnetViewController else {
|
|
19
|
+
return
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try paymentSheet?.present(from: currnetViewController)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// MARK: - PaymentDelegate
|
|
26
|
+
|
|
27
|
+
func onPaymentCompleted(transactionId: String) {
|
|
28
|
+
paymentResult?(ConfigurationResult.paymentCompleted(transactionId: transactionId).toJson())
|
|
29
|
+
complete()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
func onPaymentCancelled(transactionId: String) {
|
|
33
|
+
paymentResult?(ConfigurationResult.paymentCancelled(transactionId: transactionId).toJson())
|
|
34
|
+
complete()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
func onErrorOccured(error: ModuleError) {
|
|
38
|
+
paymentResult?(ConfigurationResult.payment(error: error).toJson())
|
|
39
|
+
complete()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// MARK: - Private
|
|
43
|
+
|
|
44
|
+
private func complete() {
|
|
45
|
+
paymentSheet?.dismiss()
|
|
46
|
+
paymentSheet = nil
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Tpay
|
|
2
|
+
|
|
3
|
+
final class DefaultMerchantDetailsProvider: MerchantDetailsProvider {
|
|
4
|
+
|
|
5
|
+
// MARK: - Properties
|
|
6
|
+
|
|
7
|
+
private let merchantDisplayName: [Language: String]
|
|
8
|
+
private let merchantHeadquarters: [Language: String]
|
|
9
|
+
private let regulationsLink: [Language: URL]
|
|
10
|
+
|
|
11
|
+
// MARK: - Initializers
|
|
12
|
+
|
|
13
|
+
init(merchantDisplayName: [Language: String], merchantHeadquarters: [Language: String], regulationsLink: [Language: URL]) {
|
|
14
|
+
self.merchantDisplayName = merchantDisplayName
|
|
15
|
+
self.merchantHeadquarters = merchantHeadquarters
|
|
16
|
+
self.regulationsLink = regulationsLink
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// MARK: - API
|
|
20
|
+
|
|
21
|
+
func merchantDisplayName(for language: Language) -> String {
|
|
22
|
+
return merchantDisplayName[language]!
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
func merchantHeadquarters(for language: Language) -> String? {
|
|
26
|
+
return merchantHeadquarters[language]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
func regulationsLink(for language: Language) -> URL {
|
|
30
|
+
return regulationsLink[language]!
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Tpay
|
|
2
|
+
|
|
3
|
+
final class DefaultSSLCertificatesProvider: SSLCertificatesProvider {
|
|
4
|
+
|
|
5
|
+
// MARK: - Properties
|
|
6
|
+
|
|
7
|
+
var apiConfiguration: CertificatePinningConfiguration
|
|
8
|
+
|
|
9
|
+
// MARK: - Initializers
|
|
10
|
+
|
|
11
|
+
init(apiConfiguration: CertificatePinningConfiguration) {
|
|
12
|
+
self.apiConfiguration = apiConfiguration
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import "React/RCTBridgeModule.h"
|
|
3
|
+
|
|
4
|
+
@interface RCT_EXTERN_MODULE(TpayRNModule, NSObject)
|
|
5
|
+
RCT_EXTERN_METHOD(configure: (NSString *)json
|
|
6
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
7
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
8
|
+
RCT_EXTERN_METHOD(startPayment: (NSString *)json
|
|
9
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
10
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
11
|
+
RCT_EXTERN_METHOD(startCardTokenPayment: (NSString *)json
|
|
12
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
13
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
14
|
+
RCT_EXTERN_METHOD(tokenizeCard: (NSString *)json
|
|
15
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
16
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
17
|
+
RCT_EXTERN_METHOD(screenlessCreditCardPayment: (NSString *)json
|
|
18
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
19
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
20
|
+
RCT_EXTERN_METHOD(screenlessBLIKPayment: (NSString *)json
|
|
21
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
22
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
23
|
+
RCT_EXTERN_METHOD(screenlessTransferPayment: (NSString *)json
|
|
24
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
25
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
26
|
+
RCT_EXTERN_METHOD(screenlessAmbiguousBLIKPayment: (NSString *)json
|
|
27
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
28
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
29
|
+
RCT_EXTERN_METHOD(paymentWithApplePay: (NSString *)json
|
|
30
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
31
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
32
|
+
RCT_EXTERN_METHOD(availablePaymentMethods: (NSString *)json
|
|
33
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
34
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
35
|
+
@end
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import Tpay
|
|
2
|
+
import React
|
|
3
|
+
|
|
4
|
+
@objc(TpayRNModule)
|
|
5
|
+
final class TpayRNModule: NSObject, RCTBridgeModule {
|
|
6
|
+
|
|
7
|
+
static func moduleName() -> String! {
|
|
8
|
+
"TpayRNModule"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// MARK: - Properties
|
|
12
|
+
|
|
13
|
+
private let paymentPresentation = PaymentPresentation()
|
|
14
|
+
private let tokenCardPresentation = CardTokenPresentation()
|
|
15
|
+
private let addCardPresentation = AddCardPresentation()
|
|
16
|
+
|
|
17
|
+
private var blikPayments: [Headless.Models.BlikPaymentResultWithAmbiguousAliases] = []
|
|
18
|
+
|
|
19
|
+
// MARK: - Internal
|
|
20
|
+
|
|
21
|
+
@objc static func requiresMainQueueSetup() -> Bool {
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// MARK: - API
|
|
26
|
+
|
|
27
|
+
@objc func configure(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
28
|
+
guard let configuration = MerchantConfiguration(configuration: json),
|
|
29
|
+
let merchant = configuration.merchant() else {
|
|
30
|
+
resolve(ConfigurationResult.configurationFailure().toJson())
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let preferredLanguage = configuration.preferredLanguage()
|
|
35
|
+
let paymentMethods = configuration.paymentMethods()
|
|
36
|
+
let supportedLanguages = configuration.supportedLanguage()
|
|
37
|
+
let sslCertificatesProvider = configuration.sslCertificatesProvider()
|
|
38
|
+
let detailsProvider = configuration.detailsProvider()
|
|
39
|
+
|
|
40
|
+
do {
|
|
41
|
+
try TpayModule.setup(merchant: merchant,
|
|
42
|
+
paymentMethods: paymentMethods,
|
|
43
|
+
preferredLanguage: preferredLanguage,
|
|
44
|
+
supportedLanguages: supportedLanguages,
|
|
45
|
+
sslCertificatesProvider: sslCertificatesProvider,
|
|
46
|
+
detailsProvider: detailsProvider)
|
|
47
|
+
resolve(ConfigurationResult.configurationValid().toJson())
|
|
48
|
+
} catch {
|
|
49
|
+
resolve(ConfigurationResult.configurationFailure(error: error).toJson())
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@objc func startPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
54
|
+
guard let singleTransaction = TransactionConfiguration.single(transactionConfiguration: json) else {
|
|
55
|
+
resolve(ConfigurationResult.configurationFailure().toJson())
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
paymentPresentation.paymentResult = { result in resolve(result) }
|
|
60
|
+
|
|
61
|
+
DispatchQueue.main.async { [weak self] in
|
|
62
|
+
do {
|
|
63
|
+
try self?.paymentPresentation.presentPayment(for: singleTransaction)
|
|
64
|
+
} catch {
|
|
65
|
+
resolve(ConfigurationResult.configurationFailure(error: error).toJson())
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@objc func startCardTokenPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
71
|
+
guard let singleTransaction = TransactionConfiguration.cardTokenTransaction(transactionConfiguration: json) else {
|
|
72
|
+
resolve(ConfigurationResult.configurationFailure().toJson())
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
tokenCardPresentation.cardTokenPaymentResult = { result in resolve(result) }
|
|
77
|
+
|
|
78
|
+
DispatchQueue.main.async { [weak self] in
|
|
79
|
+
do {
|
|
80
|
+
try self?.tokenCardPresentation.presentPayment(for: singleTransaction)
|
|
81
|
+
} catch {
|
|
82
|
+
resolve(ConfigurationResult.configurationFailure(error: error).toJson())
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@objc func tokenizeCard(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
88
|
+
guard let tokenizationData = TransactionConfiguration.addCard(tokenisationConfiguration: json) else {
|
|
89
|
+
resolve(ConfigurationResult.configurationFailure().toJson())
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
addCardPresentation.addCardResult = { result in resolve(result) }
|
|
94
|
+
|
|
95
|
+
DispatchQueue.main.async { [weak self] in
|
|
96
|
+
do {
|
|
97
|
+
try TpayModule.configure(callbacks: CallbacksConfiguration.init(successRedirectUrl: tokenizationData.successRedirectUrl != nil ? URL(string: tokenizationData.successRedirectUrl!) : nil, errorRedirectUrl: tokenizationData.errorRedirectUrl != nil ? URL(string: tokenizationData.errorRedirectUrl!) : nil, notificationsUrl: URL(string: tokenizationData.notificationUrl)))
|
|
98
|
+
try self?.addCardPresentation.presentAddCard(for: tokenizationData.payer)
|
|
99
|
+
} catch {
|
|
100
|
+
resolve(ConfigurationResult.configurationFailure(error: error).toJson())
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@objc func screenlessCreditCardPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
106
|
+
Headless.getAvailablePaymentChannels { [weak self] result in
|
|
107
|
+
switch result {
|
|
108
|
+
case let .success(paymentChannels):
|
|
109
|
+
self?.invokeCardPayment(json, resolve: resolve, paymentChannels: paymentChannels)
|
|
110
|
+
case let .failure(error):
|
|
111
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@objc func screenlessBLIKPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
117
|
+
Headless.getAvailablePaymentChannels { [weak self] result in
|
|
118
|
+
switch result {
|
|
119
|
+
case let .success(paymentChannels):
|
|
120
|
+
self?.invokeBlikPayment(json, resolve: resolve, paymentChannels: paymentChannels)
|
|
121
|
+
case let .failure(error):
|
|
122
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@objc func screenlessTransferPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
128
|
+
Headless.getAvailablePaymentChannels { [weak self] result in
|
|
129
|
+
switch result {
|
|
130
|
+
case let .success(paymentChannels):
|
|
131
|
+
self?.invokeBankPayment(json, resolve: resolve, paymentChannels: paymentChannels)
|
|
132
|
+
case let .failure(error):
|
|
133
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@objc func paymentWithApplePay(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
139
|
+
Headless.getAvailablePaymentChannels { [weak self] result in
|
|
140
|
+
switch result {
|
|
141
|
+
case let .success(paymentChannels):
|
|
142
|
+
self?.invokeDigitalwalletPayment(json, resolve: resolve, paymentChannels: paymentChannels)
|
|
143
|
+
case let .failure(error):
|
|
144
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@objc func screenlessAmbiguousBLIKPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
150
|
+
guard let continuePayment = TransactionConfiguration.continuePayment(continuePaymentConfiguration: json),
|
|
151
|
+
let blikTranscation = blikPayments.first(where: { $0.ongoingTransaction.id == continuePayment.id }),
|
|
152
|
+
let application = blikTranscation.applications.first(where: { $0.key == continuePayment.ambiguousAlias.code && $0.name == continuePayment.ambiguousAlias.name }) else {
|
|
153
|
+
resolve(ScreenlessResult.methodCallError().toJson())
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
do {
|
|
158
|
+
try Headless.continuePayment(for: blikTranscation.ongoingTransaction,
|
|
159
|
+
with: .init(registeredAlias: .init(value: .uid(continuePayment.alias)),
|
|
160
|
+
application: application)) { result in
|
|
161
|
+
switch result {
|
|
162
|
+
case let .success(transaction):
|
|
163
|
+
resolve(ScreenlessResult.paymentCreated(continueUrl: transaction.continueUrl, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
164
|
+
case let .failure(error):
|
|
165
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
} catch {
|
|
169
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@objc func availablePaymentMethods(resolve: @escaping RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
174
|
+
Headless.getAvailablePaymentChannels { result in
|
|
175
|
+
switch result {
|
|
176
|
+
case let .success(paymentMethods):
|
|
177
|
+
let channels = PaymentMethodsConfiguration.configuration(for: paymentMethods)
|
|
178
|
+
resolve(PaymentChannelResult.configurationValid(channels: channels).toJson())
|
|
179
|
+
case let .failure(error):
|
|
180
|
+
resolve(PaymentChannelResult.configurationError(error: error).toJson())
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// MARK: - Private
|
|
186
|
+
|
|
187
|
+
private func invokeCardPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, paymentChannels: [Headless.Models.PaymentChannel]) {
|
|
188
|
+
do {
|
|
189
|
+
guard let cardPayment = TransactionConfiguration.cardPayment(cardPaymentConfiguration: json, paymentChannels: paymentChannels) else {
|
|
190
|
+
resolve(ScreenlessResult.methodCallError().toJson())
|
|
191
|
+
return
|
|
192
|
+
}
|
|
193
|
+
try TpayModule.configure(callbacks: cardPayment.callbacks)
|
|
194
|
+
if let _ = cardPayment.card {
|
|
195
|
+
try invokeCardDataPayment(cardPayment: cardPayment, resolve: resolve)
|
|
196
|
+
} else if let _ = cardPayment.cardToken {
|
|
197
|
+
try invokeCardTokenPayment(cardPayment: cardPayment, resolve: resolve)
|
|
198
|
+
} else {
|
|
199
|
+
resolve(ScreenlessResult.methodCallError().toJson())
|
|
200
|
+
}
|
|
201
|
+
} catch {
|
|
202
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private func invokeCardDataPayment(cardPayment: CardPayment, resolve: @escaping RCTPromiseResolveBlock) throws {
|
|
207
|
+
try Headless.invokePayment(for: cardPayment, using: cardPayment.paymentChannel, with: cardPayment.card!) { result in
|
|
208
|
+
switch result {
|
|
209
|
+
case let .success(transaction):
|
|
210
|
+
resolve(ScreenlessResult.paymentCreated(continueUrl: transaction.continueUrl, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
211
|
+
case let .failure(error):
|
|
212
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
private func invokeCardTokenPayment(cardPayment: CardPayment, resolve: @escaping RCTPromiseResolveBlock) throws {
|
|
218
|
+
try Headless.invokePayment(for: cardPayment, using: cardPayment.paymentChannel, with: cardPayment.cardToken!) { result in
|
|
219
|
+
switch result {
|
|
220
|
+
case let .success(transaction):
|
|
221
|
+
resolve(ScreenlessResult.paymentCreated(continueUrl: transaction.continueUrl, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
222
|
+
case let .failure(error):
|
|
223
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private func invokeBlikPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, paymentChannels: [Headless.Models.PaymentChannel]) {
|
|
229
|
+
guard let blikPayment = TransactionConfiguration.blikPayment(blikPaymentConfiguration: json, paymentChannels: paymentChannels) else {
|
|
230
|
+
resolve(ScreenlessResult.methodCallError().toJson())
|
|
231
|
+
return
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
do {
|
|
235
|
+
try TpayModule.configure(callbacks: blikPayment.callbacks)
|
|
236
|
+
if let _ = blikPayment.token {
|
|
237
|
+
try invokeBlikTokenPayment(blikPayment: blikPayment, resolve: resolve)
|
|
238
|
+
} else if let _ = blikPayment.alias {
|
|
239
|
+
try invokeBlikAliasPayment(blikPayment: blikPayment, resolve: resolve)
|
|
240
|
+
} else {
|
|
241
|
+
resolve(ScreenlessResult.methodCallError().toJson())
|
|
242
|
+
}
|
|
243
|
+
} catch {
|
|
244
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
private func invokeBlikTokenPayment(blikPayment: BlikPayment, resolve: @escaping RCTPromiseResolveBlock) throws {
|
|
249
|
+
try Headless.invokePayment(for: blikPayment,
|
|
250
|
+
using: blikPayment.paymentChannel,
|
|
251
|
+
with: Headless.Models.Blik.Regular(token: blikPayment.token!,
|
|
252
|
+
aliasToBeRegistered: blikPayment.alias.flatMap { BlikAlias(value: .uid($0)) })) { result in
|
|
253
|
+
switch result {
|
|
254
|
+
case let .success(transaction):
|
|
255
|
+
resolve(ScreenlessResult.paymentCreated(continueUrl: transaction.continueUrl, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
256
|
+
case let .failure(error):
|
|
257
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
private func invokeBlikAliasPayment(blikPayment: BlikPayment, resolve: @escaping RCTPromiseResolveBlock) throws {
|
|
263
|
+
try Headless.invokePayment(for: blikPayment,
|
|
264
|
+
using: blikPayment.paymentChannel,
|
|
265
|
+
with: Headless.Models.Blik.OneClick(registeredAlias: .init(value: .uid(blikPayment.alias!)))) { [weak self] result in
|
|
266
|
+
switch result {
|
|
267
|
+
case let .success(transaction):
|
|
268
|
+
if let blikTransaction = transaction as? Headless.Models.BlikPaymentResultWithAmbiguousAliases {
|
|
269
|
+
self?.blikPayments.append(blikTransaction)
|
|
270
|
+
let aliases = TransactionConfiguration.makeAliases(from: blikTransaction.applications)
|
|
271
|
+
resolve(ScreenlessResult.ambiguousAlias(aliases: aliases, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
272
|
+
} else {
|
|
273
|
+
resolve(ScreenlessResult.paymentCreated(continueUrl: transaction.continueUrl, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
274
|
+
}
|
|
275
|
+
case let .failure(error):
|
|
276
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
private func invokeBankPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, paymentChannels: [Headless.Models.PaymentChannel]) {
|
|
282
|
+
guard let bankPayment = TransactionConfiguration.bankPayment(bankPaymentConfiguration: json, paymentChannels: paymentChannels) else {
|
|
283
|
+
resolve(ScreenlessResult.methodCallError().toJson())
|
|
284
|
+
return
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
do {
|
|
288
|
+
try TpayModule.configure(callbacks: bankPayment.callbacks)
|
|
289
|
+
try Headless.invokePayment(for: bankPayment, using: bankPayment.paymentChannel) { result in
|
|
290
|
+
switch result {
|
|
291
|
+
case let .success(transaction):
|
|
292
|
+
resolve(ScreenlessResult.paymentCreated(continueUrl: transaction.continueUrl, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
293
|
+
case let .failure(error):
|
|
294
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
} catch {
|
|
298
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
private func invokeDigitalwalletPayment(_ json: String, resolve: @escaping RCTPromiseResolveBlock, paymentChannels: [Headless.Models.PaymentChannel]) {
|
|
303
|
+
guard let digitalWalletPayment = TransactionConfiguration.digitalWalletPayment(digitalWalletPaymentConfiguration: json,
|
|
304
|
+
paymentChannels: paymentChannels) else {
|
|
305
|
+
resolve(ScreenlessResult.methodCallError().toJson())
|
|
306
|
+
return
|
|
307
|
+
}
|
|
308
|
+
do {
|
|
309
|
+
try TpayModule.configure(callbacks: digitalWalletPayment.callbacks)
|
|
310
|
+
try Headless.invokePayment(for: digitalWalletPayment,
|
|
311
|
+
using: digitalWalletPayment.paymentChannel,
|
|
312
|
+
with: .init(token: digitalWalletPayment.token)) { result in
|
|
313
|
+
switch result {
|
|
314
|
+
case let .success(transaction):
|
|
315
|
+
resolve(ScreenlessResult.paymentCreated(continueUrl: transaction.continueUrl, transactionId: transaction.ongoingTransaction.id).toJson())
|
|
316
|
+
case let .failure(error):
|
|
317
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
} catch {
|
|
321
|
+
resolve(ScreenlessResult.paymentFailure(error: error).toJson())
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TpayButton = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
const TpayButton = ({
|
|
10
|
+
onClick,
|
|
11
|
+
isEnabled
|
|
12
|
+
}) => {
|
|
13
|
+
const [isPressed, setIsPressed] = (0, _react.useState)(false);
|
|
14
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
15
|
+
style: {
|
|
16
|
+
backgroundColor: isPressed ? '#112458' : '#2248B0',
|
|
17
|
+
borderRadius: 48
|
|
18
|
+
},
|
|
19
|
+
onPressIn: _ => setIsPressed(true),
|
|
20
|
+
onPressOut: _ => {
|
|
21
|
+
setIsPressed(false);
|
|
22
|
+
onClick();
|
|
23
|
+
},
|
|
24
|
+
disabled: !isEnabled
|
|
25
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
26
|
+
style: styles.tpayLogo
|
|
27
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
28
|
+
source: require('../assets/tpay_logo.png')
|
|
29
|
+
})));
|
|
30
|
+
};
|
|
31
|
+
exports.TpayButton = TpayButton;
|
|
32
|
+
const styles = _reactNative.StyleSheet.create({
|
|
33
|
+
tpayLogo: {
|
|
34
|
+
alignSelf: 'center',
|
|
35
|
+
padding: 14
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=tpay_button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","TpayButton","onClick","isEnabled","isPressed","setIsPressed","useState","React","createElement","Pressable","style","backgroundColor","borderRadius","onPressIn","_","onPressOut","disabled","View","styles","tpayLogo","Image","source","exports","StyleSheet","create","alignSelf","padding"],"sourceRoot":"../../../src","sources":["component/tpay_button.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAcO,MAAME,UAAU,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAA2B,CAAC,KAAK;EACrE,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEjD,oBACEC,KAAA,CAAAC,aAAA,CAACV,YAAA,CAAAW,SAAS;IACRC,KAAK,EAAE;MACLC,eAAe,EAAEP,SAAS,GAAG,SAAS,GAAG,SAAS;MAClDQ,YAAY,EAAE;IAChB,CAAE;IACFC,SAAS,EAAGC,CAAC,IAAKT,YAAY,CAAC,IAAI,CAAE;IACrCU,UAAU,EAAGD,CAAC,IAAK;MACjBT,YAAY,CAAC,KAAK,CAAC;MACnBH,OAAO,CAAC,CAAC;IACX,CAAE;IACFc,QAAQ,EAAE,CAACb;EAAU,gBAErBI,KAAA,CAAAC,aAAA,CAACV,YAAA,CAAAmB,IAAI;IAACP,KAAK,EAAEQ,MAAM,CAACC;EAAS,gBAC3BZ,KAAA,CAAAC,aAAA,CAACV,YAAA,CAAAsB,KAAK;IAACC,MAAM,EAAEtB,OAAO,CAAC,yBAAyB;EAAE,CAAE,CAChD,CACG,CAAC;AAEhB,CAAC;AAACuB,OAAA,CAAArB,UAAA,GAAAA,UAAA;AAEF,MAAMiB,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,QAAQ,EAAE;IACRM,SAAS,EAAE,QAAQ;IACnBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
|