UNPKG

@bebapps/rapyd-sdk

Version:

An un-official [Rapyd](https://rapyd.net) SDK for Node.js.

251 lines (250 loc) 20.5 kB
export enum PaymentError { /** * The request tried to create a payment with a card that requires 3DS authentication, but the authentication failed. The request was rejected. Corrective action: Try the request again. If the error persists, assess the security risk. */ ERROR_3DS_AUTHENTICATION_FAILURE = 'ERROR_3DS_AUTHENTICATION_FAILURE', /** * The request tried to create a payment that requires 3DS verification, but the specified payment method does not support 3DS verification. The request was rejected. Corrective action: Omit the '3d_required' field under 'payment_method_options', change the value of the '3d_required' payment method option to false, or use a payment method that supports 3DS verification. */ ERROR_3DS_VERIFICATION_IS_NOT_SUPPORTED = 'ERROR_3DS_VERIFICATION_IS_NOT_SUPPORTED', /** * The request tried to create a card authorization, but authorization without capture is not supported for the selected payment method type. The request was rejected. Corrective action: Use a payment method type that supports authorization-only transactions. */ ERROR_AUTH_ONLY_IS_NOT_SUPPORTED = 'ERROR_AUTH_ONLY_IS_NOT_SUPPORTED', /** * The request tried to cancel a payment, but the operation failed. Corrective action: Check all input fields, and verify that the payment exists and was not already closed. */ ERROR_CANCEL_PAYMENT = 'ERROR_CANCEL_PAYMENT', /** * The request tried to capture a payment, but the payment could not be found or there was an error in the input parameters. The request was rejected. Corrective action: Determine whether the payment was closed, and check all input parameters. */ ERROR_CAPTURE_PAYMENT = 'ERROR_CAPTURE_PAYMENT', /** * The request tried to capture a payment for an amount that exceeds the amount in the original authorization transaction. The request was rejected. Corrective action: Set ‘amount’ less than or equal to the original authorization amount. */ ERROR_CAPTURE_PAYMENT_AMOUNT_EXCEEDS_AUTHORIZATION_AMOUNT = 'ERROR_CAPTURE_PAYMENT_AMOUNT_EXCEEDS_AUTHORIZATION_AMOUNT', /** * The request tried to make a card payment with authorization only, but the selected payment method does not support it. The request was rejected. Corrective action: Set 'capture' to 'true' or use a different payment method. */ ERROR_CARD_PAYMENT_WITHOUT_CAPTURE_NOT_SUPPORTED = 'ERROR_CARD_PAYMENT_WITHOUT_CAPTURE_NOT_SUPPORTED', /** * The request attempted to validate a card, but the request also attempted to capture a payment. The request was rejected. Corrective action: Create a payment with a card payment method, set 'capture' to false, and set 'amount’ to 0. */ ERROR_CARD_VALIDATION_CAPTURE_TRUE = 'ERROR_CARD_VALIDATION_CAPTURE_TRUE', /** * The request attempted to validate a card as part of a group payment. The request was rejected. Corrective action: Create a payment with a card payment method, set ‘capture' to false, set 'amount’ to 0, and list only one payment in the 'payments' array. */ ERROR_CARD_VALIDATION_IN_GROUP_PAYMENT = 'ERROR_CARD_VALIDATION_IN_GROUP_PAYMENT', /** * The request attempted to validate a card as part of an escrow transaction. The request was rejected. Corrective action: Create a payment with a card payment method, set 'capture' to false, set 'amount’ to 0, and set 'escrow' to null. */ ERROR_CARD_VALIDATION_IN_PAYMENT_WITH_ESCROW = 'ERROR_CARD_VALIDATION_IN_PAYMENT_WITH_ESCROW', /** * The request attempted to validate a card, but the request also attempted to exchange currency. The request was rejected. Corrective action: Create a payment with a card payment method, set 'capture' to false, set 'amount’ to 0, and set 'requested_currency' to null. */ ERROR_CARD_VALIDATION_IN_PAYMENT_WITH_FX = 'ERROR_CARD_VALIDATION_IN_PAYMENT_WITH_FX', /** * The request attempted to validate a card as part of a split payment. The request was rejected. Corrective action: Create a payment with a card payment method, set 'capture' to false, set 'amount’ to 0, and list only one wallet in the 'ewallets' array. */ ERROR_CARD_VALIDATION_IN_SPLIT_PAYMENT = 'ERROR_CARD_VALIDATION_IN_SPLIT_PAYMENT', /** * The request tried to create a payment, but the payment method was not found. The request was rejected. Corrective action: Use the ID of the payment method in the 'payment_method' field. Alternatively, if the customer has a default payment method, you can use the ID of the customer in the 'customer' field. */ ERROR_CREATE_PAYMENT = 'ERROR_CREATE_PAYMENT', /** * The request tried to create a payment, but the amount was larger than what is allowed by the payment method. The request was rejected. Corrective action: Set 'amount' so that the amount is less than the 'max_amount' allowed for the currency in the payment method, as shown in the response to 'List Payment Methods by Country'. */ ERROR_CREATE_PAYMENT_AMOUNT_EXCEEDS_MAXIMUM = 'ERROR_CREATE_PAYMENT_AMOUNT_EXCEEDS_MAXIMUM', /** * The request tried to create a payment, but the amount was smaller than what is allowed by the payment method. The request was rejected. Corrective action: Set 'amount' so that the amount is greater than the 'min_amount' allowed for the currency in the payment method, as shown in the response to 'List Payment Methods by Country'. */ ERROR_CREATE_PAYMENT_AMOUNT_LESS_THAN_MINIMUM = 'ERROR_CREATE_PAYMENT_AMOUNT_LESS_THAN_MINIMUM', /** * The request tried to create a payment, but the 'category' of the payment method was not 'card' and 'capture' was set. For all non-card payment methods, 'capture' must be null. The request was rejected. Corrective action: Use a card payment method or set 'capture' to null. */ ERROR_CREATE_PAYMENT_CAPTURE_FOR_CARD_METHODS_ONLY = 'ERROR_CREATE_PAYMENT_CAPTURE_FOR_CARD_METHODS_ONLY', /** * The request tried to create a payment, but the method of capture could not be determined. The request was rejected. Corrective action: Set 'capture' to true or false. */ ERROR_CREATE_PAYMENT_CAPTURE_NOT_VALID = 'ERROR_CREATE_PAYMENT_CAPTURE_NOT_VALID', /** * The request tried to create a payment, but the complete payment URL was missing or not recognized. The request was rejected. Corrective action: Use a valid URL for 'complete_payment_url. */ ERROR_CREATE_PAYMENT_COMPLETE_PAYMENT_URL_NOT_VALID = 'ERROR_CREATE_PAYMENT_COMPLETE_PAYMENT_URL_NOT_VALID', /** * The request tried to create a payment, but the currency was not recognized or not supported by the payment method provided. The request was rejected. Corrective action: Choose a currency that is supported by the payment method, or choose a payment method that supports the currency. */ ERROR_CREATE_PAYMENT_CURRENCY_NOT_SUPPORTED = 'ERROR_CREATE_PAYMENT_CURRENCY_NOT_SUPPORTED', /** * The request tried to create a payment, but the error payment URL was missing or not recognized. The request was rejected. Corrective action: Use a valid URL for 'error_payment_url'. */ ERROR_CREATE_PAYMENT_ERROR_PAYMENT_URL_NOT_VALID = 'ERROR_CREATE_PAYMENT_ERROR_PAYMENT_URL_NOT_VALID', /** * The request tried to create a payment, but there were insufficient funds for the transaction. The request was rejected. Corrective action: None. Contact the customer. */ ERROR_CREATE_PAYMENT_INSUFFICIENT_FUNDS = 'ERROR_CREATE_PAYMENT_INSUFFICIENT_FUNDS', /** * The request tried to split a payment among several wallets according to percentage, but the percentage was out of range. The request was rejected. Corrective action: Set 'percentage' to a decimal number between 0 and 100, with up to 4 decimal places. */ ERROR_CREATE_PAYMENT_PERCENTAGE_MUST_BE_BETWEEN_0_AND_100 = 'ERROR_CREATE_PAYMENT_PERCENTAGE_MUST_BE_BETWEEN_0_AND_100', /** * The request tried to create a payment split among two or more wallets, but the allocation of funds was not recognized. The request was rejected. Corrective action: In the 'ewallets' array, indicate a 'percentage' for all wallets or an 'amount' for all wallets. */ ERROR_CREATE_PAYMENT_SPLIT_MISSING_AMOUNT_OR_PERCENTAGE = 'ERROR_CREATE_PAYMENT_SPLIT_MISSING_AMOUNT_OR_PERCENTAGE', /** * The request tried to make a payment, but it also tried to set a fee and the payment was not to a wallet. The request was rejected. Corrective action: For a payment that is not to a wallet, leave 'payment_fees' unset. */ ERROR_FEES_ONLY_ALLOWED_FOR_EWALLET_TRANSACTIONS = 'ERROR_FEES_ONLY_ALLOWED_FOR_EWALLET_TRANSACTIONS', /** * The request tried to create a payment, but it also tried to set a foreign exchange fee and the payment was not a foreign exchange transaction. The request was rejected. Corrective action: For a payment that does not require foreign exchange, leave 'fx_fee' unset. */ ERROR_FX_FEE_ONLY_ALLOWED_FOR_FX_TRANSACTIONS = 'ERROR_FX_FEE_ONLY_ALLOWED_FOR_FX_TRANSACTIONS', /** * The request tried to create a split payment, but the split was specified by both amount and percentage. The request was rejected. Corrective action: In the 'ewallets' array, indicate a 'percentage' for all wallets or an 'amount' for all wallets. */ ERROR_GET_AMOUNT_AND_PERCENTAGE = 'ERROR_GET_AMOUNT_AND_PERCENTAGE', /** * The request tried to retrieve a payment, but the payment was not found. The request was rejected. Corrective action: Use a valid payment ID. */ ERROR_GET_PAYMENT = 'ERROR_GET_PAYMENT', /** * The request tried to create a payment, but the method of calculating the FX fee was missing or incorrect. The request was rejected. Corrective action: In the 'fx_fee' object, set 'calc_type' to 'gross' or 'net'. */ ERROR_INVALID_FX_FEE_CALC_TYPE = 'ERROR_INVALID_FX_FEE_CALC_TYPE', /** * The request tried to create a payment, but the FX fee was equal to or larger than the amount of the payment. The request was rejected. Corrective action: In the 'fx_fee' object, set 'value' to a decimal number greater than 0 and less than 100. */ ERROR_INVALID_FX_FEE_VALUE = 'ERROR_INVALID_FX_FEE_VALUE', /** * The request tried to create a payment, but the total net fee was equal to or larger than the amount of the payment. The request was rejected. Corrective action: Set the transaction fee and the FX fee so that the total net fee is less than the amount of the payment. */ ERROR_INVALID_NET_FEES = 'ERROR_INVALID_NET_FEES', /** * The request tried to create a payment, but the method of calculating the transaction fee was missing or incorrect. The request was rejected. Corrective action: In the 'transaction_fee' object, set 'calc_type' to 'gross' or 'net'. */ ERROR_INVALID_TRANSACTION_FEE_CALC_TYPE = 'ERROR_INVALID_TRANSACTION_FEE_CALC_TYPE', /** * The request tried to create a payment, but the fee type of the transaction fee was missing or incorrect. The request was rejected. Corrective action: In the 'transaction_fee' object, set 'fee_type' to 'percentage' or 'absolute'. */ ERROR_INVALID_TRANSACTION_FEE_FEE_TYPE = 'ERROR_INVALID_TRANSACTION_FEE_FEE_TYPE', /** * The request tried to create a payment, but the transaction fee was negative or was equal to or larger than the amount of the payment. The request was rejected. Corrective action: In the 'transaction_fee' object, set 'value' and 'fee_type' so that the fee is positive and less than the amount of the payment. */ ERROR_INVALID_TRANSACTION_FEE_VALUE = 'ERROR_INVALID_TRANSACTION_FEE_VALUE', /** * The request attempted an operation that requires a payment ID, but the value was not found. The request was rejected. Corrective action: Use the ID of a valid payment. */ ERROR_MISSING_PAYMENT_TOKEN = 'ERROR_MISSING_PAYMENT_TOKEN', /** * The request tried to create a payment, but the 'amount' parameter of a wallet was not valid. The request was rejected. Corrective action: Set the 'amount' field for each wallet to a positive number. */ ERROR_PAYMENT_AMOUNT_HAS_TO_BE_POSITIVE = 'ERROR_PAYMENT_AMOUNT_HAS_TO_BE_POSITIVE', /** * The request tried to cancel a payment, but the payment was already closed. The request was rejected. Corrective action: None. Determine why an attempt was made to cancel a closed payment. */ ERROR_PAYMENT_CAN_NOT_BE_CANCELED = 'ERROR_PAYMENT_CAN_NOT_BE_CANCELED', /** * The request tried to create a payment, but the ‘ewallet' parameter was not valid. The request was rejected. Corrective action: To indicate a payment to one wallet, set the 'ewallet' parameter to the ID of the wallet, which is a string starting with 'ewallet_’. To indicate a payment to several wallets, set the 'ewallet' parameter to an array of objects. */ ERROR_PAYMENT_EWALLET_NOT_AN_ARRAY_OR_STRING = 'ERROR_PAYMENT_EWALLET_NOT_AN_ARRAY_OR_STRING', /** * The request attempted an operation that requires the names of fields in the Payment object, but one of the field names was unknown. The request was rejected. Corrective action: In the 'payment_fields' object, use the names of fields that exist in the Payment object. */ ERROR_PAYMENT_FIELD_NAME_NOT_KNOWN = 'ERROR_PAYMENT_FIELD_NAME_NOT_KNOWN', /** * The request tried to make a payment together with currency exchange, but the payment method requires an expiration date, and no valid expiration was found in the request. The request was rejected. Corrective action: Provide a valid value for 'expiration'. */ ERROR_PAYMENT_FX_INVALID_EXPIRATION = 'ERROR_PAYMENT_FX_INVALID_EXPIRATION', /** * The request tried to create a payment, but the amount was not found or not recognized. The request was rejected. Corrective action: Set 'amount' to a positive decimal number. */ ERROR_PAYMENT_INVALID_AMOUNT = 'ERROR_PAYMENT_INVALID_AMOUNT', /** * The request tried to make a payment together with currency exchange, but the payment method does not support currency exchange. The request was rejected. Corrective action: Use a different payment method. */ ERROR_PAYMENT_METHOD_TYPE_DOES_NOT_SUPPORT_FX = 'ERROR_PAYMENT_METHOD_TYPE_DOES_NOT_SUPPORT_FX', /** * The request tried to cancel a payment, but the payment type cannot be canceled. The request was rejected. Corrective action: Use 'Create Refund'. */ ERROR_PAYMENT_METHOD_TYPE_DOES_NOT_SUPPORT_PAYMENT_CANCELLATION = 'ERROR_PAYMENT_METHOD_TYPE_DOES_NOT_SUPPORT_PAYMENT_CANCELLATION', /** * The request attempted an operation that requires a payment method ID, but the payment method was not associated with the customer specified in the request. The request was rejected. Corrective action: Use a payment method that is associated with the specified customer. */ ERROR_PAYMENT_METHODS_GET = 'ERROR_PAYMENT_METHODS_GET', /** * The request tried to create a payment split among two or more wallets, but the allocation of funds was not recognized. The request was rejected. Corrective action: In the 'ewallets' array, indicate a 'percentage' for all wallets or an 'amount' for all wallets. */ ERROR_PAYMENT_MORE_THAN_TWO_AMOUNT_OR_PERCENTAGE_ARE_MISSING = 'ERROR_PAYMENT_MORE_THAN_TWO_AMOUNT_OR_PERCENTAGE_ARE_MISSING', /** * The request attempted an operation that requires a payment ID, but the payment was not found. The request was rejected. Corrective action: Provide a valid payment ID. */ ERROR_PAYMENT_NOT_FOUND = 'ERROR_PAYMENT_NOT_FOUND', /** * The request tried to split a payment among several wallets, but there were too many wallets to process. The request was rejected. Corrective action: Split the payment among no more than 10 wallets. */ ERROR_PAYMENT_NUMBER_OF_EWALLETS_EXCEEDED = 'ERROR_PAYMENT_NUMBER_OF_EWALLETS_EXCEEDED', /** * The request tried to split a payment among several eWallets according to percentage, but the 'percentage' was out of range. The request was rejected. Corrective action: Set 'percentage' as a decimal number between 0 and 100, with up to 4 decimal places. */ ERROR_PAYMENT_PERCENT_MUST_BE_BETWEEN_0_TO_100 = 'ERROR_PAYMENT_PERCENT_MUST_BE_BETWEEN_0_TO_100', /** * The request tried to create a payment, but the 'percentage' parameter of a wallet was not valid. The request was rejected. Corrective action: For each wallet, set the 'percentage' field to a positive decimal number between 0 and 100, with up to 4 decimal places. */ ERROR_PAYMENT_PERCENTAGE_HAS_TO_BE_POSITIVE = 'ERROR_PAYMENT_PERCENTAGE_HAS_TO_BE_POSITIVE', /** * The request tried to split a payment among several wallets, but the combined wallet amounts exceed the total amount of the payment. The request was rejected. Corrective action: Set the 'amount' of the payment to be the same as the total amount of transfers to all wallets. */ ERROR_PAYMENT_SPLIT_AMOUNT_EXCEEDS_PAYMENT_AMOUNT = 'ERROR_PAYMENT_SPLIT_AMOUNT_EXCEEDS_PAYMENT_AMOUNT', /** * The request tried to split a payment, but there were too many wallets in the request. The request was rejected. Corrective action: In the 'ewallets' array, specify no more than 10 wallets. */ ERROR_PAYMENT_SPLIT_EXCEEDED_MAXIMUM_NUMBER_OF_EWALLETS = 'ERROR_PAYMENT_SPLIT_EXCEEDED_MAXIMUM_NUMBER_OF_EWALLETS', /** * The request tried to split a payment between two or more wallets, but one wallet appeared more than once in the request. The request was rejected. Corrective action: Combine all payments to one wallet into a single entry in the 'ewallets' list. */ ERROR_SPLIT_PAYMENT_DUPLICATE_EWALLET = 'ERROR_SPLIT_PAYMENT_DUPLICATE_EWALLET', /** * The request tried to create a payment, but the amount of the transaction fee was incorrect. The request was rejected. Corrective action: In the 'transaction_fee' object, set 'value' to a positive decimal number. */ ERROR_TRANSACTION_FEE_INVALID_AMOUNT = 'ERROR_TRANSACTION_FEE_INVALID_AMOUNT', /** * The request tried to update a payment, but the status of the payment does not allow updates. The request was rejected. Corrective action: None. Determine why an attempt was made to change the payment when the 'status' was not 'ACT'. */ ERROR_UPDATE_PAYMENT = 'ERROR_UPDATE_PAYMENT', /** * The request tried to update a payment, but the payment method could not be found, or the payment failed. The request was rejected. Corrective action: Check all input fields, and verify that the payment method exists. */ ERROR_USING_TOKEN = 'ERROR_USING_TOKEN', /** * The request tried to create a payment, but the 'idempotency' header was identical to that of another request made earlier. The request was rejected. Corrective action. Set 'idempotency' to a unique value. */ IDEMPOTENCY_ERROR = 'IDEMPOTENCY_ERROR', /** * The request tried to create a payment, but the 'complete_payment_url' parameter was not valid. The request was rejected. Corrective action: Use the correct URL. */ INVALID_COMPLETE_PAYMENT_URL = 'INVALID_COMPLETE_PAYMENT_URL', /** * The request tried to create a payment, but the 'error_payment_url' parameter was not valid. The request was rejected. Corrective action: Use the correct URL. */ INVALID_ERROR_PAYMENT_URL = 'INVALID_ERROR_PAYMENT_URL', /** * The request attempted an operation that requires a payment ID, but the payment was not found. The request was rejected. Corrective action: Use the ID of a valid payment. */ INVALID_PAYMENT = 'INVALID_PAYMENT', /** * The request tried to create a payment, but the initiation type was not recognized. The request was rejected. Corrective action: Set 'initiation_type' to one of the following values: 'customer_present', 'installment', 'moto', 'recurring', 'unscheduled'. */ ERROR_INVALID_PAYMENT_INITIATION_TYPE = 'ERROR_INVALID_PAYMENT_INITIATION_TYPE', /** * The request attempted an operation that requires a payment ID, but the payment was not found. The request was rejected. Corrective action: Use the ID of a valid payment. */ MISSING_PAYMENT = 'MISSING_PAYMENT', /** * The request tried to capture a payment, but the payment was previously closed. The request was rejected. Corrective action: None. Determine why capture was attempted for a closed payment. */ PAYMENT_CAPTURED_BEFORE = 'PAYMENT_CAPTURED_BEFORE', /** * The request tried to create or update a payment, but one of the fields in the 'payment_method' object was not recognized. The request was rejected. Corrective action: In the 'payment_method' object, submit a 'fields' object with documented fields only. */ UNKNOWN_PAYMENT_METHOD_FIELDS = 'UNKNOWN_PAYMENT_METHOD_FIELDS', };