UNPKG

@2c2p/pgw-sdk-react-native

Version:

2C2P PGW SDK for react native and allows merchants to build an excellent payment experience within their mobile apps by integrating easily with 2C2P's payment gateway.

304 lines (228 loc) 10.3 kB
/* * Created by DavidBilly PK on 12/9/24. */ export const APIEnvironment = { production: 'Production', productionIndonesia: 'ProductionIndonesia', sandbox: 'Sandbox' } export const APIResponseCode = { apiSuccess: '0000', transactionAuthenticateRedirect: '1000', transactionAuthenticateFullRedirect: '1001', transactionExternalBrowser: '1002', transactionPaymentSlip: '1003', transactionExternalApplication: '1004', transactionQRPayment: '1005', transactionCompleted: '2000', transactionInProgress: '2001', transactionNotFound: '2002', transactionInquiryFailed: '2003' } export const ApplePayPaymentResponseCode = { validationFailed: '0099', alidationFailedDescription: 'Validation failed due to invalid value for %@, these value are required for the payment.', invalidPaymentResultResponseCallback: '0099', invalidPaymentResultResponseCallbackDescription: 'The payment result response callback cannot be null. Please set the payment result response callback.', tokenGeneratedSuccess: '0000', tokenGeneratedSuccessDescription:'The Apple Pay token successfully generated.', supportedDevice: '0000', supportedDeviceDescription: 'The Apple Pay supported on this device.', tokenGenerateFailed: '0001', tokenGenerateFailedDescription: 'The Apple Pay token generate failed.', paymentCancelled: '0002', paymentCancelledDescription: 'The Apple Pay cancelled.', unsupportedDevice: '0003', unsupportedDeviceDescription: 'The Apple Pay unsupported on this device.' } export const DeepLinkPaymentResponseCode = { validationFailed: '0099', validationFailedDescription: 'Validation failed due to invalid value for %@, these value are required for the payment.', invalidPaymentResultResponseCallback: '0099', invalidPaymentResultResponseCallbackDescription: 'The payment result response callback cannot be null. Please set the payment result response callback.', thirdPartySDKFailed: '0099', thirdPartySDKFailedDescription: 'Third party SDK failed. Error: %s.', launchPaymentActivityFailed: '0099', launchPaymentActivityFailedDescription: 'Launch payment activity failed. Error: %s.', paymentInfoInitializationFailed: '0099', paymentInfoInitializationFailedDescription: 'The payment info initialization failed.', paymentTransactionStatusInquiry: '0000', paymentTransactionStatusInquiryDescription: 'Deep link callback from app, please use payment token for request transaction status inquiry API.', paymentTokenNotFound: '0001', paymentTokenNotFoundDescription: 'Deep link callback from app, but payment token not found.', paymentCancelled: '0002', paymentCancelledDescription: 'The payment cancelled.', openAppWithDataSuccess: '0003', openAppWithDataSuccessDescription: 'Open app by data success.', openAppWithFallbackDataSuccess: '0003', openAppWithFallbackDataSuccessDescription: 'Open app by fallback data success.', retryOpenAppWithFallbackData: '0004', retryOpenAppWithFallbackDataDescription: 'Open app by data failed, due to current app is not allowed to query for scheme (info.plist) or user may not install the %@ app. Now re-try open app by fallback data.', openAppWithDataAndFallbackFailed: '0005', openAppWithDataAndFallbackFailedDescription: 'Open app by data and fallback data both failed.' } export const GooglePayAPIEnvironment = { /// Reference: https://developers.google.com/android/reference/com/google/android/gms/wallet/WalletConstants production: 1, test: 3 } export const GooglePayPaymentResponseCode = { validationFailed: '0099', validationFailedDescription: 'Validation failed due to invalid value for %@, these value are required for the payment.', invalidPaymentResultResponseCallback: '0099', invalidPaymentResultResponseCallbackDescription: 'The payment result response callback cannot be null. Please set the payment result response callback.', thirdPartySDKFailed: '0099', thirdPartySDKFailedDescription: 'Third party SDK failed. Error: %s.', launchPaymentActivityFailed: '0099', launchPaymentActivityFailedDescription: 'Launch payment activity failed. Error: %s.', paymentInfoInitializationFailed: '0099', paymentInfoInitializationFailedDescription: 'The payment info initialization failed.', tokenGeneratedSuccess: '0000', tokenGeneratedSuccessDescription: 'The Google Pay token successfully generated.', supportedDevice: '0000', supportedDeviceDescription: 'The Google Pay supported on this device.', tokenGenerateFailed: '0001', tokenGenerateFailedDescription: 'The Google Pay token generate failed.', paymentCancelled: '0002', paymentCancelledDescription: 'The Google Pay cancelled.', unsupportedDevice: '0003', unsupportedDeviceDescription: 'The Google Pay unsupported on this device.', paymentFailed: '0004', paymentFailedDescription: 'The Google Pay payment failed, please check GooglePayResult for more information.', payloadReadyToRequestFailed: '0005', payloadReadyToRequestFailedDescription: 'The Google Pay ready to request payload generate failed.', payloadPaymentDataRequestFailed: '0005', payloadPaymentDataRequestFailedDescription: 'The Google Pay payment data request payload generate failed.' } export const InstallmentInterestTypeCode = { customer: 'C', merchant: 'M' } export const PaymentCustomDataCode = { text: 'T', imageUrl: 'I', webUrl: 'U', fileUrl: 'F' } export const PaymentInputCode = { mandatory: 'M', ignore: 'I', optional: 'O' } export const PaymentNotificationPlatformCode = { facebook: 'FACEBOOK', whatsApp: 'WHATSAPP', weChat: 'WECHAT', line: 'LINE', email: 'EMAIL' } export const QRTypeCode = { raw: 'RAW', base64: 'BASE64', url: 'URL' } export const ZaloPayAPIEnvironment = { /// Reference: https://docs.zalopay.vn/en/v2/docs/apptoapp/guide.html production: "production", sandbox: "sandbox" } export const ZaloPayPaymentResponseCode = { validationFailed: '0099', validationFailedDescription: 'Validation failed due to invalid value for %@, these value are required for the payment.', invalidPaymentResultResponseCallback: '0099', invalidPaymentResultResponseCallbackDescription: 'The payment result response callback cannot be null. Please set the payment result response callback.', thirdPartySDKFailed: '0099', thirdPartySDKFailedDescription: 'Third party SDK failed. Error: %s.', launchPaymentActivityFailed: '0099', launchPaymentActivityFailedDescription: 'Launch payment activity failed. Error: %s.', paymentInfoInitializationFailed: '0099', paymentInfoInitializationFailedDescription: 'The payment info initialization failed.', paymentSuccess: '0000', paymentSuccessDescription: 'The payment success, please use payment token for request transaction status inquiry API.', paymentCancelled: '0001', paymentCancelledDescription: 'The payment cancelled, please check ZaloPayResult for more information.', paymentFailed: '0002', paymentFailedDescription: 'The payment failed, please check ZaloPayResult for more information.' } export const PaymentChannelCode = { category: { globalCardPayment: 'GCARD', localCardPayment: 'LCARD', localCardInstallmentPaymentPlan: 'LCARDIPP', digitalPayment: 'DPAY', qrPayment: 'QR', webPayment: 'WEBPAY', selfServiceMachine: 'SSM', payAtCounter: 'COUNTER', internetBanking: 'IMBANK', globalBuyNowPayLater: 'GBNPL', deepLinkPayment: 'DEEPLINK', onlineDirectDebit: 'ODD', digitalCurrency: 'DCURRENCY' }, group: { creditCard: 'CC', proprietaryCard: 'PCC', globalInstallmentPaymentPlan: 'IPP', localInstallmentPaymentPlan: 'LIPP', globalThirdPartyPayment: 'GTPTY', localThirdPartyPayment: 'LTPTY', eWalletPayment: 'EWALLET', masterPass: 'MPASS', qrCodePayment: 'QRC', cardSchemeQRPayment: 'CSQR', thaiQRPayment: 'THQR', singaporeQRPayment: 'SGQR', webPayment: 'WEBPAY', automatedTellerMachine: 'ATM', kiosk: 'KIOSK', bankCounter: 'BCTR', overTheCounter: 'OTCTR', internetBanking: 'IBANK', buyNowPayLater: 'BNPL', cardWalletPayment: 'CWALLET', deepLinkPayment: 'DEEPLINK', cardLoyaltyPointPayment: 'CLOYALTY', onlineDirectDebit: 'ODD', cryptoCurrency: 'CRYPTO' }, channel: { linePay: 'LINE', momoWallet: 'MOMO', shopeePay: 'SHPPAY', macauPassPay: 'MACAUPASS', macauPassAlipay: 'MPALIPAY', macauPassWeChatPay: 'MPWECHAT', oneTwoThree: '123', cardLoyaltyPointPayment: 'CLOYALTY', applePay: 'APPLEPAY', googlePay: 'GOOGLEPAY', zaloPay: 'ZALOPAY', tripleAWallet: 'TRIPLEA' }, agent: { singaporeDBS: 'SGDBS' }, agentChanel: { webPayment: 'WEBPAY', automatedTellerMachine: 'ATM', kiosk: 'KIOSK', bankCounter: 'BANKCOUNTER', overTheCounter: 'OVERTHECOUNTER', internetBanking: 'IBANKING', deepLinkPayment: 'DEEPLINK', onlineDirectDebit: 'ODD' } } export const PaymentUIResponseCode = { ValidationFailed: '0099', ValidationFailedDescription: 'Validation failed due to invalid value for %s, these value are required for the payment.', TransactionCompleted: '0000', TransactionCompletedDescription: 'The transaction completed, please use payment token for request transaction status inquiry API.', TransactionCancelled: '0001', TransactionCancelledDescription: 'The transaction cancelled by user manually.', TransactionFailed: '0002', TransactionFailedDescription: 'The transaction failed, error: %s.', TransactionRetryFailed: '0003', TransactionRetryFailedDescription: 'The transaction retry failed, please re-submit the ui payment request again.' }