@adyen/react-native
Version:
Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native
87 lines (83 loc) • 5.03 kB
text/typescript
/** Collection of events that components can trigger. */
export enum Event {
/** Event handler, called when the shopper selects the Pay button and payment details are valid. */
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. */
onAdditionalDetails = 'didProvideCallback',
/** Event handler, called when a shopper finishes the flow (Voucher payments only). */
onComplete = 'didCompleteCallback',
/** Event handler, called when payment about to be terminate. */
onError = 'didFailCallback',
/** Event handler, called when address update called. */
onAddressUpdate = 'didUpdateAddressCallback',
/** Event handler, called when address confirmed called. */
onAddressConfirm = 'didConfirmAddressCallback',
/** Event handler, called when shopper requests to remove stored payment method on DropIn Advanced flow. */
onDisableStoredPaymentMethod = 'didDisableStoredPaymentMethodCallback',
/** Event handler, called when balance for an order needs to be checked. */
onCheckBalance = `didCheckBalanceCallback`,
/** Event handler, called when a new order for a partial payment needs to be requested. */
onRequestOrder = `didRequestOrderCallback`,
/** Event handler, called when the partial payment order was canceled. */
onCancelOrder = `didCancelOrderCallback`,
/** Event handler, called when the BIN lookup data is available. */
onBinLookup = `didBinLookupCallback`,
/** Event handler, called when the BIN (first 6 or 8 PAN digits) typed by the shopper in the PAN field changes. */
onBinValue = `didChangeBinValueCallback`,
}
/** Collection of errors components can throw. */
export enum ErrorCode {
/** Payment was canceled by shopper. */
canceled = 'canceledByShopper',
/** Payment method not supported on current platform. */
notSupported = 'notSupported',
/** Missing or invalid clientKey in configuration. */
noClientKey = 'noClientKey',
/** Missing or invalid amount or country code in configuration. */
noPayment = 'noPayment',
/** Can not parse paymentMethods or the list is empty. */
invalidPaymentMethods = 'invalidPaymentMethods',
/** Can not parse action. */
invalidAction = 'invalidAction',
/** This component does not support action handling. */
notSupportedAction = 'notSupportedAction',
/** Can not find selected payment method type in provided list. */
noPaymentMethod = 'noPaymentMethod',
/** Session failed to be created. */
sessionError = 'sessionError',
}
/** Collection of available result codes that represent payments current state, as well as any actions you should take. */
export enum ResultCode {
/** The payment has been successfully authenticated with 3D Secure. */
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. */
authenticationNotRequired = 'AuthenticationNotRequired',
/** The payment was successfully authorised. */
authorised = 'Authorised',
/** The payment was cancelled (by either the shopper or your own system) before processing was completed. */
cancelled = 'Cancelled',
/** The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. */
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. */
error = 'Error',
/** The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. */
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. */
pending = 'Pending',
/** Present the voucher or the QR code to the shopper. */
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. */
received = 'Received',
/** The shopper needs to be redirected to an external web page or app to complete the payment. */
redirectShopper = 'RedirectShopper',
/** The payment was refused. You'll receive a `refusalReason` in the same response that indicates why it was refused. */
refused = 'Refused',
}
export enum BalanceResultCode {
/** Indicates that the balance check was successful. */
success = 'Success',
/** Indicates that the balance check failed. */
failed = 'Failed',
/** Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. */
notEnoughBalance = 'NotEnoughBalance',
}