boxpay-checkout-reactnative-sdk 1.1.7 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -6
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativemodule/BoxPayElementsView.kt +62 -0
- package/android/src/main/java/com/reactnativemodule/CrossPlaform.kt +48 -19
- package/android/src/main/java/com/reactnativemodule/ReactNativeModulePackage.kt +2 -3
- package/cross_platform_react_native_plugin.podspec +1 -1
- package/ios/BoxPayElementsView.m +10 -0
- package/ios/BoxPayElementsView.swift +82 -0
- package/ios/CrossPlatform.m +5 -2
- package/ios/CrossPlatform.swift +74 -26
- package/lib/module/index.js +108 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/interface.js +10 -30
- package/lib/module/interface.js.map +1 -1
- package/lib/module/native.js +35 -0
- package/lib/module/native.js.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/interface.d.ts +20 -522
- package/lib/typescript/src/interface.d.ts.map +1 -1
- package/lib/typescript/src/native.d.ts +24 -0
- package/lib/typescript/src/native.d.ts.map +1 -0
- package/package.json +15 -21
- package/src/index.tsx +106 -13
- package/src/interface.ts +25 -602
- package/src/native.ts +72 -0
- package/assets/animations/boxpayLogo.json +0 -1135
- package/assets/animations/payment_failed.json +0 -487
- package/assets/animations/payment_status_pending.json +0 -750
- package/assets/animations/payment_successful.json +0 -1602
- package/assets/fonts/Inter_18pt-Bold.ttf +0 -0
- package/assets/fonts/Inter_18pt-ExtraBold.ttf +0 -0
- package/assets/fonts/Inter_18pt-Medium.ttf +0 -0
- package/assets/fonts/Inter_18pt-Regular.ttf +0 -0
- package/assets/fonts/Inter_18pt-SemiBold.ttf +0 -0
- package/assets/fonts/Poppins-Bold.ttf +0 -0
- package/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- package/assets/fonts/Poppins-Medium.ttf +0 -0
- package/assets/fonts/Poppins-Regular.ttf +0 -0
- package/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/assets/images/Lock.png +0 -0
- package/assets/images/add_icon.png +0 -0
- package/assets/images/add_upi_id_background.png +0 -0
- package/assets/images/arrow-left.png +0 -0
- package/assets/images/chervon-down.png +0 -0
- package/assets/images/cvv_info_image.png +0 -0
- package/assets/images/cvv_info_image_amex.png +0 -0
- package/assets/images/favicon.png +0 -0
- package/assets/images/gpay-icon.png +0 -0
- package/assets/images/ic_amex.png +0 -0
- package/assets/images/ic_bnpl.png +0 -0
- package/assets/images/ic_bnpl_semi_bold.png +0 -0
- package/assets/images/ic_card.png +0 -0
- package/assets/images/ic_card_add.png +0 -0
- package/assets/images/ic_card_lock.png +0 -0
- package/assets/images/ic_cross.png +0 -0
- package/assets/images/ic_cvv_info.png +0 -0
- package/assets/images/ic_default_card.png +0 -0
- package/assets/images/ic_emi.png +0 -0
- package/assets/images/ic_home.png +0 -0
- package/assets/images/ic_info.png +0 -0
- package/assets/images/ic_location.png +0 -0
- package/assets/images/ic_maestro.png +0 -0
- package/assets/images/ic_masterCard.png +0 -0
- package/assets/images/ic_more.png +0 -0
- package/assets/images/ic_netbanking.png +0 -0
- package/assets/images/ic_netbanking_semi_bold.png +0 -0
- package/assets/images/ic_offer_tag.png +0 -0
- package/assets/images/ic_other.png +0 -0
- package/assets/images/ic_qr.png +0 -0
- package/assets/images/ic_rupay.png +0 -0
- package/assets/images/ic_search.png +0 -0
- package/assets/images/ic_trash.png +0 -0
- package/assets/images/ic_upi.png +0 -0
- package/assets/images/ic_upi_error.png +0 -0
- package/assets/images/ic_user.png +0 -0
- package/assets/images/ic_visa.png +0 -0
- package/assets/images/ic_wallet.png +0 -0
- package/assets/images/ic_wallet_semi_bold.png +0 -0
- package/assets/images/ic_work.png +0 -0
- package/assets/images/no_results_found.png +0 -0
- package/assets/images/other-intent-icon.png +0 -0
- package/assets/images/paytm-icon.png +0 -0
- package/assets/images/phonepe-icon.png +0 -0
- package/assets/images/splash-icon.png +0 -0
- package/assets/images/upi-icon.png +0 -0
- package/assets/images/upi-timer-sheet-upi-icon.png +0 -0
- package/assets/json/countryCodes.json +0 -1490
- package/ios/Framework/CrossPlatformSDK.xcframework/Info.plist +0 -48
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64/CrossPlatformSDK.framework/CrossPlatformSDK +0 -0
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64/CrossPlatformSDK.framework/Headers/CrossPlatformSDK.h +0 -168
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64/CrossPlatformSDK.framework/Info.plist +0 -35
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64/CrossPlatformSDK.framework/Modules/module.modulemap +0 -8
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64/dSYMs/CrossPlatformSDK.framework.dSYM/Contents/Info.plist +0 -20
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64_x86_64-simulator/CrossPlatformSDK.framework/CrossPlatformSDK +0 -0
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64_x86_64-simulator/CrossPlatformSDK.framework/Headers/CrossPlatformSDK.h +0 -168
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64_x86_64-simulator/CrossPlatformSDK.framework/Info.plist +0 -31
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64_x86_64-simulator/CrossPlatformSDK.framework/Modules/module.modulemap +0 -5
- package/ios/Framework/CrossPlatformSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/CrossPlatformSDK.framework.dSYM/Contents/Info.plist +0 -20
- package/lib/assets/animations/boxpayLogo.json +0 -1135
- package/lib/assets/animations/payment_failed.json +0 -487
- package/lib/assets/animations/payment_status_pending.json +0 -750
- package/lib/assets/animations/payment_successful.json +0 -1602
- package/lib/assets/assets/animations/boxpayLogo.json +0 -1135
- package/lib/assets/assets/animations/payment_failed.json +0 -487
- package/lib/assets/assets/animations/payment_status_pending.json +0 -750
- package/lib/assets/assets/animations/payment_successful.json +0 -1602
- package/lib/assets/assets/fonts/Inter_18pt-Bold.ttf +0 -0
- package/lib/assets/assets/fonts/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/assets/assets/fonts/Inter_18pt-Medium.ttf +0 -0
- package/lib/assets/assets/fonts/Inter_18pt-Regular.ttf +0 -0
- package/lib/assets/assets/fonts/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/assets/assets/fonts/Poppins-Bold.ttf +0 -0
- package/lib/assets/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- package/lib/assets/assets/fonts/Poppins-Medium.ttf +0 -0
- package/lib/assets/assets/fonts/Poppins-Regular.ttf +0 -0
- package/lib/assets/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/lib/assets/assets/images/Lock.png +0 -0
- package/lib/assets/assets/images/add_icon.png +0 -0
- package/lib/assets/assets/images/add_upi_id_background.png +0 -0
- package/lib/assets/assets/images/arrow-left.png +0 -0
- package/lib/assets/assets/images/chervon-down.png +0 -0
- package/lib/assets/assets/images/cvv_info_image.png +0 -0
- package/lib/assets/assets/images/cvv_info_image_amex.png +0 -0
- package/lib/assets/assets/images/favicon.png +0 -0
- package/lib/assets/assets/images/gpay-icon.png +0 -0
- package/lib/assets/assets/images/ic_amex.png +0 -0
- package/lib/assets/assets/images/ic_bnpl.png +0 -0
- package/lib/assets/assets/images/ic_bnpl_semi_bold.png +0 -0
- package/lib/assets/assets/images/ic_card.png +0 -0
- package/lib/assets/assets/images/ic_card_add.png +0 -0
- package/lib/assets/assets/images/ic_card_lock.png +0 -0
- package/lib/assets/assets/images/ic_cross.png +0 -0
- package/lib/assets/assets/images/ic_cvv_info.png +0 -0
- package/lib/assets/assets/images/ic_default_card.png +0 -0
- package/lib/assets/assets/images/ic_emi.png +0 -0
- package/lib/assets/assets/images/ic_home.png +0 -0
- package/lib/assets/assets/images/ic_info.png +0 -0
- package/lib/assets/assets/images/ic_location.png +0 -0
- package/lib/assets/assets/images/ic_maestro.png +0 -0
- package/lib/assets/assets/images/ic_masterCard.png +0 -0
- package/lib/assets/assets/images/ic_more.png +0 -0
- package/lib/assets/assets/images/ic_netbanking.png +0 -0
- package/lib/assets/assets/images/ic_netbanking_semi_bold.png +0 -0
- package/lib/assets/assets/images/ic_offer_tag.png +0 -0
- package/lib/assets/assets/images/ic_other.png +0 -0
- package/lib/assets/assets/images/ic_qr.png +0 -0
- package/lib/assets/assets/images/ic_rupay.png +0 -0
- package/lib/assets/assets/images/ic_search.png +0 -0
- package/lib/assets/assets/images/ic_trash.png +0 -0
- package/lib/assets/assets/images/ic_upi.png +0 -0
- package/lib/assets/assets/images/ic_upi_error.png +0 -0
- package/lib/assets/assets/images/ic_user.png +0 -0
- package/lib/assets/assets/images/ic_visa.png +0 -0
- package/lib/assets/assets/images/ic_wallet.png +0 -0
- package/lib/assets/assets/images/ic_wallet_semi_bold.png +0 -0
- package/lib/assets/assets/images/ic_work.png +0 -0
- package/lib/assets/assets/images/no_results_found.png +0 -0
- package/lib/assets/assets/images/other-intent-icon.png +0 -0
- package/lib/assets/assets/images/paytm-icon.png +0 -0
- package/lib/assets/assets/images/phonepe-icon.png +0 -0
- package/lib/assets/assets/images/splash-icon.png +0 -0
- package/lib/assets/assets/images/upi-icon.png +0 -0
- package/lib/assets/assets/images/upi-timer-sheet-upi-icon.png +0 -0
- package/lib/assets/assets/json/countryCodes.json +0 -1490
- package/lib/assets/fonts/Inter_18pt-Bold.ttf +0 -0
- package/lib/assets/fonts/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/assets/fonts/Inter_18pt-Medium.ttf +0 -0
- package/lib/assets/fonts/Inter_18pt-Regular.ttf +0 -0
- package/lib/assets/fonts/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
- package/lib/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
- package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
- package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/lib/assets/images/Lock.png +0 -0
- package/lib/assets/images/add_icon.png +0 -0
- package/lib/assets/images/add_upi_id_background.png +0 -0
- package/lib/assets/images/arrow-left.png +0 -0
- package/lib/assets/images/chervon-down.png +0 -0
- package/lib/assets/images/cvv_info_image.png +0 -0
- package/lib/assets/images/cvv_info_image_amex.png +0 -0
- package/lib/assets/images/favicon.png +0 -0
- package/lib/assets/images/gpay-icon.png +0 -0
- package/lib/assets/images/ic_amex.png +0 -0
- package/lib/assets/images/ic_bnpl.png +0 -0
- package/lib/assets/images/ic_bnpl_semi_bold.png +0 -0
- package/lib/assets/images/ic_card.png +0 -0
- package/lib/assets/images/ic_card_add.png +0 -0
- package/lib/assets/images/ic_card_lock.png +0 -0
- package/lib/assets/images/ic_cross.png +0 -0
- package/lib/assets/images/ic_cvv_info.png +0 -0
- package/lib/assets/images/ic_default_card.png +0 -0
- package/lib/assets/images/ic_emi.png +0 -0
- package/lib/assets/images/ic_home.png +0 -0
- package/lib/assets/images/ic_info.png +0 -0
- package/lib/assets/images/ic_location.png +0 -0
- package/lib/assets/images/ic_maestro.png +0 -0
- package/lib/assets/images/ic_masterCard.png +0 -0
- package/lib/assets/images/ic_more.png +0 -0
- package/lib/assets/images/ic_netbanking.png +0 -0
- package/lib/assets/images/ic_netbanking_semi_bold.png +0 -0
- package/lib/assets/images/ic_offer_tag.png +0 -0
- package/lib/assets/images/ic_other.png +0 -0
- package/lib/assets/images/ic_qr.png +0 -0
- package/lib/assets/images/ic_rupay.png +0 -0
- package/lib/assets/images/ic_search.png +0 -0
- package/lib/assets/images/ic_trash.png +0 -0
- package/lib/assets/images/ic_upi.png +0 -0
- package/lib/assets/images/ic_upi_error.png +0 -0
- package/lib/assets/images/ic_user.png +0 -0
- package/lib/assets/images/ic_visa.png +0 -0
- package/lib/assets/images/ic_wallet.png +0 -0
- package/lib/assets/images/ic_wallet_semi_bold.png +0 -0
- package/lib/assets/images/ic_work.png +0 -0
- package/lib/assets/images/no_results_found.png +0 -0
- package/lib/assets/images/other-intent-icon.png +0 -0
- package/lib/assets/images/paytm-icon.png +0 -0
- package/lib/assets/images/phonepe-icon.png +0 -0
- package/lib/assets/images/splash-icon.png +0 -0
- package/lib/assets/images/upi-icon.png +0 -0
- package/lib/assets/images/upi-timer-sheet-upi-icon.png +0 -0
- package/lib/assets/json/countryCodes.json +0 -1490
- package/lib/module/components/addressCard.js +0 -186
- package/lib/module/components/addressCard.js.map +0 -1
- package/lib/module/components/applyCouponCard.js +0 -145
- package/lib/module/components/applyCouponCard.js.map +0 -1
- package/lib/module/components/bankCard.js +0 -59
- package/lib/module/components/bankCard.js.map +0 -1
- package/lib/module/components/cancelPaymentModal.js +0 -74
- package/lib/module/components/cancelPaymentModal.js.map +0 -1
- package/lib/module/components/checkboxContainer.js +0 -65
- package/lib/module/components/checkboxContainer.js.map +0 -1
- package/lib/module/components/circularProgress.js +0 -75
- package/lib/module/components/circularProgress.js.map +0 -1
- package/lib/module/components/cvvInfoBottomSheet.js +0 -73
- package/lib/module/components/cvvInfoBottomSheet.js.map +0 -1
- package/lib/module/components/deleteAddressModal.js +0 -120
- package/lib/module/components/deleteAddressModal.js.map +0 -1
- package/lib/module/components/fontFamily.js +0 -30
- package/lib/module/components/fontFamily.js.map +0 -1
- package/lib/module/components/getInstalledUPI.js +0 -27
- package/lib/module/components/getInstalledUPI.js.map +0 -1
- package/lib/module/components/header.js +0 -127
- package/lib/module/components/header.js.map +0 -1
- package/lib/module/components/imageLoader.js +0 -93
- package/lib/module/components/imageLoader.js.map +0 -1
- package/lib/module/components/knowMoreBottomSheet.js +0 -113
- package/lib/module/components/knowMoreBottomSheet.js.map +0 -1
- package/lib/module/components/morePaymentContainer.js +0 -66
- package/lib/module/components/morePaymentContainer.js.map +0 -1
- package/lib/module/components/morePaymentMethods.js +0 -177
- package/lib/module/components/morePaymentMethods.js.map +0 -1
- package/lib/module/components/offerCard.js +0 -148
- package/lib/module/components/offerCard.js.map +0 -1
- package/lib/module/components/orderDetails.js +0 -404
- package/lib/module/components/orderDetails.js.map +0 -1
- package/lib/module/components/paymentFailed.js +0 -98
- package/lib/module/components/paymentFailed.js.map +0 -1
- package/lib/module/components/paymentSelector.js +0 -158
- package/lib/module/components/paymentSelector.js.map +0 -1
- package/lib/module/components/paymentSuccess.js +0 -244
- package/lib/module/components/paymentSuccess.js.map +0 -1
- package/lib/module/components/savedAddressBottomSheet.js +0 -130
- package/lib/module/components/savedAddressBottomSheet.js.map +0 -1
- package/lib/module/components/savedAddressCard.js +0 -117
- package/lib/module/components/savedAddressCard.js.map +0 -1
- package/lib/module/components/savedCardComponent.js +0 -238
- package/lib/module/components/savedCardComponent.js.map +0 -1
- package/lib/module/components/selectTenureCard.js +0 -393
- package/lib/module/components/selectTenureCard.js.map +0 -1
- package/lib/module/components/sessionExpire.js +0 -96
- package/lib/module/components/sessionExpire.js.map +0 -1
- package/lib/module/components/shimmerView.js +0 -40
- package/lib/module/components/shimmerView.js.map +0 -1
- package/lib/module/navigation.js +0 -87
- package/lib/module/navigation.js.map +0 -1
- package/lib/module/postRequest/callUIAnalytics.js +0 -43
- package/lib/module/postRequest/callUIAnalytics.js.map +0 -1
- package/lib/module/postRequest/cardPostRequest.js +0 -60
- package/lib/module/postRequest/cardPostRequest.js.map +0 -1
- package/lib/module/postRequest/deleteSavedAddress.js +0 -33
- package/lib/module/postRequest/deleteSavedAddress.js.map +0 -1
- package/lib/module/postRequest/emiPostRequest.js +0 -68
- package/lib/module/postRequest/emiPostRequest.js.map +0 -1
- package/lib/module/postRequest/fetchCardDetails.js +0 -26
- package/lib/module/postRequest/fetchCardDetails.js.map +0 -1
- package/lib/module/postRequest/fetchInstantOffer.js +0 -29
- package/lib/module/postRequest/fetchInstantOffer.js.map +0 -1
- package/lib/module/postRequest/fetchPaymentMethods.js +0 -25
- package/lib/module/postRequest/fetchPaymentMethods.js.map +0 -1
- package/lib/module/postRequest/fetchRecommendedInstruments.js +0 -30
- package/lib/module/postRequest/fetchRecommendedInstruments.js.map +0 -1
- package/lib/module/postRequest/fetchSavedAddress.js +0 -30
- package/lib/module/postRequest/fetchSavedAddress.js.map +0 -1
- package/lib/module/postRequest/fetchSessionDetails.js +0 -25
- package/lib/module/postRequest/fetchSessionDetails.js.map +0 -1
- package/lib/module/postRequest/fetchStatus.js +0 -25
- package/lib/module/postRequest/fetchStatus.js.map +0 -1
- package/lib/module/postRequest/fetchSurcharge.js +0 -36
- package/lib/module/postRequest/fetchSurcharge.js.map +0 -1
- package/lib/module/postRequest/methodsPostRequest.js +0 -48
- package/lib/module/postRequest/methodsPostRequest.js.map +0 -1
- package/lib/module/postRequest/upiPostRequest.js +0 -46
- package/lib/module/postRequest/upiPostRequest.js.map +0 -1
- package/lib/module/screens/addressScreen.js +0 -771
- package/lib/module/screens/addressScreen.js.map +0 -1
- package/lib/module/screens/bnplScreen.js +0 -249
- package/lib/module/screens/bnplScreen.js.map +0 -1
- package/lib/module/screens/cardScreen.js +0 -903
- package/lib/module/screens/cardScreen.js.map +0 -1
- package/lib/module/screens/emiScreen.js +0 -638
- package/lib/module/screens/emiScreen.js.map +0 -1
- package/lib/module/screens/instantOfferList.js +0 -117
- package/lib/module/screens/instantOfferList.js.map +0 -1
- package/lib/module/screens/mainScreen.js +0 -873
- package/lib/module/screens/mainScreen.js.map +0 -1
- package/lib/module/screens/netBankingScreen.js +0 -360
- package/lib/module/screens/netBankingScreen.js.map +0 -1
- package/lib/module/screens/savedAddressScreen.js +0 -274
- package/lib/module/screens/savedAddressScreen.js.map +0 -1
- package/lib/module/screens/selectTenureScreen.js +0 -105
- package/lib/module/screens/selectTenureScreen.js.map +0 -1
- package/lib/module/screens/upiScreen.js +0 -557
- package/lib/module/screens/upiScreen.js.map +0 -1
- package/lib/module/screens/upiTimerScreen.js +0 -212
- package/lib/module/screens/upiTimerScreen.js.map +0 -1
- package/lib/module/screens/walletScreen.js +0 -327
- package/lib/module/screens/walletScreen.js.map +0 -1
- package/lib/module/screens/webViewScreen.js +0 -87
- package/lib/module/screens/webViewScreen.js.map +0 -1
- package/lib/module/sdk-version.json +0 -1
- package/lib/module/serviceRequest.js +0 -27
- package/lib/module/serviceRequest.js.map +0 -1
- package/lib/module/sharedContext/checkoutDetailsHandler.js +0 -98
- package/lib/module/sharedContext/checkoutDetailsHandler.js.map +0 -1
- package/lib/module/sharedContext/handlePaymentResponseHandler.js +0 -278
- package/lib/module/sharedContext/handlePaymentResponseHandler.js.map +0 -1
- package/lib/module/sharedContext/paymentStatusHandler.js +0 -9
- package/lib/module/sharedContext/paymentStatusHandler.js.map +0 -1
- package/lib/module/sharedContext/userdataHandler.js +0 -50
- package/lib/module/sharedContext/userdataHandler.js.map +0 -1
- package/lib/module/styles/components/addressCardStyles.js +0 -55
- package/lib/module/styles/components/addressCardStyles.js.map +0 -1
- package/lib/module/styles/components/bankCardStyles.js +0 -61
- package/lib/module/styles/components/bankCardStyles.js.map +0 -1
- package/lib/module/styles/components/cancelPaymentModalStyles.js +0 -83
- package/lib/module/styles/components/cancelPaymentModalStyles.js.map +0 -1
- package/lib/module/styles/components/cvvInfoBottomSheetStyles.js +0 -52
- package/lib/module/styles/components/cvvInfoBottomSheetStyles.js.map +0 -1
- package/lib/module/styles/components/savedAddressCardStyles.js +0 -64
- package/lib/module/styles/components/savedAddressCardStyles.js.map +0 -1
- package/lib/module/styles/indexStyles.js +0 -70
- package/lib/module/styles/indexStyles.js.map +0 -1
- package/lib/module/styles/screens/addressScreenStyles..js +0 -61
- package/lib/module/styles/screens/addressScreenStyles..js.map +0 -1
- package/lib/module/styles/screens/bnplScreenStyles.js +0 -81
- package/lib/module/styles/screens/bnplScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/cardScreenStyles.js +0 -164
- package/lib/module/styles/screens/cardScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/emiScreenStyles.js +0 -130
- package/lib/module/styles/screens/emiScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/instantOfferScreenStyles.js +0 -45
- package/lib/module/styles/screens/instantOfferScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/netBankingScreenStyles.js +0 -102
- package/lib/module/styles/screens/netBankingScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/savedAddressScreenStyles.js +0 -52
- package/lib/module/styles/screens/savedAddressScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/selectTenureScreenStyles.js +0 -45
- package/lib/module/styles/screens/selectTenureScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/upiScreenStyles.js +0 -172
- package/lib/module/styles/screens/upiScreenStyles.js.map +0 -1
- package/lib/module/styles/screens/upiTimerScreenStyle.js +0 -97
- package/lib/module/styles/screens/upiTimerScreenStyle.js.map +0 -1
- package/lib/module/styles/screens/walletScreenStyles.js +0 -99
- package/lib/module/styles/screens/walletScreenStyles.js.map +0 -1
- package/lib/module/utility.js +0 -172
- package/lib/module/utility.js.map +0 -1
- package/lib/typescript/src/components/addressCard.d.ts +0 -7
- package/lib/typescript/src/components/addressCard.d.ts.map +0 -1
- package/lib/typescript/src/components/applyCouponCard.d.ts +0 -15
- package/lib/typescript/src/components/applyCouponCard.d.ts.map +0 -1
- package/lib/typescript/src/components/bankCard.d.ts +0 -11
- package/lib/typescript/src/components/bankCard.d.ts.map +0 -1
- package/lib/typescript/src/components/cancelPaymentModal.d.ts +0 -8
- package/lib/typescript/src/components/cancelPaymentModal.d.ts.map +0 -1
- package/lib/typescript/src/components/checkboxContainer.d.ts +0 -8
- package/lib/typescript/src/components/checkboxContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/circularProgress.d.ts +0 -10
- package/lib/typescript/src/components/circularProgress.d.ts.map +0 -1
- package/lib/typescript/src/components/cvvInfoBottomSheet.d.ts +0 -7
- package/lib/typescript/src/components/cvvInfoBottomSheet.d.ts.map +0 -1
- package/lib/typescript/src/components/deleteAddressModal.d.ts +0 -9
- package/lib/typescript/src/components/deleteAddressModal.d.ts.map +0 -1
- package/lib/typescript/src/components/fontFamily.d.ts +0 -14
- package/lib/typescript/src/components/fontFamily.d.ts.map +0 -1
- package/lib/typescript/src/components/getInstalledUPI.d.ts +0 -2
- package/lib/typescript/src/components/getInstalledUPI.d.ts.map +0 -1
- package/lib/typescript/src/components/header.d.ts +0 -10
- package/lib/typescript/src/components/header.d.ts.map +0 -1
- package/lib/typescript/src/components/imageLoader.d.ts +0 -8
- package/lib/typescript/src/components/imageLoader.d.ts.map +0 -1
- package/lib/typescript/src/components/knowMoreBottomSheet.d.ts +0 -6
- package/lib/typescript/src/components/knowMoreBottomSheet.d.ts.map +0 -1
- package/lib/typescript/src/components/morePaymentContainer.d.ts +0 -10
- package/lib/typescript/src/components/morePaymentContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/morePaymentMethods.d.ts +0 -11
- package/lib/typescript/src/components/morePaymentMethods.d.ts.map +0 -1
- package/lib/typescript/src/components/offerCard.d.ts +0 -15
- package/lib/typescript/src/components/offerCard.d.ts.map +0 -1
- package/lib/typescript/src/components/orderDetails.d.ts +0 -23
- package/lib/typescript/src/components/orderDetails.d.ts.map +0 -1
- package/lib/typescript/src/components/paymentFailed.d.ts +0 -8
- package/lib/typescript/src/components/paymentFailed.d.ts.map +0 -1
- package/lib/typescript/src/components/paymentSelector.d.ts +0 -12
- package/lib/typescript/src/components/paymentSelector.d.ts.map +0 -1
- package/lib/typescript/src/components/paymentSuccess.d.ts +0 -10
- package/lib/typescript/src/components/paymentSuccess.d.ts.map +0 -1
- package/lib/typescript/src/components/savedAddressBottomSheet.d.ts +0 -14
- package/lib/typescript/src/components/savedAddressBottomSheet.d.ts.map +0 -1
- package/lib/typescript/src/components/savedAddressCard.d.ts +0 -9
- package/lib/typescript/src/components/savedAddressCard.d.ts.map +0 -1
- package/lib/typescript/src/components/savedCardComponent.d.ts +0 -12
- package/lib/typescript/src/components/savedCardComponent.d.ts.map +0 -1
- package/lib/typescript/src/components/selectTenureCard.d.ts +0 -21
- package/lib/typescript/src/components/selectTenureCard.d.ts.map +0 -1
- package/lib/typescript/src/components/sessionExpire.d.ts +0 -7
- package/lib/typescript/src/components/sessionExpire.d.ts.map +0 -1
- package/lib/typescript/src/components/shimmerView.d.ts +0 -3
- package/lib/typescript/src/components/shimmerView.d.ts.map +0 -1
- package/lib/typescript/src/navigation.d.ts +0 -17
- package/lib/typescript/src/navigation.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/callUIAnalytics.d.ts +0 -4
- package/lib/typescript/src/postRequest/callUIAnalytics.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/cardPostRequest.d.ts +0 -4
- package/lib/typescript/src/postRequest/cardPostRequest.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/deleteSavedAddress.d.ts +0 -4
- package/lib/typescript/src/postRequest/deleteSavedAddress.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/emiPostRequest.d.ts +0 -13
- package/lib/typescript/src/postRequest/emiPostRequest.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchCardDetails.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchCardDetails.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchInstantOffer.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchInstantOffer.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchPaymentMethods.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchPaymentMethods.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchRecommendedInstruments.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchRecommendedInstruments.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchSavedAddress.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchSavedAddress.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchSessionDetails.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchSessionDetails.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchStatus.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchStatus.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/fetchSurcharge.d.ts +0 -4
- package/lib/typescript/src/postRequest/fetchSurcharge.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/methodsPostRequest.d.ts +0 -4
- package/lib/typescript/src/postRequest/methodsPostRequest.d.ts.map +0 -1
- package/lib/typescript/src/postRequest/upiPostRequest.d.ts +0 -4
- package/lib/typescript/src/postRequest/upiPostRequest.d.ts.map +0 -1
- package/lib/typescript/src/screens/addressScreen.d.ts +0 -11
- package/lib/typescript/src/screens/addressScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/bnplScreen.d.ts +0 -9
- package/lib/typescript/src/screens/bnplScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/cardScreen.d.ts +0 -11
- package/lib/typescript/src/screens/cardScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/emiScreen.d.ts +0 -9
- package/lib/typescript/src/screens/emiScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/instantOfferList.d.ts +0 -19
- package/lib/typescript/src/screens/instantOfferList.d.ts.map +0 -1
- package/lib/typescript/src/screens/mainScreen.d.ts +0 -11
- package/lib/typescript/src/screens/mainScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/netBankingScreen.d.ts +0 -9
- package/lib/typescript/src/screens/netBankingScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/savedAddressScreen.d.ts +0 -9
- package/lib/typescript/src/screens/savedAddressScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/selectTenureScreen.d.ts +0 -12
- package/lib/typescript/src/screens/selectTenureScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/upiScreen.d.ts +0 -20
- package/lib/typescript/src/screens/upiScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/upiTimerScreen.d.ts +0 -11
- package/lib/typescript/src/screens/upiTimerScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/walletScreen.d.ts +0 -9
- package/lib/typescript/src/screens/walletScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/webViewScreen.d.ts +0 -9
- package/lib/typescript/src/screens/webViewScreen.d.ts.map +0 -1
- package/lib/typescript/src/serviceRequest.d.ts +0 -3
- package/lib/typescript/src/serviceRequest.d.ts.map +0 -1
- package/lib/typescript/src/sharedContext/checkoutDetailsHandler.d.ts +0 -8
- package/lib/typescript/src/sharedContext/checkoutDetailsHandler.d.ts.map +0 -1
- package/lib/typescript/src/sharedContext/handlePaymentResponseHandler.d.ts +0 -16
- package/lib/typescript/src/sharedContext/handlePaymentResponseHandler.d.ts.map +0 -1
- package/lib/typescript/src/sharedContext/paymentStatusHandler.d.ts +0 -7
- package/lib/typescript/src/sharedContext/paymentStatusHandler.d.ts.map +0 -1
- package/lib/typescript/src/sharedContext/userdataHandler.d.ts +0 -8
- package/lib/typescript/src/sharedContext/userdataHandler.d.ts.map +0 -1
- package/lib/typescript/src/styles/components/addressCardStyles.d.ts +0 -52
- package/lib/typescript/src/styles/components/addressCardStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/components/bankCardStyles.d.ts +0 -58
- package/lib/typescript/src/styles/components/bankCardStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/components/cancelPaymentModalStyles.d.ts +0 -80
- package/lib/typescript/src/styles/components/cancelPaymentModalStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/components/cvvInfoBottomSheetStyles.d.ts +0 -49
- package/lib/typescript/src/styles/components/cvvInfoBottomSheetStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/components/savedAddressCardStyles.d.ts +0 -61
- package/lib/typescript/src/styles/components/savedAddressCardStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/indexStyles.d.ts +0 -67
- package/lib/typescript/src/styles/indexStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/addressScreenStyles..d.ts +0 -58
- package/lib/typescript/src/styles/screens/addressScreenStyles..d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/bnplScreenStyles.d.ts +0 -78
- package/lib/typescript/src/styles/screens/bnplScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts +0 -161
- package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/emiScreenStyles.d.ts +0 -127
- package/lib/typescript/src/styles/screens/emiScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/instantOfferScreenStyles.d.ts +0 -42
- package/lib/typescript/src/styles/screens/instantOfferScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/netBankingScreenStyles.d.ts +0 -99
- package/lib/typescript/src/styles/screens/netBankingScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/savedAddressScreenStyles.d.ts +0 -49
- package/lib/typescript/src/styles/screens/savedAddressScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/selectTenureScreenStyles.d.ts +0 -42
- package/lib/typescript/src/styles/screens/selectTenureScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/upiScreenStyles.d.ts +0 -168
- package/lib/typescript/src/styles/screens/upiScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/upiTimerScreenStyle.d.ts +0 -94
- package/lib/typescript/src/styles/screens/upiTimerScreenStyle.d.ts.map +0 -1
- package/lib/typescript/src/styles/screens/walletScreenStyles.d.ts +0 -96
- package/lib/typescript/src/styles/screens/walletScreenStyles.d.ts.map +0 -1
- package/lib/typescript/src/utility.d.ts +0 -59
- package/lib/typescript/src/utility.d.ts.map +0 -1
- package/src/components/addressCard.tsx +0 -219
- package/src/components/applyCouponCard.tsx +0 -197
- package/src/components/bankCard.tsx +0 -50
- package/src/components/cancelPaymentModal.tsx +0 -68
- package/src/components/checkboxContainer.tsx +0 -66
- package/src/components/circularProgress.tsx +0 -74
- package/src/components/cvvInfoBottomSheet.tsx +0 -58
- package/src/components/deleteAddressModal.tsx +0 -105
- package/src/components/fontFamily.tsx +0 -33
- package/src/components/getInstalledUPI.ts +0 -32
- package/src/components/header.tsx +0 -112
- package/src/components/imageLoader.tsx +0 -110
- package/src/components/knowMoreBottomSheet.tsx +0 -111
- package/src/components/morePaymentContainer.tsx +0 -66
- package/src/components/morePaymentMethods.tsx +0 -236
- package/src/components/offerCard.tsx +0 -173
- package/src/components/orderDetails.tsx +0 -503
- package/src/components/paymentFailed.tsx +0 -95
- package/src/components/paymentSelector.tsx +0 -186
- package/src/components/paymentSuccess.tsx +0 -266
- package/src/components/savedAddressBottomSheet.tsx +0 -123
- package/src/components/savedAddressCard.tsx +0 -113
- package/src/components/savedCardComponent.tsx +0 -271
- package/src/components/selectTenureCard.tsx +0 -475
- package/src/components/sessionExpire.tsx +0 -89
- package/src/components/shimmerView.tsx +0 -31
- package/src/navigation.tsx +0 -81
- package/src/postRequest/callUIAnalytics.ts +0 -36
- package/src/postRequest/cardPostRequest.ts +0 -57
- package/src/postRequest/deleteSavedAddress.ts +0 -20
- package/src/postRequest/emiPostRequest.ts +0 -77
- package/src/postRequest/fetchCardDetails.ts +0 -16
- package/src/postRequest/fetchInstantOffer.ts +0 -19
- package/src/postRequest/fetchPaymentMethods.ts +0 -14
- package/src/postRequest/fetchRecommendedInstruments.tsx +0 -17
- package/src/postRequest/fetchSavedAddress.ts +0 -16
- package/src/postRequest/fetchSessionDetails.tsx +0 -13
- package/src/postRequest/fetchStatus.tsx +0 -14
- package/src/postRequest/fetchSurcharge.ts +0 -23
- package/src/postRequest/methodsPostRequest.tsx +0 -41
- package/src/postRequest/upiPostRequest.tsx +0 -37
- package/src/screens/addressScreen.tsx +0 -887
- package/src/screens/bnplScreen.tsx +0 -309
- package/src/screens/cardScreen.tsx +0 -1114
- package/src/screens/emiScreen.tsx +0 -856
- package/src/screens/instantOfferList.tsx +0 -180
- package/src/screens/mainScreen.tsx +0 -1022
- package/src/screens/netBankingScreen.tsx +0 -460
- package/src/screens/savedAddressScreen.tsx +0 -294
- package/src/screens/selectTenureScreen.tsx +0 -137
- package/src/screens/upiScreen.tsx +0 -658
- package/src/screens/upiTimerScreen.tsx +0 -263
- package/src/screens/walletScreen.tsx +0 -401
- package/src/screens/webViewScreen.tsx +0 -90
- package/src/sdk-version.json +0 -1
- package/src/serviceRequest.ts +0 -27
- package/src/sharedContext/checkoutDetailsHandler.ts +0 -104
- package/src/sharedContext/handlePaymentResponseHandler.ts +0 -301
- package/src/sharedContext/paymentStatusHandler.ts +0 -12
- package/src/sharedContext/userdataHandler.ts +0 -55
- package/src/styles/components/addressCardStyles.ts +0 -55
- package/src/styles/components/bankCardStyles.ts +0 -58
- package/src/styles/components/cancelPaymentModalStyles.ts +0 -82
- package/src/styles/components/cvvInfoBottomSheetStyles.ts +0 -49
- package/src/styles/components/savedAddressCardStyles.ts +0 -60
- package/src/styles/indexStyles.ts +0 -60
- package/src/styles/screens/addressScreenStyles..ts +0 -60
- package/src/styles/screens/bnplScreenStyles.ts +0 -78
- package/src/styles/screens/cardScreenStyles.ts +0 -153
- package/src/styles/screens/emiScreenStyles.ts +0 -112
- package/src/styles/screens/instantOfferScreenStyles.ts +0 -43
- package/src/styles/screens/netBankingScreenStyles.ts +0 -84
- package/src/styles/screens/savedAddressScreenStyles.ts +0 -49
- package/src/styles/screens/selectTenureScreenStyles.ts +0 -37
- package/src/styles/screens/upiScreenStyles.ts +0 -167
- package/src/styles/screens/upiTimerScreenStyle.ts +0 -91
- package/src/styles/screens/walletScreenStyles.ts +0 -96
- package/src/utility.ts +0 -201
package/README.md
CHANGED
|
@@ -11,23 +11,83 @@ npm install boxpay-checkout-reactnative-sdk
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import BoxpayCheckout from 'boxpay-checkout-
|
|
15
|
-
import { ConfigurationOptions, PaymentResultObject } from 'boxpay-checkout-
|
|
14
|
+
import BoxpayCheckout from 'boxpay-checkout-react-native-sdk';
|
|
15
|
+
import { ConfigurationOptions, PaymentResultObject, UIConfigurationOptions } from 'boxpay-checkout-react-native-sdk/interface';
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
// ...
|
|
20
20
|
const handlePaymentResult = (result: PaymentResultObject) => {
|
|
21
|
-
alert(`Payment ${result.status} : + ${result.transactionId}`);
|
|
21
|
+
alert(`Payment ${result.status} : + ${result.transactionId} + ${result.inquiryToken}`);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
<BoxpayCheckout
|
|
25
25
|
token={token}
|
|
26
26
|
onPaymentResult={handlePaymentResult}
|
|
27
|
+
uiConfiguration={{
|
|
28
|
+
// **Optional** — Controls the border radius (in dp) of the primary CTA (Call-To-Action) buttons.
|
|
29
|
+
// Use 2 for sharp corners, or higher values (e.g., 20) for pill-shaped buttons.
|
|
30
|
+
// Omit this field to use the default border radius.
|
|
31
|
+
[UIConfigurationOptions.CTABorderRadius]: 20,
|
|
32
|
+
|
|
33
|
+
// **Optional** — Customize the font family used throughout the checkout UI.
|
|
34
|
+
// IMPORTANT: Fonts must be pre-loaded in your app before passing them here,
|
|
35
|
+
// otherwise they will not render correctly.
|
|
36
|
+
// Example using expo-font:
|
|
37
|
+
//
|
|
38
|
+
// import * as Font from 'expo-font';
|
|
39
|
+
// await Font.loadAsync({
|
|
40
|
+
// 'YourFont-Regular': require('./assets/fonts/YourFont-Regular.ttf'),
|
|
41
|
+
// 'YourFont-Medium': require('./assets/fonts/YourFont-Medium.ttf'),
|
|
42
|
+
// 'YourFont-SemiBold': require('./assets/fonts/YourFont-SemiBold.ttf'),
|
|
43
|
+
// 'YourFont-Bold': require('./assets/fonts/YourFont-Bold.ttf'),
|
|
44
|
+
// 'YourFont-ExtraBold': require('./assets/fonts/YourFont-ExtraBold.ttf'),
|
|
45
|
+
// });
|
|
46
|
+
//
|
|
47
|
+
// Once fonts are loaded, pass the font family names below:
|
|
48
|
+
// [UIConfigurationOptions.FontFamily]: {
|
|
49
|
+
// regular: 'YourFont-Regular',
|
|
50
|
+
// medium: 'YourFont-Medium',
|
|
51
|
+
// semiBold: 'YourFont-SemiBold',
|
|
52
|
+
// bold: 'YourFont-Bold',
|
|
53
|
+
// extraBold: 'YourFont-ExtraBold',
|
|
54
|
+
// },
|
|
55
|
+
|
|
56
|
+
// **Optional** — Customize the appearance of text input fields throughout the checkout UI.
|
|
57
|
+
// Allows you to control border color.
|
|
58
|
+
// Omit this field to use the default text input field styles.
|
|
59
|
+
// Example:
|
|
60
|
+
//
|
|
61
|
+
// [UIConfigurationOptions.TextInputFields]: {
|
|
62
|
+
// borderColor: '#CCCCCC',
|
|
63
|
+
// focusedBorderColor: '#0066FF',
|
|
64
|
+
// },
|
|
65
|
+
}}
|
|
27
66
|
configurationOptions={{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
67
|
+
// Flag to control whether BoxPay Success screen should be displayed before executing the callback.
|
|
68
|
+
// It enables merchants to control whether they want to leverage their own success screens.
|
|
69
|
+
// Default value is false meaning merchants should navigate shoppers to their success screen on successful payments.
|
|
70
|
+
[ConfigurationOptions.ShowBoxpaySuccessScreen]: true,
|
|
71
|
+
|
|
72
|
+
// Flag to control whether BoxPay Failure screen should be displayed before executing the callback.
|
|
73
|
+
// It enables merchants to control whether they want to leverage their own failure screens.
|
|
74
|
+
// Default value is false meaning merchants should navigate shoppers to their failure screen on failure payments.
|
|
75
|
+
[ConfigurationOptions.ShowBoxpayFailedScreen]: true,
|
|
76
|
+
|
|
77
|
+
// Flag to control whether BoxPay Sandbox/test env should be used.
|
|
78
|
+
// It is primarily available for testing purposes.
|
|
79
|
+
// Default value is set to false meaning prod environment will be used to process the payments.
|
|
80
|
+
[ConfigurationOptions.EnableSandboxEnv]: true,
|
|
81
|
+
|
|
82
|
+
// Flag to control whether UPI QR should be loaded by default.
|
|
83
|
+
// Default value is set to false to ensure maximum success rate as enabling this flag
|
|
84
|
+
// will result into transactions even though shopper doesn't make UPI payments.
|
|
85
|
+
[ConfigurationOptions.ShowUPIQROnLoad]: true,
|
|
86
|
+
|
|
87
|
+
// Flag to control SI (Standing Instructions) checkbox should be visible or not in Cards Screen.
|
|
88
|
+
// Default value is set to false
|
|
89
|
+
// This checkbox will be visible when this flag is true and subscription object is present in checkout token.
|
|
90
|
+
[ConfigurationOptions.ShowSICheckbox]: true,
|
|
31
91
|
}}
|
|
32
92
|
shopperToken={shopperToken}
|
|
33
93
|
/>
|
package/android/build.gradle
CHANGED
|
@@ -41,5 +41,5 @@ repositories {
|
|
|
41
41
|
dependencies {
|
|
42
42
|
implementation 'com.facebook.react:react-android:0.74.0'
|
|
43
43
|
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.0'
|
|
44
|
-
implementation 'com.github.BoxPay-SDKs.cross-platform-sdk:cross-platform-sdk:1.0.
|
|
44
|
+
implementation 'com.github.BoxPay-SDKs.cross-platform-sdk:cross-platform-sdk:1.0.2'
|
|
45
45
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
package com.reactnativemodule
|
|
2
|
+
|
|
3
|
+
import android.view.View
|
|
4
|
+
import com.crossplatform.BoxPayElementsView
|
|
5
|
+
import com.crossplatform.sdk.data.handler.BoxPayElementsHandler
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
8
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
9
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
10
|
+
|
|
11
|
+
class BoxPayElementsViewManager(
|
|
12
|
+
private val reactContext: ReactApplicationContext
|
|
13
|
+
) : SimpleViewManager<View>() {
|
|
14
|
+
|
|
15
|
+
// one handler per view instance so the merchant's button can drive it
|
|
16
|
+
private val handlers = mutableMapOf<View, BoxPayElementsHandler>()
|
|
17
|
+
|
|
18
|
+
override fun getName() = "BoxPayElementsView"
|
|
19
|
+
|
|
20
|
+
override fun createViewInstance(context: ThemedReactContext): View {
|
|
21
|
+
// placeholder until props (token, methods) arrive; rebuilt in the props below
|
|
22
|
+
return android.widget.FrameLayout(context)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@ReactProp(name = "config")
|
|
26
|
+
fun setConfig(parent: View, config: com.facebook.react.bridge.ReadableMap) {
|
|
27
|
+
val container = parent as android.widget.FrameLayout
|
|
28
|
+
val handler = BoxPayElementsHandler()
|
|
29
|
+
handlers[parent] = handler
|
|
30
|
+
|
|
31
|
+
val methods = config.getArray("paymentMethodList")
|
|
32
|
+
?.toArrayList()?.filterIsInstance<String>() ?: emptyList()
|
|
33
|
+
|
|
34
|
+
val view = BoxPayElementsView.create(
|
|
35
|
+
context = reactContext.currentActivity ?: reactContext,
|
|
36
|
+
handler = handler,
|
|
37
|
+
token = config.getString("token") ?: "",
|
|
38
|
+
isTestEnv = config.hasKey("isTestEnv") && config.getBoolean("isTestEnv"),
|
|
39
|
+
paymentMethodList = methods,
|
|
40
|
+
fontFamily = config.getString("fontFamily"),
|
|
41
|
+
isBoxPayProceedButtonVisible = true
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
// forward payable state to JS
|
|
45
|
+
handler.setOnPayableChanged { payable ->
|
|
46
|
+
val event = com.facebook.react.bridge.Arguments.createMap().apply {
|
|
47
|
+
putBoolean("payable", payable)
|
|
48
|
+
}
|
|
49
|
+
reactContext.getJSModule(
|
|
50
|
+
com.facebook.react.uimanager.events.RCTEventEmitter::class.java
|
|
51
|
+
).receiveEvent(parent.id, "onPayableChanged", event)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
container.removeAllViews()
|
|
55
|
+
container.addView(view)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// merchant calls pay() through a command
|
|
59
|
+
override fun receiveCommand(root: View, commandId: String?, args: com.facebook.react.bridge.ReadableArray?) {
|
|
60
|
+
if (commandId == "pay") handlers[root]?.pay()
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,39 +1,68 @@
|
|
|
1
1
|
package com.reactnativemodule
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
|
-
import com.crossplatform.android.UPIAppDetectorAndroid
|
|
5
4
|
import com.facebook.react.bridge.*
|
|
6
|
-
|
|
7
|
-
// Import the Arguments class to create a WritableArray
|
|
8
5
|
import com.facebook.react.bridge.Arguments
|
|
6
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
7
|
+
import com.crossplatform.BoxPayActivity
|
|
8
|
+
import com.crossplatform.sdk.data.handler.SDKPaymentResponseHandler
|
|
9
|
+
import com.crossplatform.sdk.data.model.SDKPaymentResponse
|
|
9
10
|
|
|
10
11
|
class CrossPlatform(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
11
12
|
private val context: Context = reactContext
|
|
12
13
|
|
|
13
|
-
override fun getName(): String
|
|
14
|
-
return "CrossPlatform"
|
|
15
|
-
}
|
|
14
|
+
override fun getName(): String = "CrossPlatform"
|
|
16
15
|
|
|
17
16
|
@ReactMethod
|
|
18
|
-
fun
|
|
17
|
+
fun startCheckout(token: String, options: ReadableMap, promise: Promise) {
|
|
19
18
|
try {
|
|
20
|
-
val
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
val activity = reactApplicationContext.currentActivity ?: run {
|
|
20
|
+
promise.reject("NO_ACTIVITY", "No current activity")
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
val writableArray: WritableArray = Arguments.createArray()
|
|
24
|
+
fun flag(key: String) = options.hasKey(key) && options.getBoolean(key)
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
val ui = options.getMap("uiConfiguration")
|
|
27
|
+
val ctaBorderRadius = ui?.takeIf { it.hasKey("ctaBorderRadius") }?.getInt("ctaBorderRadius") ?: 12
|
|
28
|
+
val focusedColor = ui?.getString("focusedTextInputBorderColor") ?: "#2D2B32"
|
|
29
|
+
val unfocusedColor = ui?.getString("unfocusedTextInputBorderColor") ?: "#ADACB0"
|
|
30
|
+
val fontFamily = ui?.getString("fontFamily")
|
|
31
31
|
|
|
32
|
-
//
|
|
33
|
-
|
|
32
|
+
// Result delivery — set BEFORE launching
|
|
33
|
+
SDKPaymentResponseHandler.set { result -> sendPaymentResult(result) }
|
|
34
34
|
|
|
35
|
+
activity.runOnUiThread {
|
|
36
|
+
val intent = BoxPayActivity.createIntent(
|
|
37
|
+
context = activity,
|
|
38
|
+
token = token,
|
|
39
|
+
isTestEnv = flag("enableSandboxEnv"),
|
|
40
|
+
shopperToken = options.getString("shopperToken") ?: "",
|
|
41
|
+
showQROnLoad = flag("showQROnLoad"),
|
|
42
|
+
isSICheckBoxEnabled = flag("isSICheckBoxEnabled"),
|
|
43
|
+
isSICheckBoxChecked = flag("isSICheckBoxChecked"),
|
|
44
|
+
isFailedScreenVisible = flag("showFailedScreen"),
|
|
45
|
+
isSuccessScreenVisible = flag("showSuccessScreen"),
|
|
46
|
+
ctaBorderRadius = ctaBorderRadius,
|
|
47
|
+
focusedTextInputBorderColor = focusedColor,
|
|
48
|
+
unfocusedTextInputBorderColor = unfocusedColor,
|
|
49
|
+
fontFamily = fontFamily
|
|
50
|
+
)
|
|
51
|
+
activity.startActivity(intent)
|
|
52
|
+
}
|
|
53
|
+
promise.resolve(true)
|
|
35
54
|
} catch (e: Exception) {
|
|
36
|
-
promise.reject("
|
|
55
|
+
promise.reject("CHECKOUT_ERROR", e)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private fun sendPaymentResult(result: SDKPaymentResponse) {
|
|
60
|
+
val map = Arguments.createMap().apply {
|
|
61
|
+
putString("status", result.status?.toString())
|
|
62
|
+
putString("transactionId", result.transactionId)
|
|
63
|
+
putString("inquiryToken", result.inquiryToken)
|
|
37
64
|
}
|
|
65
|
+
reactApplicationContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
66
|
+
.emit("BoxPayPaymentResult", map)
|
|
38
67
|
}
|
|
39
68
|
}
|
|
@@ -11,7 +11,6 @@ class ReactNativeModulePackage : ReactPackage {
|
|
|
11
11
|
return listOf(CrossPlatform(reactContext))
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>>
|
|
15
|
-
|
|
16
|
-
}
|
|
14
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> =
|
|
15
|
+
listOf(BoxPayElementsViewManager(reactContext))
|
|
17
16
|
}
|
|
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
|
|
|
14
14
|
s.source = { :git => "https://github.com/Ishika1601-boxpay/react_native_module.git", :tag => "#{s.version}" }
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,swift}"
|
|
17
|
-
s.
|
|
17
|
+
s.dependency "CrossPlatformSDK", "1.0.2"
|
|
18
18
|
s.private_header_files = "ios/**/*.h"
|
|
19
19
|
s.dependency "React-Core"
|
|
20
20
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#import <React/RCTViewManager.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_MODULE(BoxPayElementsViewManager, RCTViewManager)
|
|
4
|
+
|
|
5
|
+
RCT_EXPORT_VIEW_PROPERTY(config, NSDictionary)
|
|
6
|
+
RCT_EXPORT_VIEW_PROPERTY(onPayableChanged, RCTDirectEventBlock)
|
|
7
|
+
|
|
8
|
+
RCT_EXTERN_METHOD(pay:(nonnull NSNumber *)node)
|
|
9
|
+
|
|
10
|
+
@end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import cross_platform_sdk
|
|
3
|
+
import React
|
|
4
|
+
import UIKit
|
|
5
|
+
|
|
6
|
+
@objc(BoxPayElementsViewManager)
|
|
7
|
+
class BoxPayElementsViewManager: RCTViewManager {
|
|
8
|
+
override func view() -> UIView! { BoxPayElementsContainer() }
|
|
9
|
+
override static func requiresMainQueueSetup() -> Bool { true }
|
|
10
|
+
|
|
11
|
+
// command from JS to trigger payment
|
|
12
|
+
@objc func pay(_ node: NSNumber) {
|
|
13
|
+
DispatchQueue.main.async {
|
|
14
|
+
guard let view = self.bridge.uiManager.view(forReactTag: node) as? BoxPayElementsContainer
|
|
15
|
+
else { return }
|
|
16
|
+
view.pay()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
class BoxPayElementsContainer: UIView {
|
|
22
|
+
private var handler: BoxPayElementsHandler?
|
|
23
|
+
private var hosted: UIViewController?
|
|
24
|
+
|
|
25
|
+
@objc var onPayableChanged: RCTDirectEventBlock?
|
|
26
|
+
|
|
27
|
+
@objc var config: NSDictionary? {
|
|
28
|
+
didSet { rebuild() }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private func rebuild() {
|
|
32
|
+
guard let config = config, let token = config["token"] as? String else { return }
|
|
33
|
+
subviews.forEach { $0.removeFromSuperview() }
|
|
34
|
+
|
|
35
|
+
let handler = BoxPayElementsHandler()
|
|
36
|
+
self.handler = handler
|
|
37
|
+
|
|
38
|
+
let methods = (config["paymentMethodList"] as? [String]) ?? []
|
|
39
|
+
|
|
40
|
+
let vc = BoxPayElementsViewControllerKt.BoxPayElementsViewController(
|
|
41
|
+
token: token,
|
|
42
|
+
isTestEnv: (config["isTestEnv"] as? Bool) ?? false,
|
|
43
|
+
shopperToken: config["shopperToken"] as? String,
|
|
44
|
+
showQROnLoad: (config["showQROnLoad"] as? Bool) ?? false,
|
|
45
|
+
ctaBorderRadius: Int32(
|
|
46
|
+
(config["ctaBorderRadius"] as? Int) ?? 12
|
|
47
|
+
),
|
|
48
|
+
isSICheckBoxChecked:
|
|
49
|
+
(config["isSICheckBoxChecked"] as? Bool) ?? false,
|
|
50
|
+
isSICheckBoxEnabled:
|
|
51
|
+
(config["isSICheckBoxEnabled"] as? Bool) ?? false,
|
|
52
|
+
focusedTextInputBorderColor:
|
|
53
|
+
(config["focusedTextInputBorderColor"] as? String) ?? "#2D2B32",
|
|
54
|
+
unfocusedTextInputBorderColor:
|
|
55
|
+
(config["unfocusedTextInputBorderColor"] as? String) ?? "#ADACB0",
|
|
56
|
+
paymentMethodList: methods,
|
|
57
|
+
isBoxPayProceedButtonVisible:
|
|
58
|
+
(config["isBoxPayProceedButtonVisible"] as? Bool) ?? false,
|
|
59
|
+
fontFamily: config["fontFamily"] as? String,
|
|
60
|
+
handler: handler,
|
|
61
|
+
onDismiss: { [weak self] in
|
|
62
|
+
// SDK dismissed
|
|
63
|
+
self?.hosted = nil
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
self.hosted = vc
|
|
67
|
+
|
|
68
|
+
// // payable state → JS
|
|
69
|
+
// handler.setOnPayableChanged(listener: PayableListener { [weak self] payable in
|
|
70
|
+
// self?.onPayableChanged?(["payable": payable])
|
|
71
|
+
// })
|
|
72
|
+
|
|
73
|
+
vc.view.frame = bounds
|
|
74
|
+
vc.view.autoresizingMask = [
|
|
75
|
+
UIView.AutoresizingMask.flexibleWidth,
|
|
76
|
+
UIView.AutoresizingMask.flexibleHeight
|
|
77
|
+
]
|
|
78
|
+
addSubview(vc.view)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
func pay() { handler?.pay() }
|
|
82
|
+
}
|
package/ios/CrossPlatform.m
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
|
|
3
|
-
// This exposes the Swift class "CrossPlatform" to React Native.
|
|
4
3
|
@interface RCT_EXTERN_MODULE(CrossPlatform, NSObject)
|
|
5
4
|
|
|
6
|
-
// This exposes the getInstalledApps method.
|
|
7
5
|
RCT_EXTERN_METHOD(getInstalledApps:(RCTPromiseResolveBlock)resolve
|
|
8
6
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
9
7
|
|
|
8
|
+
RCT_EXTERN_METHOD(startCheckout:(NSString *)token
|
|
9
|
+
options:(NSDictionary *)options
|
|
10
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
11
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
12
|
+
|
|
10
13
|
@end
|
package/ios/CrossPlatform.swift
CHANGED
|
@@ -1,39 +1,87 @@
|
|
|
1
1
|
import Foundation
|
|
2
|
-
import
|
|
3
|
-
import React
|
|
2
|
+
import cross_platform_sdk
|
|
3
|
+
import React
|
|
4
4
|
|
|
5
|
-
// The @objc(CrossPlatform) is what exposes this to React Native.
|
|
6
5
|
@objc(CrossPlatform)
|
|
7
|
-
class CrossPlatform:
|
|
6
|
+
class CrossPlatform: RCTEventEmitter {
|
|
8
7
|
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
// MARK: - Track listener state ourselves (hasListeners isn't visible from Swift here)
|
|
9
|
+
private var hasObservers = false
|
|
10
|
+
|
|
11
|
+
override func startObserving() {
|
|
12
|
+
hasObservers = true
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@objc
|
|
18
|
-
static func moduleName() -> String! {
|
|
19
|
-
return "CrossPlatform"
|
|
15
|
+
override func stopObserving() {
|
|
16
|
+
hasObservers = false
|
|
20
17
|
}
|
|
21
18
|
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
func
|
|
25
|
-
|
|
26
|
-
// For now, let's return dummy data to confirm the bridge is working.
|
|
27
|
-
let detector = UPIAppDetectorIOS()
|
|
28
|
-
let upiService = UPIService(detector: detector)
|
|
29
|
-
let apps = upiService.getAvailableApps()
|
|
30
|
-
resolve(apps)
|
|
19
|
+
// MARK: - RCTEventEmitter requirements
|
|
20
|
+
|
|
21
|
+
override func supportedEvents() -> [String]! {
|
|
22
|
+
return ["BoxPayPaymentResult", "BoxPayDismiss"]
|
|
31
23
|
}
|
|
32
24
|
|
|
33
|
-
// This tells React Native whether to set up the module on the main UI thread.
|
|
34
|
-
// False is better for performance for non-UI modules.
|
|
35
25
|
@objc
|
|
36
|
-
static func
|
|
37
|
-
|
|
26
|
+
override static func moduleName() -> String! { "CrossPlatform" }
|
|
27
|
+
|
|
28
|
+
@objc
|
|
29
|
+
override static func requiresMainQueueSetup() -> Bool { true }
|
|
30
|
+
|
|
31
|
+
// MARK: - startCheckout
|
|
32
|
+
|
|
33
|
+
@objc
|
|
34
|
+
func startCheckout(_ token: String,
|
|
35
|
+
options: NSDictionary,
|
|
36
|
+
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
37
|
+
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
38
|
+
DispatchQueue.main.async {
|
|
39
|
+
guard let root = RCTPresentedViewController() ??
|
|
40
|
+
UIApplication.shared.keyWindow?.rootViewController else {
|
|
41
|
+
reject("NO_VC", "No view controller to present from", nil)
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let ui = options["uiConfiguration"] as? NSDictionary
|
|
46
|
+
var vc: UIViewController!
|
|
47
|
+
|
|
48
|
+
vc = BoxPayViewControllerKt.BoxPayViewController(
|
|
49
|
+
token: token,
|
|
50
|
+
isTestEnv: (options["enableSandboxEnv"] as? Bool) ?? false,
|
|
51
|
+
shopperToken: options["shopperToken"] as? String,
|
|
52
|
+
isSuccessScreenVisible: (options["showSuccessScreen"] as? Bool) ?? false,
|
|
53
|
+
isFailedScreenVisible: (options["showFailedScreen"] as? Bool) ?? false,
|
|
54
|
+
showQROnLoad: (options["showQROnLoad"] as? Bool) ?? false,
|
|
55
|
+
ctaBorderRadius: Int32((ui?["ctaBorderRadius"] as? Int) ?? 12),
|
|
56
|
+
isSICheckBoxChecked: (options["isSICheckBoxChecked"] as? Bool) ?? false,
|
|
57
|
+
isSICheckBoxEnabled: (options["isSICheckBoxEnabled"] as? Bool) ?? false,
|
|
58
|
+
focusedTextInputBorderColor: (ui?["focusedTextInputBorderColor"] as? String) ?? "#2D2B32",
|
|
59
|
+
unfocusedTextInputBorderColor: (ui?["unfocusedTextInputBorderColor"] as? String) ?? "#ADACB0",
|
|
60
|
+
onDismiss: { [weak self, weak vc] in
|
|
61
|
+
DispatchQueue.main.async {
|
|
62
|
+
vc?.dismiss(animated: true)
|
|
63
|
+
}
|
|
64
|
+
guard let self = self, self.hasObservers else { return }
|
|
65
|
+
self.sendEvent(withName: "BoxPayDismiss", body: nil)
|
|
66
|
+
},
|
|
67
|
+
fontFamily: ui?["fontFamily"] as? String
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
SDKPaymentResponseHandler.shared.set { [weak self] result in
|
|
71
|
+
guard let self = self, self.hasObservers else { return }
|
|
72
|
+
|
|
73
|
+
let map: [String: Any] = [
|
|
74
|
+
"status": result.status ?? NSNull(),
|
|
75
|
+
"transactionId": result.transactionId ?? NSNull(),
|
|
76
|
+
"inquiryToken": result.inquiryToken ?? NSNull()
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
self.sendEvent(withName: "BoxPayPaymentResult", body: map)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
vc.modalPresentationStyle = .fullScreen
|
|
83
|
+
root.present(vc, animated: true)
|
|
84
|
+
resolve(true)
|
|
85
|
+
}
|
|
38
86
|
}
|
|
39
87
|
}
|
package/lib/module/index.js
CHANGED
|
@@ -1,26 +1,121 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { Button, StyleSheet, View } from 'react-native';
|
|
5
|
+
import { ConfigurationOptions, SICheckboxState, UIConfigurationOptions } from "./interface.js";
|
|
6
|
+
import { BoxPayElements, payElements, startCheckout, onPaymentResult as subscribePaymentResult } from "./native.js";
|
|
7
|
+
|
|
8
|
+
// ── Full-screen checkout (mirrors Android display()) ──────────────────────────
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const BoxpayCheckout = ({
|
|
8
11
|
token,
|
|
9
12
|
configurationOptions = null,
|
|
10
13
|
onPaymentResult,
|
|
11
14
|
shopperToken = null,
|
|
12
15
|
uiConfiguration = null
|
|
13
16
|
}) => {
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const sub = subscribePaymentResult(r => onPaymentResult?.(r));
|
|
19
|
+
return () => sub.remove();
|
|
20
|
+
}, [onPaymentResult]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
startCheckout(token, buildOptions(configurationOptions, uiConfiguration, shopperToken));
|
|
23
|
+
}, [token]);
|
|
14
24
|
return /*#__PURE__*/_jsx(View, {
|
|
25
|
+
style: styles.screenView
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// ── Embedded elements with merchant button (mirrors createElementsView) ───────
|
|
30
|
+
export const BoxpayElements = ({
|
|
31
|
+
token,
|
|
32
|
+
configurationOptions = null,
|
|
33
|
+
onPaymentResult,
|
|
34
|
+
shopperToken = null,
|
|
35
|
+
uiConfiguration = null,
|
|
36
|
+
paymentMethodList
|
|
37
|
+
}) => {
|
|
38
|
+
const elementsRef = useRef(null);
|
|
39
|
+
const [payable, setPayable] = useState(false);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const sub = subscribePaymentResult(r => onPaymentResult?.(r));
|
|
42
|
+
return () => sub.remove();
|
|
43
|
+
}, [onPaymentResult]);
|
|
44
|
+
const textInputFields = uiConfiguration?.[UIConfigurationOptions.TextInputFields];
|
|
45
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
15
46
|
style: styles.screenView,
|
|
16
|
-
children: /*#__PURE__*/_jsx(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
47
|
+
children: [/*#__PURE__*/_jsx(BoxPayElements, {
|
|
48
|
+
ref: elementsRef,
|
|
49
|
+
style: styles.elements,
|
|
50
|
+
config: {
|
|
51
|
+
token,
|
|
52
|
+
isTestEnv: configurationOptions?.[ConfigurationOptions.EnableSandboxEnv] === true,
|
|
53
|
+
shopperToken,
|
|
54
|
+
paymentMethodList,
|
|
55
|
+
fontFamily: uiConfiguration?.[UIConfigurationOptions.FontFamily],
|
|
56
|
+
ctaBorderRadius: uiConfiguration?.[UIConfigurationOptions.CTABorderRadius],
|
|
57
|
+
focusedTextInputBorderColor: textInputFields?.focusedTextInputBorderColor,
|
|
58
|
+
unfocusedTextInputBorderColor: textInputFields?.unfocusedTextInputBorderColor
|
|
59
|
+
},
|
|
60
|
+
onPayableChanged: e => setPayable(e.nativeEvent.payable)
|
|
61
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
62
|
+
title: "Pay",
|
|
63
|
+
disabled: !payable,
|
|
64
|
+
onPress: () => payElements(elementsRef.current)
|
|
65
|
+
})]
|
|
23
66
|
});
|
|
24
67
|
};
|
|
25
|
-
|
|
68
|
+
|
|
69
|
+
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
70
|
+
|
|
71
|
+
function buildOptions(config, ui, shopperToken) {
|
|
72
|
+
const textInputFields = ui?.[UIConfigurationOptions.TextInputFields];
|
|
73
|
+
const siState = config?.[ConfigurationOptions.SICheckBoxState];
|
|
74
|
+
const si = siFlags(siState);
|
|
75
|
+
return {
|
|
76
|
+
shopperToken: shopperToken ?? '',
|
|
77
|
+
enableSandboxEnv: config?.[ConfigurationOptions.EnableSandboxEnv] === true,
|
|
78
|
+
showSuccessScreen: config?.[ConfigurationOptions.ShowBoxpaySuccessScreen] === true,
|
|
79
|
+
showFailedScreen: config?.[ConfigurationOptions.ShowBoxpayFailedScreen] === true,
|
|
80
|
+
showQROnLoad: config?.[ConfigurationOptions.ShowUPIQROnLoad] === true,
|
|
81
|
+
isSICheckBoxChecked: si.checked,
|
|
82
|
+
isSICheckBoxEnabled: si.enabled,
|
|
83
|
+
fontFamily: ui?.[UIConfigurationOptions.FontFamily],
|
|
84
|
+
ctaBorderRadius: ui?.[UIConfigurationOptions.CTABorderRadius],
|
|
85
|
+
focusedTextInputBorderColor: textInputFields?.focusedTextInputBorderColor,
|
|
86
|
+
unfocusedTextInputBorderColor: textInputFields?.unfocusedTextInputBorderColor
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function siFlags(state) {
|
|
90
|
+
switch (state) {
|
|
91
|
+
case SICheckboxState.CHECKED_AND_ENABLED:
|
|
92
|
+
return {
|
|
93
|
+
checked: true,
|
|
94
|
+
enabled: true
|
|
95
|
+
};
|
|
96
|
+
case SICheckboxState.CHECKED_AND_DISABLED:
|
|
97
|
+
return {
|
|
98
|
+
checked: true,
|
|
99
|
+
enabled: false
|
|
100
|
+
};
|
|
101
|
+
case SICheckboxState.UNCHECKED_AND_ENABLED:
|
|
102
|
+
return {
|
|
103
|
+
checked: false,
|
|
104
|
+
enabled: true
|
|
105
|
+
};
|
|
106
|
+
default:
|
|
107
|
+
return {
|
|
108
|
+
checked: false,
|
|
109
|
+
enabled: false
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const styles = StyleSheet.create({
|
|
114
|
+
screenView: {
|
|
115
|
+
flex: 1
|
|
116
|
+
},
|
|
117
|
+
elements: {
|
|
118
|
+
flex: 1
|
|
119
|
+
}
|
|
120
|
+
});
|
|
26
121
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","Button","StyleSheet","View","ConfigurationOptions","SICheckboxState","UIConfigurationOptions","BoxPayElements","payElements","startCheckout","onPaymentResult","subscribePaymentResult","jsx","_jsx","jsxs","_jsxs","BoxpayCheckout","token","configurationOptions","shopperToken","uiConfiguration","sub","r","remove","buildOptions","style","styles","screenView","BoxpayElements","paymentMethodList","elementsRef","payable","setPayable","textInputFields","TextInputFields","children","ref","elements","config","isTestEnv","EnableSandboxEnv","fontFamily","FontFamily","ctaBorderRadius","CTABorderRadius","focusedTextInputBorderColor","unfocusedTextInputBorderColor","onPayableChanged","e","nativeEvent","title","disabled","onPress","current","ui","siState","SICheckBoxState","si","siFlags","enableSandboxEnv","showSuccessScreen","ShowBoxpaySuccessScreen","showFailedScreen","ShowBoxpayFailedScreen","showQROnLoad","ShowUPIQROnLoad","isSICheckBoxChecked","checked","isSICheckBoxEnabled","enabled","state","CHECKED_AND_ENABLED","CHECKED_AND_DISABLED","UNCHECKED_AND_ENABLED","create","flex"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"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","ignoreList":[]}
|