Stripe 中的非英文文本可能吗?

Posted

技术标签:

【中文标题】Stripe 中的非英文文本可能吗?【英文标题】:Non-English texts in Stripe possible? 【发布时间】:2014-06-19 16:29:07 【问题描述】:

成功地将 Stripe 集成到我的在线商店中,我完全无法获得有关是否/如何配置 Stripe 以返回德语而不是英语的错误消息的信息。

所以我的问题是:

在使用客户端 API“https://js.stripe.com/v2”时,有没有办法获得本地化的错误消息?

2014-05-03 更新

我在 Twitter 和他们的一位员工(我猜)told me that this is currently not possible 以及他们的 TODO 列表上提出了同样的问题。

【问题讨论】:

7 年后呢?仍在 TODO 列表中,但未决?需要西班牙语。 【参考方案1】:

进一步参考:

虽然您不能使用人工提示的条带错误消息直接显示在本地化页面上,但您可以利用 response.error.code 提供您自己的翻译。

    var errorMessages = 
      incorrect_number: "The card number is incorrect.",
      invalid_number: "The card number is not a valid credit card number.",
      invalid_expiry_month: "The card's expiration month is invalid.",
      invalid_expiry_year: "The card's expiration year is invalid.",
      invalid_cvc: "The card's security code is invalid.",
      expired_card: "The card has expired.",
      incorrect_cvc: "The card's security code is incorrect.",
      incorrect_zip: "The card's zip code failed validation.",
      card_declined: "The card was declined.",
      missing: "There is no card on a customer that is being charged.",
      processing_error: "An error occurred while processing the card.",
      rate_limit:  "An error occurred due to requests hitting the API too quickly. Please let us know if you're consistently running into this error."
    ;


    function stripeHandler( status, response )
      if ( response.error && response.error.type == 'card_error' )
        $( '.errors' ).text( errorMessages[ response.error.code ] );
      

      else 
        // do other stuff (and handle api/request errors)
      
    

代码列表is documented here(当前位于“代码”部分的右栏)。

【讨论】:

很好的答案! :) 给出的链接不再是 JS SDK 返回的错误列表。如果有人有链接,请分享。 @AdrianLynch 将链接更新为stripe.com/docs/error-codes【参考方案2】:

目前,在初始化 Stripe 时,您可以传递 locale 参数

我可以提供更多细节,但它会太多,文档说明了一切:

用于在 Stripe 中全局配置本地化的语言环境。在此处设置语言环境将本地化所有 Stripe.js 方法的错误字符串。它还将为 Elements 和 Checkout 配置语言环境。默认为自动(Stripe 检测浏览器的区域设置)。请注意,Checkout 支持的区域设置与 Stripe.js 略有不同。

https://stripe.com/docs/js/initializing#init_stripe_js-options-locale

【讨论】:

【参考方案3】:

在英语和西班牙语的 javascript 中条带错误代码:

module.exports = 
  en: 
    authentication_required: 'The card was declined as the transaction requires authentication.',
    approve_with_id: 'The payment cannot be authorized.',
    call_issuer: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    card_not_supported: 'The card does not support this type of purchase. Please contact your card issuer for more information.',
    card_velocity_exceeded: 'The customer has exceeded the balance or credit limit available on their card. Please contact your card issuer for more information.',
    currency_not_supported: 'The card does not support the specified currency.',
    do_not_honor: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    do_not_try_again: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    duplicate_transaction: 'A transaction with identical amount and credit card information was submitted very recently.',
    expired_card: 'The card has expired.',
    fraudulent: 'The payment has been declined as Stripe suspects it is fraudulent.',
    generic_decline: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    incorrect_number: 'The card number is incorrect.',
    incorrect_cvc: 'The CVC number is incorrect.',
    incorrect_pin: 'The PIN entered is incorrect. This decline code only applies to payments made with a card reader.',
    incorrect_zip: 'The ZIP/postal code is incorrect.',
    insufficient_funds: 'The card has insufficient funds to complete the purchase.',
    invalid_account: 'The card, or account the card is connected to, is invalid.',
    invalid_amount: 'The payment amount is invalid, or exceeds the amount that is allowed.',
    invalid_cvc: 'The CVC number is incorrect.',
    invalid_expiry_month: 'The expiration month is invalid.',
    invalid_expiry_year: 'The expiration year is invalid.',
    invalid_number: 'The card number is incorrect.',
    invalid_pin: 'The PIN entered is incorrect. This decline code only applies to payments made with a card reader.',
    issuer_not_available: 'The card issuer could not be reached, so the payment could not be authorized.',
    lost_card: 'The payment has been declined because the card is reported lost.',
    merchant_blacklist: 'The payment has been declined because it matches a value on the Stripe user’s block list.',
    new_account_information_available: 'The card, or account the card is connected to, is invalid. Please contact your card issuer for more information.',
    no_action_taken: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    not_permitted: 'The payment is not permitted. Please contact your card issuer for more information.',
    offline_pin_required: 'The card has been declined as it requires a PIN.',
    online_or_offline_pin_required: 'The card has been declined as it requires a PIN.',
    pickup_card: 'The card cannot be used to make this payment (it is possible it has been reported lost or stolen). Please contact your card issuer for more information.',
    pin_try_exceeded: 'The allowable number of PIN tries has been exceeded.',
    processing_error: 'An error occurred while processing the card.',
    reenter_transaction: 'The payment could not be processed by the issuer for an unknown reason.',
    restricted_card: 'The card cannot be used to make this payment (it is possible it has been reported lost or stolen). Please contact your card issuer for more information.',
    revocation_of_all_authorizations: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    revocation_of_authorization: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    security_violation: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    service_not_allowed: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    stolen_card: 'The payment has been declined because the card is reported stolen.',
    stop_payment_order: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    testmode_decline: 'A Stripe test card number was used.',
    transaction_not_allowed: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    try_again_later: 'The card has been declined for an unknown reason. Please contact your card issuer for more information.',
    withdrawal_count_limit_exceeded: 'The customer has exceeded the balance or credit limit available on their card.',
  ,
  es: 
    authentication_required: 'La tarjeta ha sido rechazada porque la transacción requiere autentificación.',
    approve_with_id: 'El pago no se puede autorizar.',
    call_issuer: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    card_not_supported: 'La tarjeta no soporta este tipo de compra.',
    card_velocity_exceeded: 'El comprador ha excedido el balance o límite de crédito disponible en su tarjeta. Contacte con el emisor de la tarjeta para más información.',
    currency_not_supported: 'La tarjeta no soporta la divisa especificada.',
    do_not_honor: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    do_not_try_again: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    duplicate_transaction: 'Una transacción con importe y tarjeta idénticas fue procesada muy recientemente.',
    expired_card: 'La tarjeta ha expirado.',
    fraudulent: 'El pago ha sido rechazado ya que Stripe sospecha que es fraudulento.',
    generic_decline: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    incorrect_number: 'El número de la tarjeta es incorrecto.',
    incorrect_cvc: 'El numero CVC es incorrecto.',
    incorrect_pin: 'El PIN introducido es incorrecto.',
    incorrect_zip: 'El código postal es incorrecto.',
    insufficient_funds: 'La tarjeta no tiene fondos suficientes para completar la compra.',
    invalid_account: 'La tarjeta, o la cuenta a la que está asociada, es inválida.',
    invalid_amount: 'El importe es inválido, o excede el permitido.',
    invalid_cvc: 'El número CVC es incorrecto.',
    invalid_expiry_month: 'El mes de caducidad es inválido.',
    invalid_expiry_year: 'El año de caducidad es inválido.',
    invalid_number: 'El número de tarjeta es incorrecto.',
    invalid_pin: 'El PIN introducido es incorrecto.',
    issuer_not_available: 'El emisor de la tarjeta no pudo ser contactado, por lo que el pago no ha podido ser autorizado.',
    lost_card: 'El pago ha sido rechazado porque la tarjeta ha sido denunciada como perdida.',
    merchant_blacklist: 'El pago ha sido rechazado porque coincide con un valor de la lista de bloqueo de Stripe.',
    new_account_information_available: 'La tarjeta, o cuenta la que está asociada, es inválida. Contacte con el emisor de la tarjeta para más información.',
    no_action_taken: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    not_permitted: 'El pago no está permitido. Contacte con el emisor de la tarjeta para más información.',
    offline_pin_required: 'La tarjeta ha sido rechazada ya que requiere un PIN.',
    online_or_offline_pin_required: 'La tarjeta ha sido rechazada ya que requiere un PIN.',
    pickup_card: 'La tarjeta no se puede usar para realizar este pago (posiblemente haya sido denunciada como robada). Contacte con el emisor de la tarjeta para más información.',
    pin_try_exceeded: 'Se ha excedido el número máximo de intentos de introducción del PIN.',
    processing_error: 'Ocurrió un error al procesar la tarjeta.',
    reenter_transaction: 'El pago no pudo ser procesado por el emisor por una razón desconocida.',
    restricted_card: 'La tarjeta no se puede usar para realizar este pago (posiblemente haya sido denunciada como perdida o robada). Contacte con el emisor de la tarjeta para más información.',
    revocation_of_all_authorizations: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    revocation_of_authorization: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    security_violation: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    service_not_allowed: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    stolen_card: 'El pago ha sido rechazado porque la tarjeta ha sido denunciada como robada.',
    stop_payment_order: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    testmode_decline: 'Se ha usado una tarjeta de prueba de Stripe.',
    transaction_not_allowed: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    try_again_later: 'La tarjeta ha sido rechazada por una razón desconocida. Contacte con el emisor de la tarjeta para más información.',
    withdrawal_count_limit_exceeded: 'El comprador ha excedido el balance o límite de crédito disponible en su tarjeta.',
  ,
