@adyen/react-native
Version:
Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native
88 lines (85 loc) • 5.77 kB
JavaScript
import { Platform } from 'react-native';
export const UNKNOWN_PAYMENT_METHOD_ERROR = 'Unknown payment method or native module. \n\n' + 'Make sure your paymentMethods response contains: ';
export const UNSUPPORTED_PAYMENT_METHOD_ERROR = 'Unsupported payment method: ';
export const LINKING_ERROR = `The package '@adyen/react-native' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
export const MISSING_CONTEXT_ERROR = 'useAdyenCheckout must be used within an AdyenCheckout';
/** Collection of events that components can trigger. */
export let Event = /*#__PURE__*/function (Event) {
/** Event handler, called when the shopper selects the Pay button and payment details are valid. */
Event["onSubmit"] = "didSubmitCallback";
/** Event handler, called when a payment method requires more details, for example for native 3D Secure 2, or native QR code payment methods. */
Event["onAdditionalDetails"] = "didProvideCallback";
/** Event handler, called when a shopper finishes the flow (Voucher payments only). */
Event["onComplete"] = "didCompleteCallback";
/** Event handler, called when payment about to be terminate. */
Event["onError"] = "didFailCallback";
/** Event handler, called when address update called. */
Event["onAddressUpdate"] = "didUpdateAddressCallback";
/** Event handler, called when address confirmed called. */
Event["onAddressConfirm"] = "didConfirmAddressCallback";
/** Event handler, called when shopper requests to remove stored payment method on DropIn Advanced flow. */
Event["onDisableStoredPaymentMethod"] = "didDisableStoredPaymentMethodCallback";
/** Event handler, called when balance for an order needs to be checked. */
Event["onCheckBalance"] = "didCheckBalanceCallback";
/** Event handler, called when a new order for a partial payment needs to be requested. */
Event["onRequestOrder"] = "didRequestOrderCallback";
/** Event handler, called when the partial payment order was canceled. */
Event["onCancelOrder"] = "didCancelOrderCallback";
/** Event handler, called when the BIN lookup data is available. */
Event["onBinLookuop"] = "didBinLookupCallback";
/** Event handler, called when the BIN (first 6 or 8 PAN digits) typed by the shopper in the PAN field changes. */
Event["onBinValue"] = "didChangeBinValueCallback";
return Event;
}({});
/** Collection of errors components can throw. */
export let ErrorCode = /*#__PURE__*/function (ErrorCode) {
/** Payment was canceled by shopper. */
ErrorCode["canceled"] = "canceledByShopper";
/** Payment method not supported on current platform. */
ErrorCode["notSupported"] = "notSupported";
/** Missing or invalid clientKey in configuration. */
ErrorCode["noClientKey"] = "noClientKey";
/** Missing or invalid amount or country code in configuration. */
ErrorCode["noPayment"] = "noPayment";
/** Can not parse paymentMethods or the list is empty. */
ErrorCode["invalidPaymentMethods"] = "invalidPaymentMethods";
/** Can not parse action. */
ErrorCode["invalidAction"] = "invalidAction";
/** This component does not support action handling. */
ErrorCode["notSupportedAction"] = "notSupportedAction";
/** Can not find selected payment method type in provided list. */
ErrorCode["noPaymentMethod"] = "noPaymentMethod";
return ErrorCode;
}({});
/** Collection of available result codes that represent payments current state, as well as any actions you should take. */
export let ResultCode = /*#__PURE__*/function (ResultCode) {
/** The payment has been successfully authenticated with 3D Secure. */
ResultCode["authenticationFinished"] = "AuthenticationFinished";
/** The transaction does not require 3D Secure authentication, for example, the issuing bank does not require authentication or the transaction is out of scope. */
ResultCode["authenticationNotRequired"] = "AuthenticationNotRequired";
/** The payment was successfully authorised. */
ResultCode["authorised"] = "Authorised";
/** The payment was cancelled (by either the shopper or your own system) before processing was completed. */
ResultCode["cancelled"] = "Cancelled";
/** The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. */
ResultCode["challengeShopper"] = "ChallengeShopper";
/** There was an error when the payment was being processed. You'll receive a refusalReason in the same response, indicating the cause of the error. */
ResultCode["error"] = "Error";
/** The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. */
ResultCode["identifyShopper"] = "IdentifyShopper";
/** It's not possible to obtain the final status of the payment at this time. This is common for payments with an asynchronous flow, such as Boleto or iDEAL. */
ResultCode["pending"] = "Pending";
/** Present the voucher or the QR code to the shopper. */
ResultCode["presentToShopper"] = "PresentToShopper";
/** This is part of the standard payment flow for methods such as SEPA Direct Debit, where it can take some time before the final status of the payment is known. */
ResultCode["received"] = "Received";
/** The shopper needs to be redirected to an external web page or app to complete the payment. */
ResultCode["redirectShopper"] = "RedirectShopper";
/** The payment was refused. You'll receive a `refusalReason` in the same response that indicates why it was refused. */
ResultCode["refused"] = "Refused";
return ResultCode;
}({});
//# sourceMappingURL=constants.js.map