{"title":"Real Time Account Updater","category":"default","creationDate":1711749240,"content":"<p>With our Real Time Account Updater, you can be informed of updates to shoppers' Visa, Mastercard, or Cartes Bancaires cards in real time.<\/p>\n<p>When you submit a payment that is refused, our Real Time Account Updater instantly checks for updated card details. If there is an update, we immediately retry the payment with the updated card details. This all happens while the payment is being processed, and appears as a single transaction.<\/p>\n<p>You can optionally receive the updated card details in the payment response. If you use <a href=\"\/pt\/online-payments\/tokenization\">Adyen Tokenization<\/a>, the token storing the card details is updated automatically and the <code>storedPaymentMethodId<\/code> stays the same.<\/p>\n<h2>Requirements<\/h2>\n<p>Before you begin, take into account the following requirements, limitations, and preparations.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure you have an <a href=\"\/pt\/online-payments\/build-your-integration#advanced-flow-three-api-requests\">online payments integration using the Advanced flow<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Limitations<\/strong><\/td>\n<td style=\"text-align: left;\">You can only use our Real Time Account Updater services if all of the following conditions are met: <ul><li markdown=\"1\">The amount specified in the payment is not zero.<\/li><li markdown=\"1\">The <code>shopperInteraction<\/code> parameter is set to <strong>ContAuth<\/strong><\/li><li markdown=\"1\">The payment does not contain a security code (CVC\/CVV\/CID).<\/li> <\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin: <ul><li markdown=\"1\">Ask our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> to enable Real Time Account Updater. If you are fully PCI compliant, also let them know if you want to receive <a href=\"#updated-card-number\">updated card numbers<\/a> in your payment responses.<\/li><li markdown=\"1\">Optionally, enable <a href=\"#receive-card-updates-in-payment-response\">receiving card updates in payment responses<\/a>.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How it works<\/h2>\n<ol>\n<li>Each time a payment request is declined, Adyen sends an account update request in real time.<\/li>\n<li>When we receive the up-to-date billing information, we immediately retry the payment.<\/li>\n<li>Optionally, you can <a href=\"#receive-card-updates-in-payment-response\">receive card updates in the payment responses<\/a>.<br \/>\nYou can use those new details to update your other systems, such as a CRM tool.<\/li>\n<li>In the payment response, you <a href=\"#realtime-account-updater-statuses\">get the account update status<\/a>.<\/li>\n<li>Optionally, you can <a href=\"#get-a-report-on-card-updates\">include card updates<\/a> in the <a href=\"\/pt\/reporting\/received-payment-details-report\">Received Payment Details report<\/a>.<\/li>\n<\/ol>\n<h2 id=\"receive-card-updates-in-payment-response\">Receive card updates in payment responses<\/h2>\n<p>To enable receiving changed card details in your payment response:<\/p>\n<ol>\n<li>\n<p>Log in to your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>.<\/p>\n<\/li>\n<li>\n<p>Go to <strong>Developers<\/strong>\u00a0&gt;\u00a0<strong>Additional data<\/strong>.<\/p>\n<div class=\"notices green\">\n<p>For a description and an example of additional data items, click on the row of the item.<\/p>\n<\/div>\n<\/li>\n<li>\n<p>Under <strong>Card<\/strong>, select the card details that you want to receive. We recommend selecting at least the following:<\/p>\n<ul>\n<li><strong>Card bin details<\/strong><\/li>\n<li><strong>Card summary<\/strong><\/li>\n<li><strong>Expiry date<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Under <strong>Payment<\/strong>, select <strong>Realtime Account Updater Status<\/strong>.<\/p>\n<\/li>\n<li>\n<p>Select <strong>Save configuration<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<p>If the details of a card have changed, you receive this information as <code>additionalData<\/code> in the payment response.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Changed card details in payment response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   additionalData: {\\n      expiryDate: \\\"3\\\/2030\\\",\\n      realtimeAccountUpdaterStatus: \\\"CardChanged\\\",\\n      cardSummary: \\\"1111\\\",\\n      cardSchemeCommercial: \\\"true\\\",\\n      cardPaymentMethod: \\\"visa\\\",\\n      cardIssuingBank: \\\"Bank of America\\\",\\n      cardIssuingCountry: \\\"US\\\",\\n      cardIssuingCurrency: \\\"USD\\\",\\n      cardBin: \\\"411111\\\",\\n      fundingSource: \\\"CREDIT\\\"\\n   }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>If you are <a href=\"\/pt\/development-resources\/pci-dss-compliance-guide\">fully PCI compliant<\/a>, you can also receive the full <a href=\"#updated-card-number\">updated card number<\/a> in the payment response.<\/p>\n<h2 id=\"updated-card-number\">Receive updated card numbers<\/h2>\n<p>If you are <a href=\"\/pt\/development-resources\/pci-dss-compliance-guide\">fully PCI compliant<\/a>, you can receive the full updated card number in the payment response. The card number is provided as a <a href=\"https:\/\/tools.ietf.org\/html\/rfc7516#section-3\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">JSON Web Encryption<\/a> (JWE) encrypted value, that you need to <a href=\"#decrypt-the-card-number\">decrypt<\/a> using your private key.<\/p>\n<p>To enable this functionality:<\/p>\n<ol>\n<li>Contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a>.<\/li>\n<li>Provide them with an RSA <em>public key<\/em> with a length of 2048 bits. We use this key to encrypt card numbers that are provided in the payments response.<\/li>\n<\/ol>\n<p>If the card number has changed, you additionally receive the following as <code>additionalData<\/code> in the payment response:<\/p>\n<ul>\n<li>\n<p><code>realtimeAccountUpdaterSecureData<\/code>: encrypted value representing the updated card number (or <a href=\"\/pt\/get-started-with-adyen\/adyen-glossary\/#card-number-pan\">PAN<\/a>).<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Encrypted changed card number in payment response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   additionalData: {\\n      realtimeAccountUpdaterStatus: \\\"CardChanged\\\",\\n      realtimeAccountUpdaterSecureData: \\\"eyJhbGciOiJSU0EtT0FF...\\\",\\n      expiryDate: \\\"3\\\/2030\\\",\\n      cardSummary: \\\"1111\\\",\\n      cardSchemeCommercial: \\\"true\\\",\\n      cardPaymentMethod: \\\"visa\\\",\\n      cardIssuingBank: \\\"Bank of America\\\",\\n      cardIssuingCountry: \\\"US\\\",\\n      cardIssuingCurrency: \\\"USD\\\",\\n      fundingSource: \\\"CREDIT\\\"\\n   }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ul>\n<h4>Decrypt the card number<\/h4>\n<p>The <code>realtimeAccountUpdaterSecureData<\/code> value is encrypted using JWE, represented in JWE <a href=\"https:\/\/tools.ietf.org\/html\/rfc7516#section-7.1\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">JSON Compact Serialization format<\/a>. You need to decrypt this using your private key.<\/p>\n<p>To decrypt the card number:<\/p>\n<ol>\n<li>\n<p>Parse the value.<\/p>\n<\/li>\n<li>\n<p>Load your private key.<\/p>\n<div class=\"notices blue\">\n<p>You can identify which key should be used to decrypt the value using the <a href=\"https:\/\/tools.ietf.org\/html\/rfc7516#appendix-A.4.4\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\"><code>kid<\/code> (Key ID) header parameter<\/a>.<\/p>\n<\/div>\n<\/li>\n<li>\n<p><a href=\"https:\/\/tools.ietf.org\/html\/rfc7516#section-5.2\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Decrypt the value<\/a> using a combination of:<\/p>\n<ul>\n<li>Your private key.<\/li>\n<li>Key algorithm: RSA_OAEP_256<\/li>\n<li>Content encryption algorithm: AES_256_GCM<\/li>\n<\/ul>\n<p>The resulting plaintext is the shopper's updated card number (for example <strong>45454547699084950<\/strong>).<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"realtime-account-updater-statuses\">Get account update statuses<\/h2>\n<p>When we perform the real time account update, we return a status, <code>additionalData.realtimeAccountUpdaterStatus<\/code>, indicating if and how the card details were updated.\u00a0<\/p>\n<p>The realtime account updater status can be one of the following values:<\/p>\n<table>\n<thead>\n<tr>\n<th>Status<\/th>\n<th>Card Updated<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>CardChanged<\/strong><\/td>\n<td>Yes<\/td>\n<td>The card number has changed.<\/td>\n<\/tr>\n<tr>\n<td><strong>CardExpiryChanged<\/strong><\/td>\n<td>Yes<\/td>\n<td>The card expiration date has changed.<\/td>\n<\/tr>\n<tr>\n<td><strong>CloseAccount<\/strong><\/td>\n<td>No<\/td>\n<td>The card has been closed by the issuer and is no longer valid. We will <em>not<\/em> automatically remove the card details. Disable the card details and ask the shopper to provide new card details.<\/td>\n<\/tr>\n<tr>\n<td><strong>ContactCardAccountHolder<\/strong><\/td>\n<td>No<\/td>\n<td>(Visa only) The card was updated but the updated details are not in the Account updater service. Contact the cardholder to get their updated card information.<\/td>\n<\/tr>\n<tr>\n<td><strong>Unknown<\/strong><\/td>\n<td>No<\/td>\n<td>(MasterCard only) We received an unknown value. In most cases, this means that Mastercard temporarily couldn't find the card in their system.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Get a report on card updates<\/h2>\n<p>The <a href=\"\/pt\/reporting\/account-updater-results\">Account Updater results report<\/a> shows a summary of Account Updater results from a particular period of time. Use this report to check the outcomes and statuses of account updates, and get a summary of both Real Time Account Updater and Batch Account Updater results. You can also analyze the fees charged for the Account Updater.<\/p>\n<p>For an overview of card updates on transaction level, you can add the Real Time Account Updater status column to the <a href=\"\/pt\/reporting\/received-payment-details-report\">Received Payment Details report<\/a>.<\/p>\n<h2>Testing<\/h2>\n<p>To test how different Real Time Account Updater scenarios work for your integration, use the following test card numbers and expiry dates in your payment request. The response will contain the corresponding status in the <code>additionalData.realtimeAccountUpdaterStatus<\/code> field.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Card number<\/th>\n<th style=\"text-align: left;\">Expiry month\/year<\/th>\n<th style=\"text-align: left;\">Status<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">5454 5476 9908 4950<\/td>\n<td style=\"text-align: left;\">03\/2030<\/td>\n<td style=\"text-align: left;\"><strong>CardChanged<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">5454 5418 5840 6567<\/td>\n<td style=\"text-align: left;\">Any date except 03\/2030<\/td>\n<td style=\"text-align: left;\"><strong>CardExpiryChanged<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">5454 5415 8031 1093<\/td>\n<td style=\"text-align: left;\">03\/2030<\/td>\n<td style=\"text-align: left;\"><strong>CloseAccount<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">4111 1131 5971 2925<\/td>\n<td style=\"text-align: left;\">03\/2030<\/td>\n<td style=\"text-align: left;\"><strong>ContactCardAccountHolder<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"sc-notice info\"><div>\n<p>If you are not fully PCI compliant and thus unable to process raw card data, add a prefix of <code>test_<\/code> to the credentials. For example, use <code>\"encryptedCardNumber\": \"test_5454547699084950\"<\/code>. This allows you to <a href=\"\/pt\/development-resources\/test-cards-and-credentials\/test-card-numbers#test-encrypted-card-details\">test using encrypted card details<\/a>.<\/p>\n<\/div><\/div>\n<p>The example below shows how to send a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request to test a scenario where the card has changed.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Test card change scenario'\" :id=\"'test-card-change-scenario-7267393865'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v68\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n  \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n  \\&quot;amount\\&quot;:{\\n    \\&quot;currency\\&quot;:\\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;:1000\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;scheme\\&quot;,\\n    \\&quot;encryptedCardNumber\\&quot;: \\&quot;test_5454547699084950\\&quot;,\\n    \\&quot;encryptedExpiryMonth\\&quot;: \\&quot;test_03\\&quot;,\\n    \\&quot;encryptedExpiryYear\\&quot;: \\&quot;test_2030\\&quot;\\n  }\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v25.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.checkout.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.model.RequestOptions;\\nimport com.adyen.service.checkout.*;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount()\\n  .currency(\\&quot;EUR\\&quot;)\\n  .value(1000L);\\n\\nCardDetails cardDetails = new CardDetails()\\n  .encryptedCardNumber(\\&quot;test_5454547699084950\\&quot;)\\n  .encryptedExpiryYear(\\&quot;test_2030\\&quot;)\\n  .encryptedExpiryMonth(\\&quot;test_03\\&quot;)\\n  .type(CardDetails.TypeEnum.SCHEME);\\n\\nPaymentRequest paymentRequest = new PaymentRequest()\\n  .reference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  .amount(amount)\\n  .merchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;)\\n  .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)\\n  .paymentMethod(new CheckoutPaymentMethod(cardDetails));\\n\\n\\\/\\\/ Make the API call\\nPaymentsApi service = new PaymentsApi(client);\\nPaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey(\\&quot;UUID\\&quot;));&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen PHP API Library v17.4.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\Amount;\\nuse Adyen\\\\Model\\\\Checkout\\\\CheckoutPaymentMethod;\\nuse Adyen\\\\Model\\\\Checkout\\\\PaymentRequest;\\nuse Adyen\\\\Service\\\\Checkout\\\\PaymentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$amount = new Amount();\\n$amount\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setValue(1000);\\n\\n$checkoutPaymentMethod = new CheckoutPaymentMethod();\\n$checkoutPaymentMethod\\n  -&gt;setEncryptedCardNumber(\\&quot;test_5454547699084950\\&quot;)\\n  -&gt;setEncryptedExpiryYear(\\&quot;test_2030\\&quot;)\\n  -&gt;setEncryptedExpiryMonth(\\&quot;test_03\\&quot;)\\n  -&gt;setType(\\&quot;scheme\\&quot;);\\n\\n$paymentRequest = new PaymentRequest();\\n$paymentRequest\\n  -&gt;setReference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  -&gt;setAmount($amount)\\n  -&gt;setMerchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setShopperInteraction(\\&quot;ContAuth\\&quot;)\\n  -&gt;setPaymentMethod($checkoutPaymentMethod);\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Make the API call\\n$service = new PaymentsApi($client);\\n$response = $service-&gt;payments($paymentRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .net API Library v14.4.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount\\n{\\n  Currency = \\&quot;EUR\\&quot;,\\n  Value = 1000\\n};\\n\\nCardDetails cardDetails = new CardDetails\\n{\\n  EncryptedCardNumber = \\&quot;test_5454547699084950\\&quot;,\\n  EncryptedExpiryYear = \\&quot;test_2030\\&quot;,\\n  EncryptedExpiryMonth = \\&quot;test_03\\&quot;,\\n  Type = CardDetails.TypeEnum.Scheme\\n};\\n\\nPaymentRequest paymentRequest = new PaymentRequest\\n{\\n  Reference = \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount = amount,\\n  MerchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  PaymentMethod = new CheckoutPaymentMethod(cardDetails)\\n};\\n\\n\\\/\\\/ Make the API call\\nvar service = new PaymentsService(client);\\nvar response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = \\&quot;UUID\\&quot;});&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.2.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRequest = {\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  shopperInteraction: \\&quot;ContAuth\\&quot;,\\n  amount: {\\n    currency: \\&quot;EUR\\&quot;,\\n    value: 1000\\n  },\\n  paymentMethod: {\\n    type: \\&quot;scheme\\&quot;,\\n    encryptedCardNumber: \\&quot;test_5454547699084950\\&quot;,\\n    encryptedExpiryMonth: \\&quot;test_03\\&quot;,\\n    encryptedExpiryYear: \\&quot;test_2030\\&quot;\\n  }\\n}\\n\\n\\\/\\\/ Make the API call\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v9.3.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\namount := checkout.Amount{\\n  Currency: \\&quot;EUR\\&quot;,\\n  Value: 1000,\\n}\\n\\ncardDetails := checkout.CardDetails{\\n  EncryptedCardNumber: common.PtrString(\\&quot;test_5454547699084950\\&quot;),\\n  EncryptedExpiryYear: common.PtrString(\\&quot;test_2030\\&quot;),\\n  EncryptedExpiryMonth: common.PtrString(\\&quot;test_03\\&quot;),\\n  Type: common.PtrString(\\&quot;scheme\\&quot;),\\n}\\n\\npaymentRequest := checkout.PaymentRequest{\\n  Reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount: amount,\\n  MerchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  ShopperInteraction: common.PtrString(\\&quot;ContAuth\\&quot;),\\n  PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&amp;cardDetails),\\n}\\n\\n\\\/\\\/ Make the API call\\nservice := client.Checkout()\\nreq := service.PaymentsApi.PaymentsInput().IdempotencyKey(\\&quot;UUID\\&quot;).PaymentRequest(paymentRequest)\\nres, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.2.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;: 1000\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;scheme\\&quot;,\\n    \\&quot;encryptedCardNumber\\&quot;: \\&quot;test_5454547699084950\\&quot;,\\n    \\&quot;encryptedExpiryMonth\\&quot;: \\&quot;test_03\\&quot;,\\n    \\&quot;encryptedExpiryYear\\&quot;: \\&quot;test_2030\\&quot;\\n  }\\n}\\n\\n# Make the API call\\nresult = adyen.checkout.payments_api.payments(request=json_request, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v9.3.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :shopperInteraction =&gt; 'ContAuth',\\n  :amount =&gt; {\\n    :currency =&gt; 'EUR',\\n    :value =&gt; 1000\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'scheme',\\n    :encryptedCardNumber =&gt; 'test_5454547699084950',\\n    :encryptedExpiryMonth =&gt; 'test_03',\\n    :encryptedExpiryYear =&gt; 'test_2030'\\n  }\\n}\\n\\n# Make the API call\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.2.0\\n\\\/\\\/ Require the parts of the module you want to use\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst amount: Types.checkout.Amount = {\\n  currency: \\&quot;EUR\\&quot;,\\n  value: 1000\\n};\\n\\nconst cardDetails: Types.checkout.CardDetails = {\\n  encryptedCardNumber: \\&quot;test_5454547699084950\\&quot;,\\n  encryptedExpiryYear: \\&quot;test_2030\\&quot;,\\n  encryptedExpiryMonth: \\&quot;test_03\\&quot;,\\n  type: Types.checkout.CardDetails.TypeEnum.Scheme\\n};\\n\\nconst paymentRequest: Types.checkout.PaymentRequest = {\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  amount: amount,\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  paymentMethod: cardDetails\\n};\\n\\n\\\/\\\/ Make the API call\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2>See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/tokenization\"\n                        target=\"_self\"\n                        >\n                    Tokenization\n                <\/a><\/li><li><a href=\"\/online-payments\/account-updater\"\n                        target=\"_self\"\n                        >\n                    Account Updater\n                <\/a><\/li><li><a href=\"\/reporting\/account-updater-results\"\n                        target=\"_self\"\n                        >\n                    Account Updater results report\n                <\/a><\/li><li><a href=\"https:\/\/tools.ietf.org\/html\/rfc7516\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    IETF: JSON Web Encryption (JWE) standard\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/online-payments\/account-updater\/real-time-account-updater","articleFields":{"id":"39953102","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"29-03-2024 22:54","feedback_component":true,"page_id":"8b4d13e3-5b44-4cef-a136-3f35e63c1637","filters_component":false,"decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/online-payments\/account-updater\/real-time-account-updater","title":"Real Time Account Updater","content":"With our Real Time Account Updater, you can be informed of updates to shoppers' Visa, Mastercard, or Cartes Bancaires cards in real time.\nWhen you submit a payment that is refused, our Real Time Account Updater instantly checks for updated card details. If there is an update, we immediately retry the payment with the updated card details. This all happens while the payment is being processed, and appears as a single transaction.\nYou can optionally receive the updated card details in the payment response. If you use Adyen Tokenization, the token storing the card details is updated automatically and the storedPaymentMethodId stays the same.\nRequirements\nBefore you begin, take into account the following requirements, limitations, and preparations.\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure you have an online payments integration using the Advanced flow.\n\n\nLimitations\nYou can only use our Real Time Account Updater services if all of the following conditions are met: The amount specified in the payment is not zero.The shopperInteraction parameter is set to ContAuthThe payment does not contain a security code (CVC\/CVV\/CID). \n\n\nSetup steps\nBefore you begin: Ask our Support Team to enable Real Time Account Updater. If you are fully PCI compliant, also let them know if you want to receive updated card numbers in your payment responses.Optionally, enable receiving card updates in payment responses.\n\n\n\nHow it works\n\nEach time a payment request is declined, Adyen sends an account update request in real time.\nWhen we receive the up-to-date billing information, we immediately retry the payment.\nOptionally, you can receive card updates in the payment responses.\nYou can use those new details to update your other systems, such as a CRM tool.\nIn the payment response, you get the account update status.\nOptionally, you can include card updates in the Received Payment Details report.\n\nReceive card updates in payment responses\nTo enable receiving changed card details in your payment response:\n\n\nLog in to your Customer Area.\n\n\nGo to Developers\u00a0&gt;\u00a0Additional data.\n\nFor a description and an example of additional data items, click on the row of the item.\n\n\n\nUnder Card, select the card details that you want to receive. We recommend selecting at least the following:\n\nCard bin details\nCard summary\nExpiry date\n\n\n\nUnder Payment, select Realtime Account Updater Status.\n\n\nSelect Save configuration.\n\n\nIf the details of a card have changed, you receive this information as additionalData in the payment response.\n\n    \n\nIf you are fully PCI compliant, you can also receive the full updated card number in the payment response.\nReceive updated card numbers\nIf you are fully PCI compliant, you can receive the full updated card number in the payment response. The card number is provided as a JSON Web Encryption (JWE) encrypted value, that you need to decrypt using your private key.\nTo enable this functionality:\n\nContact our Support Team.\nProvide them with an RSA public key with a length of 2048 bits. We use this key to encrypt card numbers that are provided in the payments response.\n\nIf the card number has changed, you additionally receive the following as additionalData in the payment response:\n\n\nrealtimeAccountUpdaterSecureData: encrypted value representing the updated card number (or PAN).\n\n\n\n\n\nDecrypt the card number\nThe realtimeAccountUpdaterSecureData value is encrypted using JWE, represented in JWE JSON Compact Serialization format. You need to decrypt this using your private key.\nTo decrypt the card number:\n\n\nParse the value.\n\n\nLoad your private key.\n\nYou can identify which key should be used to decrypt the value using the kid (Key ID) header parameter.\n\n\n\nDecrypt the value using a combination of:\n\nYour private key.\nKey algorithm: RSA_OAEP_256\nContent encryption algorithm: AES_256_GCM\n\nThe resulting plaintext is the shopper's updated card number (for example 45454547699084950).\n\n\nGet account update statuses\nWhen we perform the real time account update, we return a status, additionalData.realtimeAccountUpdaterStatus, indicating if and how the card details were updated.\u00a0\nThe realtime account updater status can be one of the following values:\n\n\n\nStatus\nCard Updated\nDescription\n\n\n\n\nCardChanged\nYes\nThe card number has changed.\n\n\nCardExpiryChanged\nYes\nThe card expiration date has changed.\n\n\nCloseAccount\nNo\nThe card has been closed by the issuer and is no longer valid. We will not automatically remove the card details. Disable the card details and ask the shopper to provide new card details.\n\n\nContactCardAccountHolder\nNo\n(Visa only) The card was updated but the updated details are not in the Account updater service. Contact the cardholder to get their updated card information.\n\n\nUnknown\nNo\n(MasterCard only) We received an unknown value. In most cases, this means that Mastercard temporarily couldn't find the card in their system.\n\n\n\nGet a report on card updates\nThe Account Updater results report shows a summary of Account Updater results from a particular period of time. Use this report to check the outcomes and statuses of account updates, and get a summary of both Real Time Account Updater and Batch Account Updater results. You can also analyze the fees charged for the Account Updater.\nFor an overview of card updates on transaction level, you can add the Real Time Account Updater status column to the Received Payment Details report.\nTesting\nTo test how different Real Time Account Updater scenarios work for your integration, use the following test card numbers and expiry dates in your payment request. The response will contain the corresponding status in the additionalData.realtimeAccountUpdaterStatus field.\n\n\n\nCard number\nExpiry month\/year\nStatus\n\n\n\n\n5454 5476 9908 4950\n03\/2030\nCardChanged\n\n\n5454 5418 5840 6567\nAny date except 03\/2030\nCardExpiryChanged\n\n\n5454 5415 8031 1093\n03\/2030\nCloseAccount\n\n\n4111 1131 5971 2925\n03\/2030\nContactCardAccountHolder\n\n\n\n\nIf you are not fully PCI compliant and thus unable to process raw card data, add a prefix of test_ to the credentials. For example, use \"encryptedCardNumber\": \"test_5454547699084950\". This allows you to test using encrypted card details.\n\nThe example below shows how to send a  \/payments request to test a scenario where the card has changed.\n\n    \n\nSee also\n\n\n                    Tokenization\n                \n                    Account Updater\n                \n                    Account Updater results report\n                \n                    IETF: JSON Web Encryption (JWE) standard\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Account Updater","lvl3":"Real Time Account Updater"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/online-payments","lvl2":"https:\/\/docs.adyen.com\/pt\/online-payments\/account-updater","lvl3":"\/pt\/online-payments\/account-updater\/real-time-account-updater"},"levels":4,"category":"Online Payments","category_color":"green","tags":["Account","Updater"]},"articleFiles":{"test-card-change-scenario-7267393865.js":"<p alt=\"\">test-card-change-scenario-7267393865.js<\/p>"}}