;

【讨论】:

【参考方案4】:

如果您正在寻找拒绝错误的法语翻译:

export default 
  authentication_required:
    'La carte a été refusée car la transaction nécessite une authentification.',
  approve_with_id: 'Le paiement ne peut être autorisé.',
  call_issuer:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  card_not_supported: "La carte ne prend pas en charge ce type d'achat.",
  card_velocity_exceeded:
    'Le solde ou la limite de crédit disponible sur la carte a été dépassé.',
  currency_not_supported:
    'La carte ne prend pas en charge la devise spécifiée.',
  do_not_honor:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  do_not_try_again:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  duplicate_transaction:
    'Une transaction avec un montant et des informations de carte de crédit identiques a été soumise très récemment.',
  expired_card:
    "La carte est expirée. Vérifiez la date d'expiration ou utilisez une autre carte.",
  fraudulent:
    "Le paiement a été refusé car Stripe le soupçonne d'être frauduleux.",
  generic_decline: 'La carte a été refusée pour une raison inconnue.',
  incorrect_number:
    'Le numéro de carte est incorrect. Vérifiez le numéro de la carte ou utilisez une autre carte.',
  incorrect_cvc:
    'Le code de sécurité de la carte est incorrect. Vérifiez le code de sécurité de la carte ou utilisez une autre carte.',
  incorrect_zip:
    'Le code postal de la carte est incorrect. Vérifiez le code postal de la carte ou utilisez une autre carte.',
  insufficient_funds:
    "La carte ne dispose pas de fonds suffisants pour finaliser l'achat.",
  invalid_account:
    "La carte ou le compte auquel la carte est connectée n'est pas valide.",
  invalid_amount:
    "Le montant du paiement n'est pas valide ou dépasse le montant autorisé.",
  invalid_cvc:
    'Le code de sécurité de la carte n’est pas valide. Vérifiez le code de sécurité de la carte ou utilisez une autre carte.',
  invalid_expiry_month:
    "Le mois d'expiration de la carte est incorrect. Vérifiez la date d'expiration ou utilisez une autre carte.",
  invalid_expiry_year:
    "L’année d’expiration de la carte est incorrecte. Vérifiez la date d'expiration ou utilisez une autre carte.",
  invalid_number:
    "Le numéro de carte n'est pas valide. Vérifiez les détails de la carte ou utilisez une autre carte.",
  issuer_not_available:
    "L'émetteur de la carte n'a pas pu être joint, le paiement n'a donc pas pu être autorisé.",
  lost_card: 'Le paiement a été refusé car la carte est déclarée perdue.',
  merchant_blacklist:
    'Le paiement a été refusé, car la carte est bloquée par Stripe.',
  new_account_information_available:
    "La carte ou le compte auquel la carte est connectée n'est pas valide.",
  no_action_taken:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  not_permitted: "Le paiement n'est pas autorisé.",
  pickup_card:
    "La carte ne peut pas être utilisée pour effectuer ce paiement (il est possible qu'elle ait été déclarée perdue ou volée).",
  processing_error:
    "Une erreur s'est produite lors du traitement de la carte. Vérifiez que les détails de la carte sont corrects ou utilisez une autre carte.",
  reenter_transaction:
    "Le paiement n'a pas pu être traité par l'émetteur pour une raison inconnue.",
  restricted_card:
    "La carte ne peut pas être utilisée pour effectuer ce paiement (il est possible qu'elle ait été déclarée perdue ou volée).",
  revocation_of_all_authorizations:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  revocation_of_authorization:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  security_violation:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  service_not_allowed:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  stolen_card: 'Le paiement a été refusé car la carte est déclarée volée.',
  stop_payment_order:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  testmode_decline: 'Un numéro de carte de test Stripe a été utilisé.',
  transaction_not_allowed:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  try_again_later:
    "La carte a été refusée pour une raison inconnue. Contactez votre banque pour plus d'information.",
  withdrawal_count_limit_exceeded:
    'Le solde ou la limite de crédit disponible sur la carte a été dépassé.'

【讨论】:

【参考方案5】:

