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,14 @@
|
|
|
1
|
+
package com.tpay.model
|
|
2
|
+
|
|
3
|
+
import com.tpay.model.googlePay.GooglePayConfiguration
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
|
|
6
|
+
data class WalletConfiguration(val googlePay: GooglePayConfiguration?) {
|
|
7
|
+
companion object {
|
|
8
|
+
private const val GOOGLE_PAY = "googlePay"
|
|
9
|
+
|
|
10
|
+
fun fromJson(json: JSONObject): WalletConfiguration = json.run {
|
|
11
|
+
WalletConfiguration(googlePay = optJSONObject(GOOGLE_PAY)?.run(GooglePayConfiguration::fromJson))
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
package com.tpay.model.googlePay
|
|
2
|
+
|
|
3
|
+
import org.json.JSONObject
|
|
4
|
+
|
|
5
|
+
data class GooglePayConfiguration(val merchantId: String) {
|
|
6
|
+
companion object {
|
|
7
|
+
private const val MERCHANT_ID = "merchantId"
|
|
8
|
+
|
|
9
|
+
fun fromJson(json: JSONObject) = json.run {
|
|
10
|
+
GooglePayConfiguration(merchantId = getString(MERCHANT_ID))
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
package com.tpay.model.googlePay
|
|
2
|
+
|
|
3
|
+
import com.tpay.sdk.api.screenless.googlePay.GooglePayEnvironment
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
import com.tpay.extension.ValidationException
|
|
6
|
+
|
|
7
|
+
data class GooglePayUtilsConfiguration(
|
|
8
|
+
val price: Double,
|
|
9
|
+
val merchantName: String,
|
|
10
|
+
val merchantId: String,
|
|
11
|
+
val environment: GooglePayEnvironment,
|
|
12
|
+
val customRequestCode: Int? = null
|
|
13
|
+
) {
|
|
14
|
+
fun validate() {
|
|
15
|
+
if (price <= 0) {
|
|
16
|
+
throw ValidationException(PRICE_INVALID)
|
|
17
|
+
}
|
|
18
|
+
if (merchantName.isBlank()) {
|
|
19
|
+
throw ValidationException(MERCHANT_NAME_BLANK)
|
|
20
|
+
}
|
|
21
|
+
if (merchantId.isBlank()) {
|
|
22
|
+
throw ValidationException(MERCHANT_ID_BLANK)
|
|
23
|
+
}
|
|
24
|
+
customRequestCode?.run {
|
|
25
|
+
if (this < 0) {
|
|
26
|
+
throw ValidationException(CUSTOM_REQUEST_CODE_NEGATIVE)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
companion object {
|
|
32
|
+
private const val PRICE = "price"
|
|
33
|
+
private const val MERCHANT_NAME = "merchantName"
|
|
34
|
+
private const val MERCHANT_ID = "merchantId"
|
|
35
|
+
private const val ENVIRONMENT = "environment"
|
|
36
|
+
private const val CUSTOM_REQUEST_CODE = "customRequestCode"
|
|
37
|
+
private const val ENVIRONMENT_PRODUCTION = "production"
|
|
38
|
+
private const val ENVIRONMENT_TEST = "test"
|
|
39
|
+
private const val UNKNOWN_ENVIRONMENT_MESSAGE = "Unknown Google Pay environment"
|
|
40
|
+
private const val PRICE_INVALID = "Price is invalid"
|
|
41
|
+
private const val MERCHANT_NAME_BLANK = "Merchant name cannot be blank"
|
|
42
|
+
private const val MERCHANT_ID_BLANK = "Merchant id cannot be blank"
|
|
43
|
+
private const val CUSTOM_REQUEST_CODE_NEGATIVE = "Custom request code cannot be negative"
|
|
44
|
+
|
|
45
|
+
fun fromJson(json: String): GooglePayUtilsConfiguration {
|
|
46
|
+
val rootJson = JSONObject(json)
|
|
47
|
+
|
|
48
|
+
return GooglePayUtilsConfiguration(
|
|
49
|
+
price = rootJson.getDouble(PRICE),
|
|
50
|
+
merchantName = rootJson.getString(MERCHANT_NAME),
|
|
51
|
+
merchantId = rootJson.getString(MERCHANT_ID),
|
|
52
|
+
environment = GooglePayEnvironment.valueOf(rootJson.getString(ENVIRONMENT).uppercase()),
|
|
53
|
+
customRequestCode = rootJson.optInt(CUSTOM_REQUEST_CODE)
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
package com.tpay.model.screenless
|
|
2
|
+
|
|
3
|
+
import org.json.JSONObject
|
|
4
|
+
import com.tpay.sdk.api.screenless.blik.AmbiguousAlias
|
|
5
|
+
|
|
6
|
+
data class AmbiguousBLIKAlias(
|
|
7
|
+
val name: String,
|
|
8
|
+
val code: String
|
|
9
|
+
) {
|
|
10
|
+
fun toJson(): String {
|
|
11
|
+
return JSONObject().apply {
|
|
12
|
+
put(NAME, name)
|
|
13
|
+
put(CODE, code)
|
|
14
|
+
}.toString()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fun toAmbiguousAlias(): AmbiguousAlias {
|
|
18
|
+
return AmbiguousAlias(
|
|
19
|
+
name = name,
|
|
20
|
+
code = code
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
companion object {
|
|
25
|
+
private const val NAME = "name"
|
|
26
|
+
private const val CODE = "code"
|
|
27
|
+
|
|
28
|
+
fun fromJson(jsonObject: JSONObject): AmbiguousBLIKAlias = jsonObject.run {
|
|
29
|
+
AmbiguousBLIKAlias(
|
|
30
|
+
name = getString(NAME),
|
|
31
|
+
code = getString(CODE)
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package com.tpay.model.screenless
|
|
2
|
+
|
|
3
|
+
import com.tpay.sdk.api.models.BlikAlias
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
import com.tpay.sdk.api.screenless.blik.*
|
|
6
|
+
import com.tpay.extension.*
|
|
7
|
+
|
|
8
|
+
data class AmbiguousBLIKPayment(
|
|
9
|
+
val transactionId: String,
|
|
10
|
+
val blikAlias: BlikAlias,
|
|
11
|
+
val ambiguousBlikAlias: AmbiguousBLIKAlias
|
|
12
|
+
) {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TRANSACTION_ID = "transactionId"
|
|
15
|
+
private const val BLIK_ALIAS = "blikAlias"
|
|
16
|
+
private const val AMBIGUOUS_ALIAS = "ambiguousAlias"
|
|
17
|
+
|
|
18
|
+
fun fromJson(json: String): AmbiguousBLIKPayment = JSONObject(json).run {
|
|
19
|
+
AmbiguousBLIKPayment(
|
|
20
|
+
transactionId = getString(TRANSACTION_ID),
|
|
21
|
+
blikAlias = getJSONObject(BLIK_ALIAS).run { getBlikAlias() },
|
|
22
|
+
ambiguousBlikAlias = AmbiguousBLIKAlias.fromJson(getJSONObject(AMBIGUOUS_ALIAS))
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.tpay.model.screenless
|
|
2
|
+
|
|
3
|
+
import com.tpay.sdk.api.models.BlikAlias
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
import com.tpay.util.ValidationMessages
|
|
6
|
+
import com.tpay.extension.*
|
|
7
|
+
|
|
8
|
+
class BLIKScreenlessPayment(json: String) : ScreenlessPayment(json) {
|
|
9
|
+
val code: String? = actuallyOptString(CODE)
|
|
10
|
+
val alias: BlikAlias? = optJSONObject(ALIAS)?.run { getBlikAlias() }
|
|
11
|
+
|
|
12
|
+
override fun validate() {
|
|
13
|
+
super.validate()
|
|
14
|
+
if (code.isNullOrBlank() && alias == null) {
|
|
15
|
+
throw ValidationException(ValidationMessages.BLIK_CODE_AND_ALIAS_NULL)
|
|
16
|
+
}
|
|
17
|
+
code?.let {
|
|
18
|
+
if (!code.isValidBLIKCode()) {
|
|
19
|
+
throw ValidationException(ValidationMessages.BLIK_CODE_INVALID)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
companion object {
|
|
25
|
+
private const val CODE = "code"
|
|
26
|
+
private const val ALIAS = "alias"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
package com.tpay.model.screenless
|
|
2
|
+
|
|
3
|
+
import com.tpay.sdk.api.screenless.card.Recursive
|
|
4
|
+
import com.tpay.sdk.api.screenless.card.CreditCard
|
|
5
|
+
import com.tpay.sdk.api.models.transaction.*
|
|
6
|
+
import java.text.SimpleDateFormat
|
|
7
|
+
import com.tpay.util.ValidationMessages
|
|
8
|
+
import com.tpay.extension.ValidationException
|
|
9
|
+
import com.tpay.extension.actuallyOptString
|
|
10
|
+
|
|
11
|
+
class CreditCardScreenlessPayment(json: String) : ScreenlessPayment(json) {
|
|
12
|
+
val creditCardData: CreditCardData? = optJSONObject(CREDIT_CARD)?.let { creditCardJson ->
|
|
13
|
+
creditCardJson.getJSONObject(CONFIG).let { configJson ->
|
|
14
|
+
CreditCardData(
|
|
15
|
+
creditCard = CreditCard(
|
|
16
|
+
cardNumber = creditCardJson.getString(CARD_NUMBER),
|
|
17
|
+
expirationDate = ExpirationDate.fromJson(
|
|
18
|
+
creditCardJson.getJSONObject(EXPIRY_DATE)
|
|
19
|
+
).toString(),
|
|
20
|
+
cvv = creditCardJson.getString(CVV)
|
|
21
|
+
),
|
|
22
|
+
saveCard = configJson.getBoolean(SAVE_CARD),
|
|
23
|
+
domain = configJson.getString(DOMAIN),
|
|
24
|
+
rocText = configJson.actuallyOptString(ROC_TEXT)
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
val recursive: Recursive? = optJSONObject(RECURSIVE)?.run {
|
|
30
|
+
Recursive(
|
|
31
|
+
frequency = Frequency.valueOf(getString(FREQUENCY).uppercase()),
|
|
32
|
+
quantity = optInt(QUANTITY, -1).let { value ->
|
|
33
|
+
when (value) {
|
|
34
|
+
-1 -> Quantity.Indefinite
|
|
35
|
+
else -> Quantity.Specified(value)
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
expirationDate = SimpleDateFormat(DATE_FORMAT).parse(getString(END_DATE))
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
val cardToken: String? = actuallyOptString(CARD_TOKEN)
|
|
43
|
+
|
|
44
|
+
override fun validate() {
|
|
45
|
+
super.validate()
|
|
46
|
+
|
|
47
|
+
if (cardToken == null && creditCardData == null) {
|
|
48
|
+
throw ValidationException(ValidationMessages.CREDIT_CARD_DATA_NULL)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
companion object {
|
|
53
|
+
private const val CREDIT_CARD = "creditCard"
|
|
54
|
+
private const val RECURSIVE = "recursive"
|
|
55
|
+
private const val CARD_NUMBER = "cardNumber"
|
|
56
|
+
private const val EXPIRY_DATE = "expiryDate"
|
|
57
|
+
private const val END_DATE = "endDate"
|
|
58
|
+
private const val CVV = "cvv"
|
|
59
|
+
private const val FREQUENCY = "frequency"
|
|
60
|
+
private const val QUANTITY = "quantity"
|
|
61
|
+
private const val CARD_TOKEN = "creditCardToken"
|
|
62
|
+
private const val SAVE_CARD = "shouldSave"
|
|
63
|
+
private const val DOMAIN = "domain"
|
|
64
|
+
private const val ROC_TEXT = "rocText"
|
|
65
|
+
private const val CONFIG = "config"
|
|
66
|
+
|
|
67
|
+
private const val DAILY = "daily"
|
|
68
|
+
private const val WEEKLY = "weekly"
|
|
69
|
+
private const val MONTHLY = "monthly"
|
|
70
|
+
private const val QUARTERLY = "quarterly"
|
|
71
|
+
private const val YEARLY = "yearly"
|
|
72
|
+
|
|
73
|
+
private const val DATE_FORMAT = "yyyy-MM-dd"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.tpay.model.screenless
|
|
2
|
+
|
|
3
|
+
import org.json.JSONObject
|
|
4
|
+
|
|
5
|
+
data class ExpirationDate(val month: String, val year: String) {
|
|
6
|
+
override fun toString(): String {
|
|
7
|
+
return "$month$SEPARATOR$year"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
companion object {
|
|
11
|
+
private const val MONTH = "month"
|
|
12
|
+
private const val YEAR = "year"
|
|
13
|
+
private const val SEPARATOR = "/"
|
|
14
|
+
|
|
15
|
+
fun fromJson(jsonObject: JSONObject): ExpirationDate {
|
|
16
|
+
return ExpirationDate(
|
|
17
|
+
month = jsonObject.getString(MONTH),
|
|
18
|
+
year = jsonObject.getString(YEAR)
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package com.tpay.model.screenless
|
|
2
|
+
|
|
3
|
+
import com.tpay.util.ValidationMessages
|
|
4
|
+
import com.tpay.extension.*
|
|
5
|
+
|
|
6
|
+
class GooglePayScreenlessPayment(json: String) : ScreenlessPayment(json) {
|
|
7
|
+
val token: String = getString(TOKEN)
|
|
8
|
+
|
|
9
|
+
override fun validate() {
|
|
10
|
+
super.validate()
|
|
11
|
+
if (token.isBlank()) {
|
|
12
|
+
throw ValidationException(ValidationMessages.GOOGLE_PAY_TOKEN_BLANK)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
companion object {
|
|
17
|
+
private const val TOKEN = "token"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
package com.tpay.model.screenless
|
|
2
|
+
|
|
3
|
+
import org.json.JSONObject
|
|
4
|
+
import com.tpay.util.ValidationMessages
|
|
5
|
+
import com.tpay.extension.*
|
|
6
|
+
import com.tpay.util.JsonUtil
|
|
7
|
+
import com.tpay.sdk.api.models.payer.Payer
|
|
8
|
+
import com.tpay.sdk.api.screenless.Redirects
|
|
9
|
+
import com.tpay.sdk.api.screenless.Notifications
|
|
10
|
+
import com.tpay.sdk.api.models.Language
|
|
11
|
+
|
|
12
|
+
open class ScreenlessPayment(json: String) : JSONObject(json) {
|
|
13
|
+
val amount: Double
|
|
14
|
+
val description: String
|
|
15
|
+
val hiddenDescription: String?
|
|
16
|
+
val language: Language?
|
|
17
|
+
val payer: Payer
|
|
18
|
+
val redirects: Redirects?
|
|
19
|
+
val notifications: Notifications?
|
|
20
|
+
|
|
21
|
+
init {
|
|
22
|
+
getJSONObject(PAYMENT_DETAILS).let { paymentDetailsJson ->
|
|
23
|
+
amount = paymentDetailsJson.getDouble(AMOUNT)
|
|
24
|
+
description = paymentDetailsJson.getString(DESCRIPTION)
|
|
25
|
+
hiddenDescription = paymentDetailsJson.actuallyOptString(HIDDEN_DESCRIPTION)
|
|
26
|
+
language = paymentDetailsJson.actuallyOptString(LANGUAGE)?.uppercase()?.let { lang ->
|
|
27
|
+
Language.valueOf(lang)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
payer = JsonUtil.getPayer(getJSONObject(PAYER).toString())
|
|
31
|
+
optJSONObject(CALLBACKS).let { callbacksJson ->
|
|
32
|
+
if (callbacksJson == null) {
|
|
33
|
+
redirects = null
|
|
34
|
+
notifications = null
|
|
35
|
+
} else {
|
|
36
|
+
redirects = callbacksJson.optJSONObject(REDIRECTS)?.let { redirectsJson ->
|
|
37
|
+
Redirects(
|
|
38
|
+
successUrl = redirectsJson.getString(SUCCESS_URL),
|
|
39
|
+
errorUrl = redirectsJson.getString(ERROR_URL)
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
notifications = callbacksJson.optJSONObject(NOTIFICATIONS)?.let { notificationsJson ->
|
|
43
|
+
Notifications(
|
|
44
|
+
notificationUrl = notificationsJson.getString(URL),
|
|
45
|
+
notificationEmail = notificationsJson.getString(EMAIL)
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
open fun validate() {
|
|
53
|
+
if (amount <= 0) {
|
|
54
|
+
throw ValidationException(ValidationMessages.AMOUNT_NEGATIVE)
|
|
55
|
+
}
|
|
56
|
+
if (description.isBlank()) {
|
|
57
|
+
throw ValidationException(ValidationMessages.DESCRIPTION_BLANK)
|
|
58
|
+
}
|
|
59
|
+
if (!payer.email.isEmailValid()) {
|
|
60
|
+
throw ValidationException(ValidationMessages.PAYER_EMAIL_INVALID)
|
|
61
|
+
}
|
|
62
|
+
notifications?.let {
|
|
63
|
+
if (!notifications.notificationEmail.isEmailValid()) {
|
|
64
|
+
throw ValidationException(ValidationMessages.NOTIFICATION_EMAIL_INVALID)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
companion object {
|
|
70
|
+
const val PAYMENT_DETAILS = "paymentDetails"
|
|
71
|
+
const val AMOUNT = "amount"
|
|
72
|
+
const val DESCRIPTION = "description"
|
|
73
|
+
const val HIDDEN_DESCRIPTION = "hiddenDescription"
|
|
74
|
+
const val LANGUAGE = "language"
|
|
75
|
+
const val PAYER = "payer"
|
|
76
|
+
const val CALLBACKS = "callbacks"
|
|
77
|
+
const val REDIRECTS = "redirects"
|
|
78
|
+
const val SUCCESS_URL = "successUrl"
|
|
79
|
+
const val ERROR_URL = "errorUrl"
|
|
80
|
+
const val NOTIFICATIONS = "notifications"
|
|
81
|
+
const val URL = "url"
|
|
82
|
+
const val EMAIL = "email"
|
|
83
|
+
const val DELAY_MILLIS = "delayMillis"
|
|
84
|
+
const val MAX_REQUEST_COUNT = "maxRequestCount"
|
|
85
|
+
const val STOP_ON_FIRST_REQUEST_ERROR = "stopOnFirstRequestError"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
package com.tpay.util
|
|
2
|
+
|
|
3
|
+
import com.tpay.sdk.api.models.transaction.SingleTransaction
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
import com.tpay.sdk.api.models.payer.Payer
|
|
6
|
+
import com.tpay.sdk.api.models.*
|
|
7
|
+
import com.tpay.sdk.api.paycard.CreditCardBrand
|
|
8
|
+
import com.tpay.sdk.api.models.PayerContext
|
|
9
|
+
import com.tpay.sdk.api.cardTokenPayment.CardTokenTransaction
|
|
10
|
+
import com.tpay.sdk.api.screenless.Notifications
|
|
11
|
+
import com.tpay.sdk.api.addCard.Tokenization
|
|
12
|
+
import com.tpay.extension.*
|
|
13
|
+
import com.tpay.util.ValidationMessages
|
|
14
|
+
import com.tpay.extension.ValidationException
|
|
15
|
+
|
|
16
|
+
object JsonUtil {
|
|
17
|
+
private const val NAME = "name"
|
|
18
|
+
private const val EMAIL = "email"
|
|
19
|
+
private const val PHONE = "phone"
|
|
20
|
+
private const val ADDRESS = "address"
|
|
21
|
+
private const val CITY = "city"
|
|
22
|
+
private const val COUNTRY_CODE = "countryCode"
|
|
23
|
+
private const val POSTAL_CODE = "postalCode"
|
|
24
|
+
private const val AMOUNT = "amount"
|
|
25
|
+
private const val DESCRIPTION = "description"
|
|
26
|
+
private const val PAYER = "payer"
|
|
27
|
+
private const val CARD_TOKEN = "cardToken"
|
|
28
|
+
private const val PAYER_CONTEXT = "payerContext"
|
|
29
|
+
private const val NOTIFICATIONS = "notifications"
|
|
30
|
+
private const val AUTOMATIC_PAYMENT_METHODS = "automaticPaymentMethods"
|
|
31
|
+
private const val TOKENIZED_CARDS = "tokenizedCards"
|
|
32
|
+
private const val BLIK_ALIAS = "blikAlias"
|
|
33
|
+
private const val TOKEN = "token"
|
|
34
|
+
private const val CARD_TAIL = "cardTail"
|
|
35
|
+
private const val BRAND = "brand"
|
|
36
|
+
private const val MASTERCARD = "mastercard"
|
|
37
|
+
private const val VISA = "visa"
|
|
38
|
+
private const val VALUE = "value"
|
|
39
|
+
private const val LABEL = "label"
|
|
40
|
+
private const val URL = "url"
|
|
41
|
+
private const val NOTIFICATION_URL = "notificationUrl"
|
|
42
|
+
private const val IS_REGISTERED = "isRegistered"
|
|
43
|
+
|
|
44
|
+
fun getTokenization(json: String): Tokenization {
|
|
45
|
+
val rootJson = JSONObject(json)
|
|
46
|
+
|
|
47
|
+
return Tokenization(
|
|
48
|
+
payer = getPayer(rootJson.optJSONObject(PAYER)?.toString()),
|
|
49
|
+
notificationUrl = rootJson.getString(NOTIFICATION_URL)
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
fun getPayer(json: String?): Payer {
|
|
54
|
+
json ?: return Payer(
|
|
55
|
+
name = "",
|
|
56
|
+
email = "",
|
|
57
|
+
phone = null,
|
|
58
|
+
address = null
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
val rootJson = JSONObject(json)
|
|
62
|
+
|
|
63
|
+
val name = rootJson.actuallyOptString(NAME)
|
|
64
|
+
val email = rootJson.actuallyOptString(EMAIL)
|
|
65
|
+
val phone = rootJson.actuallyOptString(PHONE)
|
|
66
|
+
|
|
67
|
+
val addressJson = rootJson.optJSONObject(ADDRESS)
|
|
68
|
+
val address = addressJson?.actuallyOptString(ADDRESS)
|
|
69
|
+
val city = addressJson?.actuallyOptString(CITY)
|
|
70
|
+
val countryCode = addressJson?.actuallyOptString(COUNTRY_CODE)
|
|
71
|
+
val postalCode = addressJson?.actuallyOptString(POSTAL_CODE)
|
|
72
|
+
|
|
73
|
+
return Payer(
|
|
74
|
+
name = name ?: "",
|
|
75
|
+
email = email ?: "",
|
|
76
|
+
phone = phone,
|
|
77
|
+
address = address?.run {
|
|
78
|
+
Payer.Address(
|
|
79
|
+
address = address,
|
|
80
|
+
city = city,
|
|
81
|
+
countryCode = countryCode,
|
|
82
|
+
postalCode = postalCode
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
fun getCardTokenTransaction(json: String): CardTokenTransaction {
|
|
89
|
+
val rootJson = JSONObject(json)
|
|
90
|
+
|
|
91
|
+
val amount = rootJson.getDouble(AMOUNT)
|
|
92
|
+
val description = rootJson.getString(DESCRIPTION)
|
|
93
|
+
val payerJson = rootJson.optJSONObject(PAYER)
|
|
94
|
+
payerJson ?: throw ValidationException(ValidationMessages.PAYER_REQUIRED_TOKEN_PAYMENT)
|
|
95
|
+
val payer = getPayer(payerJson.toString())
|
|
96
|
+
val cardToken = rootJson.getString(CARD_TOKEN)
|
|
97
|
+
|
|
98
|
+
val notifications = rootJson.optJSONObject(NOTIFICATIONS)?.let { json ->
|
|
99
|
+
Notifications(
|
|
100
|
+
notificationUrl = json.getString(URL),
|
|
101
|
+
notificationEmail = json.getString(EMAIL)
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return CardTokenTransaction(
|
|
106
|
+
amount = amount,
|
|
107
|
+
description = description,
|
|
108
|
+
payer = payer,
|
|
109
|
+
cardToken = cardToken,
|
|
110
|
+
notifications = notifications
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
fun getSingleTransaction(json: String): SingleTransaction {
|
|
115
|
+
val rootJson = JSONObject(json)
|
|
116
|
+
|
|
117
|
+
val amount = rootJson.getDouble(AMOUNT)
|
|
118
|
+
val description = rootJson.getString(DESCRIPTION)
|
|
119
|
+
|
|
120
|
+
val notifications = rootJson.optJSONObject(NOTIFICATIONS)?.let { json ->
|
|
121
|
+
Notifications(
|
|
122
|
+
notificationUrl = json.getString(URL),
|
|
123
|
+
notificationEmail = json.getString(EMAIL)
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
val payerContextJson = rootJson.getJSONObject(PAYER_CONTEXT)
|
|
128
|
+
|
|
129
|
+
val payerJson = payerContextJson.optJSONObject(PAYER)
|
|
130
|
+
val payer = getPayer(payerJson?.toString())
|
|
131
|
+
|
|
132
|
+
val automaticPaymentMethodsJson = payerContextJson.optJSONObject(AUTOMATIC_PAYMENT_METHODS)
|
|
133
|
+
|
|
134
|
+
val (tokenizedCards, blikAlias) = automaticPaymentMethodsJson?.let { automaticPaymentsJson ->
|
|
135
|
+
val tokenizedCardsArray = automaticPaymentMethodsJson.optJSONArray(TOKENIZED_CARDS)
|
|
136
|
+
val blikAliasJson = automaticPaymentMethodsJson.optJSONObject(BLIK_ALIAS)
|
|
137
|
+
|
|
138
|
+
val tokenizedCards: List<TokenizedCard> = tokenizedCardsArray?.run {
|
|
139
|
+
(0 until length())
|
|
140
|
+
.map { index -> getJSONObject(index) }
|
|
141
|
+
.map { tokenizedCardObject ->
|
|
142
|
+
TokenizedCard(
|
|
143
|
+
token = tokenizedCardObject.getString(TOKEN),
|
|
144
|
+
cardTail = tokenizedCardObject.getString(CARD_TAIL),
|
|
145
|
+
brand = CreditCardBrand.valueOf(tokenizedCardObject.getString(BRAND).uppercase())
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
} ?: emptyList<TokenizedCard>()
|
|
149
|
+
|
|
150
|
+
val blikAlias: BlikAlias? = blikAliasJson?.run {
|
|
151
|
+
val label = getString(LABEL)
|
|
152
|
+
val value = getString(VALUE)
|
|
153
|
+
if (getBoolean(IS_REGISTERED)) {
|
|
154
|
+
BlikAlias.Registered(value, label)
|
|
155
|
+
} else {
|
|
156
|
+
BlikAlias.NotRegistered(value, label)
|
|
157
|
+
}
|
|
158
|
+
} ?: null
|
|
159
|
+
|
|
160
|
+
tokenizedCards to blikAlias
|
|
161
|
+
} ?: emptyList<TokenizedCard>() to null
|
|
162
|
+
|
|
163
|
+
val payerContext = PayerContext(
|
|
164
|
+
payer = payer,
|
|
165
|
+
automaticPaymentMethods = AutomaticPaymentMethods(
|
|
166
|
+
blikAlias = blikAlias,
|
|
167
|
+
tokenizedCards = tokenizedCards
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
return SingleTransaction(
|
|
172
|
+
amount = amount,
|
|
173
|
+
description = description,
|
|
174
|
+
payerContext = payerContext,
|
|
175
|
+
notifications = notifications
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package com.tpay.util
|
|
2
|
+
|
|
3
|
+
import com.tpay.sdk.api.models.Presentable
|
|
4
|
+
import java.util.ArrayDeque
|
|
5
|
+
|
|
6
|
+
object TpayBackpressUtil {
|
|
7
|
+
private var sheet: Presentable? = null
|
|
8
|
+
|
|
9
|
+
val isModuleVisible: Boolean
|
|
10
|
+
get() = sheet != null
|
|
11
|
+
|
|
12
|
+
fun set(sheet: Presentable) {
|
|
13
|
+
this.sheet = sheet
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fun remove() {
|
|
17
|
+
sheet = null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
fun onBackPressed() {
|
|
21
|
+
sheet?.onBackPressed()
|
|
22
|
+
}
|
|
23
|
+
}
|