php 调整错误消息。 完整的这里有法语翻译https://gist.github.com/Ladinstar/4655e57bd25099c553956280270b3c83

<?php
  // English errors
  $errors = [
      "account_already_exists" => "The email address provided for the creation of a deferred account already has an account associated with it. Use the OAuth flow to connect the existing account to your platform.",
      "account_country_invalid_address" => "The country of the business address provided does not match the country of the account. Businesses must be located in the same country as the account.",
      "account_invalid" => "The account ID provided as a value for the Stripe-Account header is invalid. Check that your requests are specifying a valid account ID.",
      "account_number_invalid" => "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide.",
      "alipay_upgrade_required" => "This method for creating Alipay payments is not supported anymore. Please upgrade your integration to use Sources instead.",
      "amount_too_large" => "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again.",
      "amount_too_small" => "The specified amount is less than the minimum amount allowed. Use a higher amount and try again.",
      "api_key_expired" => "The API key provided has expired. Obtain your current API keys from the Dashboard and update your integration to use them.",
      "balance_insufficient" => "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account’s available balance.",
      "bank_account_exists" => "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again.",
      "bank_account_unusable" => "The bank account provided cannot be used for payouts. A different bank account must be used.",
      "bank_account_unverified" => "Your Connect platform is attempting to share an unverified bank account with a connected account.",
      "bitcoin_upgrade_required" => "This method for creating Bitcoin payments is not supported anymore. Please upgrade your integration to use Sources instead.",
      "card_declined" => "The card has been declined. When a card is declined, the error returned also includes the decline_code attribute with the reason why the card was declined. Refer to our decline codes documentation to learn more.",
      "charge_already_captured" => "The charge you’re attempting to capture has already been captured. Update the request with an uncaptured charge ID.",
      "charge_already_refunded" => "The charge you’re attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded.",
      "charge_disputed" => "The charge you’re attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute.",
      "charge_exceeds_source_limit" => "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit.",
      "charge_expired_for_capture" => "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days.",
      "country_unsupported" => "Your platform attempted to create a custom account in a country that is not yet supported. Make sure that users can only sign up in countries supported by custom accounts.",
      "coupon_expired" => "The coupon provided for a subscription or order has expired. Either create a new coupon, or use an existing one that is valid.",
      "customer_max_subscriptions" => "The maximum number of subscriptions for a customer has been reached. Contact us if you are receiving this error.",
      "email_invalid" => "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters.",
      "expired_card" => "The card has expired. Check the expiration date or use a different card.",
      "idempotency_key_in_use" => "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.",
      "incorrect_address" => "The card’s address is incorrect. Check the card’s address or use a different card.",
      "incorrect_cvc" => "The card’s security code is incorrect. Check the card’s security code or use a different card.",
      "incorrect_number" => "The card number is incorrect. Check the card’s number or use a different card.",
      "incorrect_zip" => "The card’s postal code is incorrect. Check the card’s postal code or use a different card.",
      "instant_payouts_unsupported" => "The debit card provided as an external account does not support instant payouts. Provide another debit card or use a bank account instead.",
      "invalid_card_type" => "The card provided as an external account is not a debit card. Provide a debit card or use a bank account instead.",
      "invalid_charge_amount" => "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount.",
      "invalid_cvc" => "The card’s security code is invalid. Check the card’s security code or use a different card.",
      "invalid_expiry_month" => "The card’s expiration month is incorrect. Check the expiration date or use a different card.",
      "invalid_expiry_year" => "The card’s expiration year is incorrect. Check the expiration date or use a different card.",
      "invalid_number" => "The card number is invalid. Check the card details or use a different card.",
      "invalid_source_usage" => "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use.",
      "invoice_no_customer_line_items" => "An invoice cannot be generated for the specified customer as there are no pending invoice items. Check that the correct customer is being specified or create any necessary invoice items first.",
      "invoice_no_subscription_line_items" => "An invoice cannot be generated for the specified subscription as there are no pending invoice items. Check that the correct subscription is being specified or create any necessary invoice items first.",
      "invoice_not_editable" => "The specified invoice can no longer be edited. Instead, consider creating additional invoice items that will be applied to the next invoice. You can either manually generate the next invoice or wait for it to be automatically generated at the end of the billing cycle.",
      "invoice_upcoming_none" => "There is no upcoming invoice on the specified customer to preview. Only customers with active subscriptions or pending invoice items have invoices that can be previewed.",
      "livemode_mismatch" => "Test and live mode API keys, requests, and objects are only available within the mode they are in.",
      "missing" => "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details.",
      "not_allowed_on_standard_account" => "Transfers and payouts on behalf of a Standard connected account are not allowed.",
      "order_creation_failed" => "The order could not be created. Check the order details and then try again.",
      "order_required_settings" => "The order could not be processed as it is missing required information. Check the information provided and try again.",
      "order_status_invalid" => "The order cannot be updated because the status provided is either invalid or does not follow the order lifecycle (e.g., an order cannot transition from created to fulfilled without first transitioning to paid).",
      "order_upstream_timeout" => "The request timed out. Try again later.",
      "out_of_inventory" => "The SKU is out of stock. If more stock is available, update the SKU’s inventory quantity and try again.",
      "parameter_invalid_empty" => "One or more required values were not provided. Make sure requests include all required parameters.",
      "parameter_invalid_integer" => "One or more of the parameters requires an integer, but the values provided were a different type. Make sure that only supported values are provided for each attribute. Refer to our API documentation to look up the type of data each attribute supports.",
      "parameter_invalid_string_blank" => "One or more values provided only included whitespace. Check the values in your request and update any that contain only whitespace.",
      "parameter_invalid_string_empty" => "One or more required string values is empty. Make sure that string values contain at least one character.",
      "parameter_missing" => "One or more required values are missing. Check our API documentation to see which values are required to create or modify the specified resource.",
      "parameter_unknown" => "The request contains one or more unexpected parameters. Remove these and try again.",
      "parameters_exclusive" => "Two or more mutually exclusive parameters were provided. Check our API documentation or the returned error message to see which values are permitted when creating or modifying the specified resource.",
      "payment_intent_authentication_failure" => "The provided source has failed authentication. Provide source_data or a new source to attempt to fulfill this PaymentIntent again.",
      "payment_intent_incompatible_payment_method" => "The PaymentIntent expected a payment method with different properties than what was provided.",
      "payment_intent_invalid_parameter" => "One or more provided parameters was not allowed for the given operation on the PaymentIntent. Check our API reference or the returned error message to see which values were not correct for that PaymentIntent.",
      "payment_intent_payment_attempt_failed" => "The latest payment attempt for the PaymentIntent has failed. Check the last_payment_error property on the PaymentIntent for more details, and provide source_data or a new source to attempt to fulfill this PaymentIntent again.",
      "payment_intent_unexpected_state" => "The PaymentIntent’s state was incompatible with the operation you were trying to perform.",
      "payment_method_unactivated" => "The charge cannot be created as the payment method used has not been activated. Activate the payment method in the Dashboard, then try again.",
      "payment_method_unexpected_state" => "The provided payment method’s state was incompatible with the operation you were trying to perform. Confirm that the payment method is in an allowed state for the given operation before attempting to perform it.",
      "payouts_not_allowed" => "Payouts have been disabled on the connected account. Check the connected account’s status to see if any additional information needs to be provided, or if payouts have been disabled for another reason.",
      "platform_api_key_expired" => "The API key provided by your Connect platform has expired. This occurs if your platform has either generated a new key or the connected account has been disconnected from the platform. Obtain your current API keys from the Dashboard and update your integration, or reach out to the user and reconnect the account.",
      "postal_code_invalid" => "The postal code provided was incorrect.",
      "processing_error" => "An error occurred while processing the card. Check the card details are correct or use a different card.",
      "product_inactive" => "The product this SKU belongs to is no longer available for purchase.",
      "rate_limit" => "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.",
      "resource_already_exists" => "A resource with a user-specified ID (e.g., plan or coupon) already exists. Use a different, unique value for id and try again.",
      "resource_missing" => "The ID provided is not valid. Either the resource does not exist, or an ID for a different resource has been provided.",
      "routing_number_invalid" => "The bank routing number provided is invalid.",
      "secret_key_required" => "The API key provided is a publishable key, but a secret key is required. Obtain your current API keys from the Dashboard and update your integration to use them.",
      "sepa_unsupported_account" => "Your account does not support SEPA payments.",
      "shipping_calculation_failed" => "Shipping calculation failed as the information provided was either incorrect or could not be verified.",
      "sku_inactive" => "The SKU is inactive and no longer available for purchase. Use a different SKU, or make the current SKU active again.",
      "state_unsupported" => "Occurs when providing the legal_entity information for a U.S. custom account, if the provided state is not supported. (This is mostly associated states and territories.)",
      "tax_id_invalid" => "The tax ID number provided is invalid (e.g., missing digits). Tax ID information varies from country to country, but must be at least nine digits.",
      "taxes_calculation_failed" => "Tax calculation for the order failed.",
      "testmode_charges_only" => "Your account has not been activated and can only make test charges. Activate your account in the Dashboard to begin processing live charges.",
      "tls_version_unsupported" => "Your integration is using an older version of TLS that is unsupported. You must be using TLS 1.2 or above.",
      "token_already_used" => "The token provided has already been used. You must create a new token before you can retry this request.",
      "token_in_use" => "The token provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.",
      "transfers_not_allowed" => "The requested transfer cannot be created. Contact us if you are receiving this error.",
      "upstream_order_creation_failed" => "The order could not be created. Check the order details and then try again.",
      "url_invalid" => "The URL provided is invalid.",
  ];

【讨论】:

【参考方案6】:

法语中的条纹错误消息

var online_payment_error_codes = account_already_exists: "L'adresse e-mail fournie pour la création d'un compte différé est déjà associée à un compte. Utilisez le flux OAuth pour connecter le compte existant à votre plateforme.",
    account_country_invalid_address: " Le pays de l'adresse professionnelle fournie ne correspond pas au pays du compte. Les entreprises doivent être situées dans le même pays que le compte.",
    account_invalid: " L'ID de compte fourni comme valeur pour l'en-tête Stripe-Account n'est pas valide. Vérifiez que vos demandes spécifient un identifiant de compte valide.",
    account_number_invalid: " Le numéro de compte bancaire fourni n'est pas valide (par exemple, des chiffres manquants). Les informations de compte bancaire varient d'un pays à l'autre. Nous vous recommandons de créer des validations dans vos formulaires de saisie en fonction des formats de compte bancaire que nous fournissons.",
    alipay_upgrade_required: " Cette méthode de création de paiements Alipay n'est plus prise en charge. Veuillez mettre à niveau votre intégration pour utiliser des sources à la place.",
    amount_too_large: " Le montant spécifié est supérieur au montant maximum autorisé. Utilisez une quantité inférieure et réessayez.",
    amount_too_small: " Le montant spécifié est inférieur au montant minimum autorisé. Utilisez une quantité plus élevée et réessayez.",
    api_key_expired: " La clé API fournie a expiré. Obtenez vos clés API actuelles à partir du tableau de bord et mettez à jour votre intégration pour les utiliser.",
    balance_insufficient: " Le transfert ou le paiement n'a pas pu être effectué car le compte associé ne dispose pas d'un solde disponible suffisant. Créez un nouveau virement ou paiement en utilisant un montant inférieur ou égal au solde disponible du compte.",
    bank_account_exists: " Le compte bancaire fourni existe déjà sur l'objet Client spécifié. Si le compte bancaire doit également être associé à un autre client, indiquez le bon numéro de client lors de la nouvelle demande.",
    bank_account_unusable: " Le compte bancaire fourni ne peut pas être utilisé pour les paiements. Un autre compte bancaire doit être utilisé.",
    bank_account_unverified: " Votre plateforme Connect tente de partager un compte bancaire non vérifié avec un compte connecté.",
    bitcoin_upgrade_required: " Cette méthode de création de paiements Bitcoin n'est plus prise en charge. Veuillez mettre à niveau votre intégration pour utiliser des sources à la place.",
    card_declined: " La carte a été refusée. Lorsqu'une carte est refusée, l'erreur renvoyée inclut également l'attribut déclin_code avec la raison pour laquelle la carte a été refusée. Consultez notre documentation sur les codes de refus pour en savoir plus.",
    charge_already_captured: " La charge que vous essayez de capturer a déjà été capturée. Mettez à jour la demande avec un ID de facturation non capturé.",
    charge_already_refunded: " Les frais que vous essayez de rembourser ont déjà été remboursés. Mettez à jour la demande d'utilisation de l'ID d'une charge qui n'a pas été remboursée.",
    charge_disputed: " Les frais que vous essayez de rembourser ont été remboursés. Consultez la documentation relative aux litiges pour savoir comment réagir au litige.",
    charge_exceeds_source_limit: " Ces frais vous amèneraient à dépasser votre limite de traitement de la fenêtre glissante pour ce type de source. Veuillez réessayer les frais plus tard ou contactez-nous pour demander une limite de traitement plus élevée.",
    charge_expired_for_capture: " La charge ne peut pas être capturée car l'autorisation a expiré. Les frais d'authentification et de capture doivent être saisis dans les sept jours.",
    country_unsupported: " Votre plate-forme a tenté de créer un compte personnalisé dans un pays qui n'est pas encore pris en charge. Assurez-vous que les utilisateurs ne peuvent s'inscrire que dans les pays pris en charge par des comptes personnalisés.",
    coupon_expired: " Le coupon fourni pour un abonnement ou une commande a expiré. Créez un nouveau coupon ou utilisez-en un existant valide.",
    customer_max_subscriptions: " Le nombre maximum d'abonnements pour un client a été atteint. Contactez-nous si vous recevez cette erreur.",
    email_invalid: " L'adresse e-mail n'est pas valide (par exemple, n'est pas correctement formatée). Vérifiez que l'adresse e-mail est correctement formatée et ne comprend que les caractères autorisés.",
    expired_card: " La carte a expiré. Vérifiez la date d'expiration ou utilisez une autre carte.",
    idempotency_key_in_use: " La clé d'idempotence fournie est actuellement utilisée dans une autre demande. Cela se produit si votre intégration effectue des demandes en double simultanément.",
    incorrect_address: " L’adresse de la carte est incorrecte. Vérifiez l’adresse de la carte ou utilisez une autre carte.",
    incorrect_cvc: " Le code de sécurité de la carte est incorrect. Vérifiez le code de sécurité de la carte ou utilisez une autre carte.",
    incorrect_number: " Le numéro de carte est incorrect. Vérifiez le numéro de la carte ou utilisez une autre carte.",
    incorrect_zip: " Le code postal de la carte est incorrect. Vérifiez le code postal de la carte ou utilisez une autre carte.",
    instant_payouts_unsupported: " La carte de débit fournie en tant que compte externe ne prend pas en charge les paiements instantanés. Fournissez une autre carte de débit ou utilisez un compte bancaire à la place.",
    invalid_card_type: " La carte fournie en tant que compte externe n'est pas une carte de débit. Fournissez une carte de débit ou utilisez plutôt un compte bancaire.",
    invalid_charge_amount: " Le montant spécifié n'est pas valide. Le montant des frais doit être un entier positif dans la plus petite unité monétaire et ne pas dépasser le montant minimum ou maximum.",
    invalid_cvc: " Le code de sécurité de la carte n’est pas valide. Vérifiez le code de sécurité de la carte ou utilisez une autre carte.",
    invalid_expiry_month: " Le mois d'expiration de la carte est incorrect. Vérifiez la date d'expiration ou utilisez une autre carte.",
    invalid_expiry_year: " L’année d’expiration de la carte est incorrecte. Vérifiez la date d'expiration ou utilisez une autre carte.",
    invalid_number: " Le numéro de carte n'est pas valide. Vérifiez les détails de la carte ou utilisez une autre carte.",
    invalid_source_usage: " La source ne peut pas être utilisée car elle n'est pas dans l'état correct (par exemple, une demande de facturation tente d'utiliser une source avec une source en attente, en échec ou consommée). Vérifiez l'état de la source que vous essayez d'utiliser.",
    invoice_no_customer_line_items: " Une facture ne peut pas être générée pour le client spécifié car il n'y a aucun poste de facture en attente. Vérifiez que le bon client est spécifié ou créez d'abord les éléments de facture nécessaires.",
    invoice_no_subscription_line_items: " Une facture ne peut pas être générée pour l'abonnement spécifié car il n'y a aucun élément de facture en attente. Vérifiez que l'abonnement correct est spécifié ou créez d'abord les éléments de facture nécessaires.",
    invoice_not_editable: " La facture spécifiée ne peut plus être modifiée. Au lieu de cela, envisagez de créer des éléments de facture supplémentaires qui seront appliqués à la prochaine facture. Vous pouvez soit générer manuellement la prochaine facture, soit attendre qu'elle soit générée automatiquement à la fin du cycle de facturation.",
    invoice_upcoming_none: " Il n'y a pas de facture à venir sur le client spécifié à prévisualiser. Seuls les clients avec des abonnements actifs ou des éléments de facture en attente ont des factures qui peuvent être prévisualisées.",
    livemode_mismatch: " Les clés d'API, les requêtes et les objets en mode test et en direct ne sont disponibles que dans le mode dans lequel ils se trouvent.",
    missing: " Un client et un identifiant source ont été fournis, mais la source n'a pas été enregistrée pour le client. Pour créer des frais pour un client avec une source spécifiée, vous devez d'abord enregistrer les détails de la carte.",
    not_allowed_on_standard_account: " Les transferts et paiements au nom d'un compte connecté Standard ne sont pas autorisés.",
    order_creation_failed: " La commande n'a pas pu être créée. Vérifiez les détails de la commande, puis réessayez.",
    order_required_settings: " La commande n'a pas pu être traitée car il manque les informations requises. Vérifiez les informations fournies et réessayez.",
    order_status_invalid: " La commande ne peut pas être mise à jour car le statut fourni est soit invalide, soit ne suit pas le cycle de vie de la commande (par exemple, une commande ne peut pas passer de créée à exécutée sans passer d'abord à payée).",
    order_upstream_timeout: " La demande a expiré. Réessayez plus tard.",
    out_of_inventory: " Le SKU est en rupture de stock. Si plus de stock est disponible, mettez à jour la quantité d'inventaire du SKU et réessayez.",
    parameter_invalid_empty: " Une ou plusieurs valeurs obligatoires n'ont pas été fournies. Assurez-vous que les demandes incluent tous les paramètres requis.",
    parameter_invalid_integer: " Un ou plusieurs paramètres nécessitent un entier, mais les valeurs fournies étaient d'un type différent. Assurez-vous que seules les valeurs prises en charge sont fournies pour chaque attribut. Reportez-vous à notre documentation API pour rechercher le type de données pris en charge par chaque attribut.",
    parameter_invalid_string_blank: " Une ou plusieurs valeurs fournies incluaient uniquement des espaces. Vérifiez les valeurs de votre demande et mettez à jour celles qui ne contiennent que des espaces.",
    parameter_invalid_string_empty: " Une ou plusieurs valeurs de chaîne obligatoires sont vides. Assurez-vous que les valeurs de chaîne contiennent au moins un caractère.",
    parameter_missing: " Une ou plusieurs valeurs obligatoires sont manquantes. Consultez notre documentation API pour voir quelles valeurs sont requises pour créer ou modifier la ressource spécifiée.",
    parameter_unknown: " La demande contient un ou plusieurs paramètres inattendus. Supprimez-les et réessayez.",
    parameters_exclusive: " Au moins deux paramètres mutuellement exclusifs ont été fournis. Consultez notre documentation API ou le message d'erreur renvoyé pour voir quelles valeurs sont autorisées lors de la création ou de la modification de la ressource spécifiée.",
    payment_intent_authentication_failure: " L'authentification de la source fournie a échoué. Fournissez source_data ou une nouvelle source pour tenter de remplir à nouveau ce PaymentIntent.",
    payment_intent_incompatible_payment_method: " PaymentIntent s'attendait à un mode de paiement avec des propriétés différentes de celles fournies.",
    payment_intent_invalid_parameter: " Un ou plusieurs paramètres fournis n'étaient pas autorisés pour l'opération donnée sur PaymentIntent. Consultez notre référence API ou le message d'erreur renvoyé pour voir quelles valeurs n'étaient pas correctes pour ce PaymentIntent.",
    payment_intent_payment_attempt_failed: " La dernière tentative de paiement pour PaymentIntent a échoué. Vérifiez la propriété last_payment_error sur le PaymentIntent pour plus de détails, et indiquez source_data ou une nouvelle source pour tenter à nouveau de remplir ce PaymentIntent.",
    payment_intent_unexpected_state: " L'état de PaymentIntent était incompatible avec l'opération que vous tentiez d'effectuer.",
    payment_method_unactivated: " Les frais ne peuvent pas être créés car le mode de paiement utilisé n'a pas été activé. Activez le mode de paiement dans le tableau de bord, puis réessayez.",
    payment_method_unexpected_state: " L'état du mode de paiement fourni était incompatible avec l'opération que vous tentiez d'effectuer. Vérifiez que le mode de paiement est dans un état autorisé pour l'opération donnée avant de tenter de l'exécuter.",
    payouts_not_allowed: " Les paiements ont été désactivés sur le compte connecté. Vérifiez l'état du compte connecté pour voir si des informations supplémentaires doivent être fournies ou si les paiements ont été désactivés pour une autre raison.",
    platform_api_key_expired: " La clé API fournie par votre plateforme Connect a expiré. Cela se produit si votre plateforme a généré une nouvelle clé ou si le compte connecté a été déconnecté de la plateforme. Obtenez vos clés API actuelles à partir du tableau de bord et mettez à jour votre intégration, ou contactez l'utilisateur et reconnectez le compte.",
    postal_code_invalid: " Le code postal fourni était incorrect.",
    processing_error: " Une erreur s'est produite lors du traitement de la carte. Vérifiez que les détails de la carte sont corrects ou utilisez une autre carte.",
    product_inactive: " Le produit auquel ce SKU appartient n'est plus disponible à l'achat.",
    rate_limit: " Trop de demandes atteignent l'API trop rapidement. Nous recommandons un délai exponentiel de vos demandes.",
    resource_already_exists: " Une ressource avec un ID spécifié par l'utilisateur (par exemple, plan ou coupon) existe déjà. Utilisez une valeur différente et unique pour id et réessayez.",
    resource_missing: " L'identifiant fourni n'est pas valide. Soit la ressource n'existe pas, soit un ID pour une ressource différente a été fourni.",
    routing_number_invalid: " Le numéro d'acheminement bancaire fourni n'est pas valide.",
    secret_key_required: " La clé API fournie est une clé publiable, mais une clé secrète est requise. Obtenez vos clés API actuelles à partir du tableau de bord et mettez à jour votre intégration pour les utiliser.",
    sepa_unsupported_account: " Votre compte ne prend pas en charge les paiements SEPA.",
    shipping_calculation_failed: " Le calcul de l'expédition a échoué car les informations fournies étaient incorrectes ou n'ont pas pu être vérifiées.",
    sku_inactive: " Le SKU est inactif et n'est plus disponible à l'achat. Utilisez un SKU différent ou réactivez le SKU actuel.",
    state_unsupported: " Se produit lors de la fourniture des informations legal_entity pour un compte personnalisé américain, si l'état fourni n'est pas pris en charge. (Il s'agit principalement d'états et de territoires associés.)",
    tax_id_invalid: " Le numéro d'identification fiscale fourni n'est pas valide (par exemple, des chiffres manquants). Les informations d'identification fiscale varient d'un pays à l'autre, mais doivent comporter au moins neuf chiffres.",
    taxes_calculation_failed: " Le calcul de la taxe pour la commande a échoué.",
    testmode_charges_only: " Votre compte n'a pas été activé et ne peut effectuer que des frais de test. Activez votre compte dans le tableau de bord pour commencer à traiter les frais réels.",
    tls_version_unsupported: " Votre intégration utilise une ancienne version de TLS qui n'est pas prise en charge. Vous devez utiliser TLS 1.2 ou supérieur.",
    token_already_used: " Le jeton fourni a déjà été utilisé. Vous devez créer un nouveau jeton avant de pouvoir réessayer cette demande.",
    token_in_use: " Le jeton fourni est actuellement utilisé dans une autre demande. Cela se produit si votre intégration effectue des demandes en double simultanément.",
    transfers_not_allowed: " Le transfert demandé ne peut pas être créé. Contactez-nous si vous recevez cette erreur.",
    upstream_order_creation_failed: " La commande n'a pas pu être créée. Vérifiez les détails de la commande, puis réessayez.",
    url_invalid: " L'URL fournie n'est pas valide." ;

export default online_payment_error_codes;

【讨论】:

sn-p 代码不起作用。请查阅。另外,请简要说明您的解决方案的工作原理。【参考方案7】:

注意

文本尚未准备好生产。这只是开发人员的文本。 有些错误不应该显示给用户。如果我有更好的文本,我会重新编辑。如果有人有时间,请随时编辑。


如果您想提供他们的英文文本:

条纹 V3:

在线支付错误代码 https://stripe.com/docs/error-codes

export const online_payment_error_codes = 
    account_already_exists: "The email address provided for the creation of a deferred account already has an account associated with it. Use the OAuth flow to connect the existing account to your platform.",
    account_country_invalid_address: "The country of the business address provided does not match the country of the account. Businesses must be located in the same country as the account.",
    account_invalid: "The account ID provided as a value for the Stripe-Account header is invalid. Check that your requests are specifying a valid account ID.",
    account_number_invalid: "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide.",
    alipay_upgrade_required: "This method for creating Alipay payments is not supported anymore. Please upgrade your integration to use Sources instead.",
    amount_too_large: "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again.",
    amount_too_small: "The specified amount is less than the minimum amount allowed. Use a higher amount and try again.",
    api_key_expired: "The API key provided has expired. Obtain your current API keys from the Dashboard and update your integration to use them.",
    balance_insufficient: "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account’s available balance.",
    bank_account_exists: "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again.",
    bank_account_unusable: "The bank account provided cannot be used for payouts. A different bank account must be used.",
    bank_account_unverified: "Your Connect platform is attempting to share an unverified bank account with a connected account.",
    bitcoin_upgrade_required: "This method for creating Bitcoin payments is not supported anymore. Please upgrade your integration to use Sources instead.",
    card_declined: "The card has been declined. When a card is declined, the error returned also includes the decline_code attribute with the reason why the card was declined. Refer to our decline codes documentation to learn more.",
    charge_already_captured: "The charge you’re attempting to capture has already been captured. Update the request with an uncaptured charge ID.",
    charge_already_refunded: "The charge you’re attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded.",
    charge_disputed: "The charge you’re attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute.",
    charge_exceeds_source_limit: "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit.",
    charge_expired_for_capture: "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days.",
    country_unsupported: "Your platform attempted to create a custom account in a country that is not yet supported. Make sure that users can only sign up in countries supported by custom accounts.",
    coupon_expired: "The coupon provided for a subscription or order has expired. Either create a new coupon, or use an existing one that is valid.",
    customer_max_subscriptions: "The maximum number of subscriptions for a customer has been reached. Contact us if you are receiving this error.",
    email_invalid: "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters.",
    expired_card: "The card has expired. Check the expiration date or use a different card.",
    idempotency_key_in_use: "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.",
    incorrect_address: "The card’s address is incorrect. Check the card’s address or use a different card.",
    incorrect_cvc: "The card’s security code is incorrect. Check the card’s security code or use a different card.",
    incorrect_number: "The card number is incorrect. Check the card’s number or use a different card.",
    incorrect_zip: "The card’s postal code is incorrect. Check the card’s postal code or use a different card.",
    instant_payouts_unsupported: "The debit card provided as an external account does not support instant payouts. Provide another debit card or use a bank account instead.",
    invalid_card_type: "The card provided as an external account is not a debit card. Provide a debit card or use a bank account instead.",
    invalid_charge_amount: "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount.",
    invalid_cvc: "The card’s security code is invalid. Check the card’s security code or use a different card.",
    invalid_expiry_month: "The card’s expiration month is incorrect. Check the expiration date or use a different card.",
    invalid_expiry_year: "The card’s expiration year is incorrect. Check the expiration date or use a different card.",
    invalid_number: "The card number is invalid. Check the card details or use a different card.",
    invalid_source_usage: "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use.",
    invoice_no_customer_line_items: "An invoice cannot be generated for the specified customer as there are no pending invoice items. Check that the correct customer is being specified or create any necessary invoice items first.",
    invoice_no_subscription_line_items: "An invoice cannot be generated for the specified subscription as there are no pending invoice items. Check that the correct subscription is being specified or create any necessary invoice items first.",
    invoice_not_editable: "The specified invoice can no longer be edited. Instead, consider creating additional invoice items that will be applied to the next invoice. You can either manually generate the next invoice or wait for it to be automatically generated at the end of the billing cycle.",
    invoice_upcoming_none: "There is no upcoming invoice on the specified customer to preview. Only customers with active subscriptions or pending invoice items have invoices that can be previewed.",
    livemode_mismatch: "Test and live mode API keys, requests, and objects are only available within the mode they are in.",
    missing: "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details.",
    not_allowed_on_standard_account: "Transfers and payouts on behalf of a Standard connected account are not allowed.",
    order_creation_failed: "The order could not be created. Check the order details and then try again.",
    order_required_settings: "The order could not be processed as it is missing required information. Check the information provided and try again.",
    order_status_invalid: "The order cannot be updated because the status provided is either invalid or does not follow the order lifecycle (e.g., an order cannot transition from created to fulfilled without first transitioning to paid).",
    order_upstream_timeout: "The request timed out. Try again later.",
    out_of_inventory: "The SKU is out of stock. If more stock is available, update the SKU’s inventory quantity and try again.",
    parameter_invalid_empty: "One or more required values were not provided. Make sure requests include all required parameters.",
    parameter_invalid_integer: "One or more of the parameters requires an integer, but the values provided were a different type. Make sure that only supported values are provided for each attribute. Refer to our API documentation to look up the type of data each attribute supports.",
    parameter_invalid_string_blank: "One or more values provided only included whitespace. Check the values in your request and update any that contain only whitespace.",
    parameter_invalid_string_empty: "One or more required string values is empty. Make sure that string values contain at least one character.",
    parameter_missing: "One or more required values are missing. Check our API documentation to see which values are required to create or modify the specified resource.",
    parameter_unknown: "The request contains one or more unexpected parameters. Remove these and try again.",
    parameters_exclusive: "Two or more mutually exclusive parameters were provided. Check our API documentation or the returned error message to see which values are permitted when creating or modifying the specified resource.",
    payment_intent_authentication_failure: "The provided source has failed authentication. Provide source_data or a new source to attempt to fulfill this PaymentIntent again.",
    payment_intent_incompatible_payment_method: "The PaymentIntent expected a payment method with different properties than what was provided.",
    payment_intent_invalid_parameter: "One or more provided parameters was not allowed for the given operation on the PaymentIntent. Check our API reference or the returned error message to see which values were not correct for that PaymentIntent.",
    payment_intent_payment_attempt_failed: "The latest payment attempt for the PaymentIntent has failed. Check the last_payment_error property on the PaymentIntent for more details, and provide source_data or a new source to attempt to fulfill this PaymentIntent again.",
    payment_intent_unexpected_state: "The PaymentIntent’s state was incompatible with the operation you were trying to perform.",
    payment_method_unactivated: "The charge cannot be created as the payment method used has not been activated. Activate the payment method in the Dashboard, then try again.",
    payment_method_unexpected_state: "The provided payment method’s state was incompatible with the operation you were trying to perform. Confirm that the payment method is in an allowed state for the given operation before attempting to perform it.",
    payouts_not_allowed: "Payouts have been disabled on the connected account. Check the connected account’s status to see if any additional information needs to be provided, or if payouts have been disabled for another reason.",
    platform_api_key_expired: "The API key provided by your Connect platform has expired. This occurs if your platform has either generated a new key or the connected account has been disconnected from the platform. Obtain your current API keys from the Dashboard and update your integration, or reach out to the user and reconnect the account.",
    postal_code_invalid: "The postal code provided was incorrect.",
    processing_error: "An error occurred while processing the card. Check the card details are correct or use a different card.",
    product_inactive: "The product this SKU belongs to is no longer available for purchase.",
    rate_limit: "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.",
    resource_already_exists: "A resource with a user-specified ID (e.g., plan or coupon) already exists. Use a different, unique value for id and try again.",
    resource_missing: "The ID provided is not valid. Either the resource does not exist, or an ID for a different resource has been provided.",
    routing_number_invalid: "The bank routing number provided is invalid.",
    secret_key_required: "The API key provided is a publishable key, but a secret key is required. Obtain your current API keys from the Dashboard and update your integration to use them.",
    sepa_unsupported_account: "Your account does not support SEPA payments.",
    shipping_calculation_failed: "Shipping calculation failed as the information provided was either incorrect or could not be verified.",
    sku_inactive: "The SKU is inactive and no longer available for purchase. Use a different SKU, or make the current SKU active again.",
    state_unsupported: "Occurs when providing the legal_entity information for a U.S. custom account, if the provided state is not supported. (This is mostly associated states and territories.)",
    tax_id_invalid: "The tax ID number provided is invalid (e.g., missing digits). Tax ID information varies from country to country, but must be at least nine digits.",
    taxes_calculation_failed: "Tax calculation for the order failed.",
    testmode_charges_only: "Your account has not been activated and can only make test charges. Activate your account in the Dashboard to begin processing live charges.",
    tls_version_unsupported: "Your integration is using an older version of TLS that is unsupported. You must be using TLS 1.2 or above.",
    token_already_used: "The token provided has already been used. You must create a new token before you can retry this request.",
    token_in_use: "The token provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.",
    transfers_not_allowed: "The requested transfer cannot be created. Contact us if you are receiving this error.",
    upstream_order_creation_failed: "The order could not be created. Check the order details and then try again.",
    url_invalid: "The URL provided is invalid."
;

拒绝的错误代码 https://stripe.com/docs/declines/codes

export const online_payment_declined_codes = 
    approve_with_id: 
        "description": "The payment cannot be authorized.",
        "next_steps": "The payment should be attempted again. If it still cannot be processed, the customer needs to contact their card issuer."
    ,
    call_issuer: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    card_not_supported: 
        "description": "The card does not support this type of purchase.",
        "next_steps": "The customer needs to contact their card issuer to make sure their card can be used to make this type of purchase."
    ,
    card_velocity_exceeded: 
        "description": "The customer has exceeded the balance or credit limit available on their card.",
        "next_steps": "The customer should contact their card issuer for more information."
    ,
    currency_not_supported: 
        "description": "The card does not support the specified currency.",
        "next_steps": "The customer needs to check with the issuer whether the card can be used for the type of currency specified."
    ,
    do_not_honor: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    do_not_try_again: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer should contact their card issuer for more information."
    ,
    duplicate_transaction: 
        "description": "A transaction with identical amount and credit card information was submitted very recently.",
        "next_steps": "Check to see if a recent payment already exists."
    ,
    expired_card: 
        "description": "The card has expired.",
        "next_steps": "The customer should use another card."
    ,
    fraudulent: 
        "description": "The payment has been declined as Stripe suspects it is fraudulent.",
        "next_steps": "Do not report more detailed information to your customer.  Instead, present as you would the generic_decline described below."
    ,
    generic_decline: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    incorrect_number: 
        "description": "The card number is incorrect.",
        "next_steps": "The customer should try again using the correct card number."
    ,
    incorrect_cvc: 
        "description": "The CVC number is incorrect.",
        "next_steps": "The customer should try again using the correct CVC."
    ,
    incorrect_pin: 
        "description": "The PIN entered is incorrect. This decline code only applies to payments made with a card reader. ",
        "next_steps": "The customer should try again using the correct PIN."
    ,
    incorrect_zip: 
        "description": "The ZIP/postal code is incorrect.",
        "next_steps": "The customer should try again using the correct billing ZIP/postal code."
    ,
    insufficient_funds: 
        "description": "The card has insufficient funds to complete the purchase.",
        "next_steps": "The customer should use an alternative payment method."
    ,
    invalid_account: 
        "description": "The card, or account the card is connected to, is invalid.",
        "next_steps": "The customer needs to contact their card issuer to check that the card is working correctly."
    ,
    invalid_amount: 
        "description": "The payment amount is invalid, or exceeds the amount that is allowed.",
        "next_steps": "If the amount appears to be correct, the customer needs to check with their card issuer that they can make purchases of that amount."
    ,
    invalid_cvc: 
        "description": "The CVC number is incorrect.",
        "next_steps": "The customer should try again using the correct CVC."
    ,
    invalid_expiry_year: 
        "description": "The expiration year invalid.",
        "next_steps": "The customer should try again using the correct expiration date."
    ,
    invalid_number: 
        "description": "The card number is incorrect.",
        "next_steps": "The customer should try again using the correct card number."
    ,
    invalid_pin: 
        "description": "The PIN entered is incorrect. This decline code only applies to payments made with a card reader.",
        "next_steps": "The customer should try again using the correct PIN."
    ,
    issuer_not_available: 
        "description": "The card issuer could not be reached, so the payment could not be authorized.",
        "next_steps": "The payment should be attempted again. If it still cannot be processed, the customer needs to contact their card issuer."
    ,
    lost_card: 
        "description": "The payment has been declined because the card is reported lost.",
        "next_steps": "The specific reason for the decline should not be reported to the customer. Instead, it needs to be presented as a generic decline."
    ,
    merchant_blacklist: 
        "description": "The payment has been declined because it matches a value on the Stripe user's blocklist.",
        "next_steps": "Do not report more detailed information to your customer. Instead, present as you would the generic_decline described above."
    ,
    new_account_information_available: 
        "description": "The card, or account the card is connected to, is invalid.",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    no_action_taken: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer should contact their card issuer for more information."
    ,
    not_permitted: 
        "description": "The payment is not permitted.",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    pickup_card: 
        "description": "The card cannot be used to make this payment (it is possible it has been reported lost or stolen).",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    pin_try_exceeded: 
        "description": "The allowable number of PIN tries has been exceeded.",
        "next_steps": "The customer must use another card or method of payment."
    ,
    processing_error: 
        "description": "An error occurred while processing the card.",
        "next_steps": "The payment should be attempted again. If it still cannot be processed, try again later."
    ,
    reenter_transaction: 
        "description": "The payment could not be processed by the issuer for an unknown reason.",
        "next_steps": "The payment should be attempted again. If it still cannot be processed, the customer needs to contact their card issuer."
    ,
    restricted_card: 
        "description": "The card cannot be used to make this payment (it is possible it has been reported lost or stolen).",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    revocation_of_all_authorizations: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer should contact their card issuer for more information."
    ,
    revocation_of_authorization: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer should contact their card issuer for more information."
    ,
    security_violation: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    service_not_allowed: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer should contact their card issuer for more information."
    ,
    stolen_card: 
        "description": "The payment has been declined because the card is reported stolen.",
        "next_steps": "The specific reason for the decline should not be reported to the customer. Instead, it needs to be presented as a generic decline."
    ,
    stop_payment_order: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer should contact their card issuer for more information."
    ,
    testmode_decline: 
        "description": "A Stripe test card number was used.",
        "next_steps": "A genuine card must be used to make a payment."
    ,
    transaction_not_allowed: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "The customer needs to contact their card issuer for more information."
    ,
    try_again_later: 
        "description": "The card has been declined for an unknown reason.",
        "next_steps": "Ask the customer to attempt the payment again. If subsequent payments are declined, the customer should contact their card issuer for more information."
    ,
    withdrawal_count_limit_exceeded: 
        "description": "The customer has exceeded the balance or credit limit available on their card. ",
        "next_steps": "The customer should use an alternative payment method."
    
;

【讨论】:

丹克,斯特凡?。 感谢邮件的有序排列。实际上我找不到付款被拒绝错误代码的正确用法,但我开始在我自己的项目中使用您的在线支付错误代码对象。如果你能给出两者的用例就好了。

以上是关于Stripe 中的非英文文本可能吗?的主要内容,如果未能解决你的问题,请参考以下文章

如何使用 Vue js 中的 paypal/stripe 等付款方式收费?我需要像express这样的服务器吗?

如何取消 Stripe 计划中的所有订阅?

从r中的非结构化文本文件中提取表

模板类中的非模板函数[关闭]

MongoDB - 去除字段中的非数字字符

MongoDB - 去除字段中的非数字字符