{"title":"Afterpay Redirect Component","category":"default","creationDate":1567783140,"content":"<div class=\"sc-notice info\"><div>\n<p><strong>If you are using Android Components v5.0.0 or later:<\/strong><\/p>\n<p>This payment method requires no additional configuration.<\/p>\n<p>Follow the  <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components\">Components integration guide<\/a> and use the following module and Component names:<\/p>\n<ul>\n<li>To <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow\/?platform=Android&amp;integration=Components#import\">import the module<\/a>: <strong>instant<\/strong><\/li>\n<li>To <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components#launch-and-show\">launch and show the Component<\/a>: <strong>InstantPaymentComponent<\/strong><\/li>\n<\/ul>\n<\/div><\/div>\n<p>You can use our <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow\/?platform=Android&amp;integration=Components#handle-a-redirect\">Redirect Component<\/a> to handle the redirect to Afterpay.<\/p>\n<p>When adding Afterpay to your existing Components integration, you also need to:<\/p>\n<ol>\n<li><a href=\"#show-in-payment-form\">Show Afterpay in your payment form<\/a>.<\/li>\n<li>Collect shopper details, and specify these <a href=\"#make-a-payment\">in your payment request<\/a>.\nAfterpay uses these for risk checks.<\/li>\n<li>Provide information about the purchased items <a href=\"#make-a-payment\">in your payment request<\/a>.<\/li>\n<li><a href=\"#handle-the-redirect\">Handle the redirect result<\/a> when the shopper returns to your website.<\/li>\n<\/ol>\n<h2>Requirements<\/h2>\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 that you have built an Advanced flow <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Components\">Android Components integration<\/a>. <\/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, <a href=\"\/pt\/payment-methods\/add-payment-methods\">add Afterpay in your Customer Area<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"show-in-payment-form\">Show Afterpay in your payment form<\/h2>\n<p>Include Afterpay in the list of available payment methods, and collect the required shopper details:<\/p>\n<ol>\n<li>\n<p>Specify in your  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> request one of the following combinations of  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">countryCode<\/a> and  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-amount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.currency<\/a>&#58;<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Country\/region<\/th>\n<th style=\"text-align: left;\"><code>countryCode<\/code><\/th>\n<th style=\"text-align: left;\"><code>amount.currency<\/code><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">Australia<\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>AU<\/strong><\/span><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>AUD<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">New Zealand<\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>NZ<\/strong><\/span><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>NZD<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Canada<\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>CA<\/strong><\/span><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>CAD<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The response contains <code>paymentMethod.type<\/code>: <span translate=\"no\"><strong>afterpaytouch<\/strong><\/span>.<\/p>\n<\/li>\n<li>\n<p>Collect the following shopper details:<\/p>\n<ul>\n<li>Full name<\/li>\n<li>Email address<\/li>\n<li>Billing address and delivery address.<\/li>\n<\/ul>\nAfterpay uses these information for risk checks.\n<\/li>\n<\/ol>\n<div class=\"notices green\">\n<p>We provide an Afterpay logo which you can use on your payment form. For more information, refer to <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#downloading-logos\">Downloading logos<\/a>.<\/p>\n<\/div>\n<h2>Make a payment<\/h2>\n<ol>\n<li>\n<p>When the shopper proceeds to pay, make 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 from your server, specifying:<\/p>\n<ul>\n<li>\n<p><code>paymentMethod.type<\/code>: set this to <span translate=\"no\"><strong>afterpaytouch<\/strong><\/span> to redirect to Afterpay.<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperName\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperName<\/a>&#58;\u00a0the shopper's full name.\u00a0<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperEmail\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperEmail<\/a>&#58; the shopper's email address.\u00a0\u00a0<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-telephoneNumber\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">telephoneNumber<\/a> (Optional)&#58; the shopper's phone number.<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-billingAddress\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">billingAddress<\/a>&#58;\u00a0the postal address to be included on the invoice.\u00a0<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-deliveryAddress\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">deliveryAddress<\/a>&#58;\u00a0the postal address where the goods will be shipped.<\/p>\n<\/li>\n<li>\n<p> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-lineItems\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">lineItems<\/a>&#58; price and product information about the purchased items.\u00a0\u00a0<\/p>\n<\/li>\n<li>\n<p><code>returnURL<\/code>: URL to where the shopper should be redirected back to after they complete the payment. Get this URL from the Component in the <code>RedirectComponent.getReturnUrl(context)<\/code>.<\/p>\n<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"''\" :id=\"'payments'\" :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;{hint:`paymentComponentData.paymentMethod` from Drop-in}paymentMethod{\\\/hint}\\&quot;:{\\n    \\&quot;type\\&quot;:\\&quot;afterpaytouch\\&quot;\\n  },\\n  \\&quot;amount\\&quot;:{\\n     \\&quot;value\\&quot;:1000,\\n     \\&quot;currency\\&quot;:\\&quot;AUD\\&quot;\\n  },\\n  \\&quot;shopperName\\&quot;:{\\n     \\&quot;firstName\\&quot;:\\&quot;Simon\\&quot;,\\n     \\&quot;lastName\\&quot;:\\&quot;Hopper\\&quot;\\n  },\\n  \\&quot;shopperEmail\\&quot;:\\&quot;s.hopper@example.com\\&quot;,\\n  \\&quot;shopperReference\\&quot;:\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  \\&quot;merchantAccount\\&quot;:\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;returnUrl\\&quot;:\\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;,\\n  \\&quot;countryCode\\&quot;:\\&quot;AU\\&quot;,\\n  \\&quot;telephoneNumber\\&quot;:\\&quot;+61 2 8520 3890\\&quot;,\\n  \\&quot;billingAddress\\&quot;:{\\n     \\&quot;city\\&quot;:\\&quot;Sydney\\&quot;,\\n     \\&quot;country\\&quot;:\\&quot;AU\\&quot;,\\n     \\&quot;houseNumberOrName\\&quot;:\\&quot;123\\&quot;,\\n     \\&quot;postalCode\\&quot;:\\&quot;2000\\&quot;,\\n     \\&quot;stateOrProvince\\&quot;:\\&quot;NSW\\&quot;,\\n     \\&quot;street\\&quot;:\\&quot;Happy Street\\&quot;\\n  },\\n  \\&quot;deliveryAddress\\&quot;:{\\n     \\&quot;city\\&quot;:\\&quot;Sydney\\&quot;,\\n     \\&quot;country\\&quot;:\\&quot;AU\\&quot;,\\n     \\&quot;houseNumberOrName\\&quot;:\\&quot;123\\&quot;,\\n     \\&quot;postalCode\\&quot;:\\&quot;2000\\&quot;,\\n     \\&quot;stateOrProvince\\&quot;:\\&quot;NSW\\&quot;,\\n     \\&quot;street\\&quot;:\\&quot;Happy Street\\&quot;\\n  },\\n  \\&quot;lineItems\\&quot;:[\\n     {\\n        \\&quot;description\\&quot;:\\&quot;Shoes\\&quot;,\\n        \\&quot;quantity\\&quot;:\\&quot;1\\&quot;,\\n        \\&quot;amountIncludingTax\\&quot;:\\&quot;400\\&quot;,\\n        \\&quot;amountExcludingTax\\&quot;: \\&quot;331\\&quot;,\\n        \\&quot;taxAmount\\&quot;: \\&quot;69\\&quot;,\\n        \\&quot;id\\&quot;:\\&quot;Item #1\\&quot;\\n     },\\n     {\\n        \\&quot;description\\&quot;:\\&quot;Socks\\&quot;,\\n        \\&quot;quantity\\&quot;:\\&quot;2\\&quot;,\\n        \\&quot;amountIncludingTax\\&quot;:\\&quot;300\\&quot;,\\n        \\&quot;amountExcludingTax\\&quot;: \\&quot;248\\&quot;,\\n        \\&quot;taxAmount\\&quot;: \\&quot;52\\&quot;,\\n        \\&quot;id\\&quot;:\\&quot;Item #2\\&quot;\\n     }\\n  ]\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v27.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;AUD\\&quot;)\\n  .value(1000L);\\n\\nLineItem lineItem1 = new LineItem()\\n  .quantity(1L)\\n  .amountExcludingTax(331L)\\n  .description(\\&quot;Shoes\\&quot;)\\n  .id(\\&quot;Item #1\\&quot;)\\n  .amountIncludingTax(400L)\\n  .taxAmount(69L);\\n\\nLineItem lineItem2 = new LineItem()\\n  .quantity(2L)\\n  .amountExcludingTax(248L)\\n  .description(\\&quot;Socks\\&quot;)\\n  .id(\\&quot;Item #2\\&quot;)\\n  .amountIncludingTax(300L)\\n  .taxAmount(52L);\\n\\nName name = new Name()\\n  .firstName(\\&quot;Simon\\&quot;)\\n  .lastName(\\&quot;Hopper\\&quot;);\\n\\nDeliveryAddress deliveryAddress = new DeliveryAddress()\\n  .country(\\&quot;AU\\&quot;)\\n  .stateOrProvince(\\&quot;NSW\\&quot;)\\n  .city(\\&quot;Sydney\\&quot;)\\n  .houseNumberOrName(\\&quot;123\\&quot;)\\n  .street(\\&quot;Happy Street\\&quot;)\\n  .postalCode(\\&quot;2000\\&quot;);\\n\\nAfterpayDetails afterpayDetails = new AfterpayDetails()\\n  .type(AfterpayDetails.TypeEnum.AFTERPAYTOUCH);\\n\\nBillingAddress billingAddress = new BillingAddress()\\n  .country(\\&quot;AU\\&quot;)\\n  .stateOrProvince(\\&quot;NSW\\&quot;)\\n  .city(\\&quot;Sydney\\&quot;)\\n  .houseNumberOrName(\\&quot;123\\&quot;)\\n  .street(\\&quot;Happy Street\\&quot;)\\n  .postalCode(\\&quot;2000\\&quot;);\\n\\nPaymentRequest paymentRequest = new PaymentRequest()\\n  .amount(amount)\\n  .telephoneNumber(\\&quot;+61 2 8520 3890\\&quot;)\\n  .shopperEmail(\\&quot;s.hopper@example.com\\&quot;)\\n  .reference(\\&quot;YOUR_ORDER_REFERENCE\\&quot;)\\n  .lineItems(Arrays.asList(lineItem1, lineItem2))\\n  .shopperName(name)\\n  .merchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  .deliveryAddress(deliveryAddress)\\n  .countryCode(\\&quot;AU\\&quot;)\\n  .paymentMethod(new CheckoutPaymentMethod(afterpayDetails))\\n  .billingAddress(billingAddress)\\n  .returnUrl(\\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;)\\n  .shopperReference(\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;);\\n\\n\\\/\\\/ Send the request\\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 v19.0.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\Amount;\\nuse Adyen\\\\Model\\\\Checkout\\\\LineItem;\\nuse Adyen\\\\Model\\\\Checkout\\\\Name;\\nuse Adyen\\\\Model\\\\Checkout\\\\DeliveryAddress;\\nuse Adyen\\\\Model\\\\Checkout\\\\CheckoutPaymentMethod;\\nuse Adyen\\\\Model\\\\Checkout\\\\BillingAddress;\\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;AUD\\&quot;)\\n  -&gt;setValue(1000);\\n\\n$lineItem1 = new LineItem();\\n$lineItem1\\n  -&gt;setQuantity(1)\\n  -&gt;setAmountExcludingTax(331)\\n  -&gt;setDescription(\\&quot;Shoes\\&quot;)\\n  -&gt;setId(\\&quot;Item #1\\&quot;)\\n  -&gt;setAmountIncludingTax(400)\\n  -&gt;setTaxAmount(69);\\n\\n$lineItem2 = new LineItem();\\n$lineItem2\\n  -&gt;setQuantity(2)\\n  -&gt;setAmountExcludingTax(248)\\n  -&gt;setDescription(\\&quot;Socks\\&quot;)\\n  -&gt;setId(\\&quot;Item #2\\&quot;)\\n  -&gt;setAmountIncludingTax(300)\\n  -&gt;setTaxAmount(52);\\n\\n$name = new Name();\\n$name\\n  -&gt;setFirstName(\\&quot;Simon\\&quot;)\\n  -&gt;setLastName(\\&quot;Hopper\\&quot;);\\n\\n$deliveryAddress = new DeliveryAddress();\\n$deliveryAddress\\n  -&gt;setCountry(\\&quot;AU\\&quot;)\\n  -&gt;setStateOrProvince(\\&quot;NSW\\&quot;)\\n  -&gt;setCity(\\&quot;Sydney\\&quot;)\\n  -&gt;setHouseNumberOrName(\\&quot;123\\&quot;)\\n  -&gt;setStreet(\\&quot;Happy Street\\&quot;)\\n  -&gt;setPostalCode(\\&quot;2000\\&quot;);\\n\\n$checkoutPaymentMethod = new CheckoutPaymentMethod();\\n$checkoutPaymentMethod\\n  -&gt;setType(\\&quot;afterpaytouch\\&quot;);\\n\\n$billingAddress = new BillingAddress();\\n$billingAddress\\n  -&gt;setCountry(\\&quot;AU\\&quot;)\\n  -&gt;setStateOrProvince(\\&quot;NSW\\&quot;)\\n  -&gt;setCity(\\&quot;Sydney\\&quot;)\\n  -&gt;setHouseNumberOrName(\\&quot;123\\&quot;)\\n  -&gt;setStreet(\\&quot;Happy Street\\&quot;)\\n  -&gt;setPostalCode(\\&quot;2000\\&quot;);\\n\\n$paymentRequest = new PaymentRequest();\\n$paymentRequest\\n  -&gt;setAmount($amount)\\n  -&gt;setTelephoneNumber(\\&quot;+61 2 8520 3890\\&quot;)\\n  -&gt;setShopperEmail(\\&quot;s.hopper@example.com\\&quot;)\\n  -&gt;setReference(\\&quot;YOUR_ORDER_REFERENCE\\&quot;)\\n  -&gt;setLineItems(array($lineItem1, $lineItem2))\\n  -&gt;setShopperName($name)\\n  -&gt;setMerchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setDeliveryAddress($deliveryAddress)\\n  -&gt;setCountryCode(\\&quot;AU\\&quot;)\\n  -&gt;setPaymentMethod($checkoutPaymentMethod)\\n  -&gt;setBillingAddress($billingAddress)\\n  -&gt;setReturnUrl(\\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;)\\n  -&gt;setShopperReference(\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;);\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\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 v17.0.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;AUD\\&quot;,\\n  Value = 1000\\n};\\n\\nLineItem lineItem1 = new LineItem\\n{\\n  Quantity = 1,\\n  AmountExcludingTax = 331,\\n  Description = \\&quot;Shoes\\&quot;,\\n  Id = \\&quot;Item #1\\&quot;,\\n  AmountIncludingTax = 400,\\n  TaxAmount = 69\\n};\\n\\nLineItem lineItem2 = new LineItem\\n{\\n  Quantity = 2,\\n  AmountExcludingTax = 248,\\n  Description = \\&quot;Socks\\&quot;,\\n  Id = \\&quot;Item #2\\&quot;,\\n  AmountIncludingTax = 300,\\n  TaxAmount = 52\\n};\\n\\nName name = new Name\\n{\\n  FirstName = \\&quot;Simon\\&quot;,\\n  LastName = \\&quot;Hopper\\&quot;\\n};\\n\\nDeliveryAddress deliveryAddress = new DeliveryAddress\\n{\\n  Country = \\&quot;AU\\&quot;,\\n  StateOrProvince = \\&quot;NSW\\&quot;,\\n  City = \\&quot;Sydney\\&quot;,\\n  HouseNumberOrName = \\&quot;123\\&quot;,\\n  Street = \\&quot;Happy Street\\&quot;,\\n  PostalCode = \\&quot;2000\\&quot;\\n};\\n\\nAfterpayDetails afterpayDetails = new AfterpayDetails\\n{\\n  Type = AfterpayDetails.TypeEnum.Afterpaytouch\\n};\\n\\nBillingAddress billingAddress = new BillingAddress\\n{\\n  Country = \\&quot;AU\\&quot;,\\n  StateOrProvince = \\&quot;NSW\\&quot;,\\n  City = \\&quot;Sydney\\&quot;,\\n  HouseNumberOrName = \\&quot;123\\&quot;,\\n  Street = \\&quot;Happy Street\\&quot;,\\n  PostalCode = \\&quot;2000\\&quot;\\n};\\n\\nPaymentRequest paymentRequest = new PaymentRequest\\n{\\n  Amount = amount,\\n  TelephoneNumber = \\&quot;+61 2 8520 3890\\&quot;,\\n  ShopperEmail = \\&quot;s.hopper@example.com\\&quot;,\\n  Reference = \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  LineItems = new List&lt;LineItem&gt;{ lineItem1, lineItem2 },\\n  ShopperName = name,\\n  MerchantAccount = \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  DeliveryAddress = deliveryAddress,\\n  CountryCode = \\&quot;AU\\&quot;,\\n  PaymentMethod = new CheckoutPaymentMethod(afterpayDetails),\\n  BillingAddress = billingAddress,\\n  ReturnUrl = \\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;,\\n  ShopperReference = \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;\\n};\\n\\n\\\/\\\/ Send the request\\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 v18.0.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  paymentMethod: {\\n    type: \\&quot;afterpaytouch\\&quot;\\n  },\\n  amount: {\\n    value: 1000,\\n    currency: \\&quot;AUD\\&quot;\\n  },\\n  shopperName: {\\n    firstName: \\&quot;Simon\\&quot;,\\n    lastName: \\&quot;Hopper\\&quot;\\n  },\\n  shopperEmail: \\&quot;s.hopper@example.com\\&quot;,\\n  shopperReference: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  reference: \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  returnUrl: \\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;,\\n  countryCode: \\&quot;AU\\&quot;,\\n  telephoneNumber: \\&quot;+61 2 8520 3890\\&quot;,\\n  billingAddress: {\\n    city: \\&quot;Sydney\\&quot;,\\n    country: \\&quot;AU\\&quot;,\\n    houseNumberOrName: \\&quot;123\\&quot;,\\n    postalCode: \\&quot;2000\\&quot;,\\n    stateOrProvince: \\&quot;NSW\\&quot;,\\n    street: \\&quot;Happy Street\\&quot;\\n  },\\n  deliveryAddress: {\\n    city: \\&quot;Sydney\\&quot;,\\n    country: \\&quot;AU\\&quot;,\\n    houseNumberOrName: \\&quot;123\\&quot;,\\n    postalCode: \\&quot;2000\\&quot;,\\n    stateOrProvince: \\&quot;NSW\\&quot;,\\n    street: \\&quot;Happy Street\\&quot;\\n  },\\n  lineItems: [ {\\n    description: \\&quot;Shoes\\&quot;,\\n    quantity: \\&quot;1\\&quot;,\\n    amountIncludingTax: \\&quot;400\\&quot;,\\n    amountExcludingTax: \\&quot;331\\&quot;,\\n    taxAmount: \\&quot;69\\&quot;,\\n    id: \\&quot;Item #1\\&quot;\\n  }, {\\n    description: \\&quot;Socks\\&quot;,\\n    quantity: \\&quot;2\\&quot;,\\n    amountIncludingTax: \\&quot;300\\&quot;,\\n    amountExcludingTax: \\&quot;248\\&quot;,\\n    taxAmount: \\&quot;52\\&quot;,\\n    id: \\&quot;Item #2\\&quot;\\n  } ]\\n}\\n\\n\\\/\\\/ Send the request\\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 v10.4.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;AUD\\&quot;,\\n  Value: 1000,\\n}\\n\\nlineItem1 := checkout.LineItem{\\n  Quantity: common.PtrInt64(1),\\n  AmountExcludingTax: common.PtrInt64(331),\\n  Description: common.PtrString(\\&quot;Shoes\\&quot;),\\n  Id: common.PtrString(\\&quot;Item #1\\&quot;),\\n  AmountIncludingTax: common.PtrInt64(400),\\n  TaxAmount: common.PtrInt64(69),\\n}\\n\\nlineItem2 := checkout.LineItem{\\n  Quantity: common.PtrInt64(2),\\n  AmountExcludingTax: common.PtrInt64(248),\\n  Description: common.PtrString(\\&quot;Socks\\&quot;),\\n  Id: common.PtrString(\\&quot;Item #2\\&quot;),\\n  AmountIncludingTax: common.PtrInt64(300),\\n  TaxAmount: common.PtrInt64(52),\\n}\\n\\nname := checkout.Name{\\n  FirstName: \\&quot;Simon\\&quot;,\\n  LastName: \\&quot;Hopper\\&quot;,\\n}\\n\\ndeliveryAddress := checkout.DeliveryAddress{\\n  Country: \\&quot;AU\\&quot;,\\n  StateOrProvince: common.PtrString(\\&quot;NSW\\&quot;),\\n  City: \\&quot;Sydney\\&quot;,\\n  HouseNumberOrName: \\&quot;123\\&quot;,\\n  Street: \\&quot;Happy Street\\&quot;,\\n  PostalCode: \\&quot;2000\\&quot;,\\n}\\n\\nafterpayDetails := checkout.AfterpayDetails{\\n  Type: \\&quot;afterpaytouch\\&quot;,\\n}\\n\\nbillingAddress := checkout.BillingAddress{\\n  Country: \\&quot;AU\\&quot;,\\n  StateOrProvince: common.PtrString(\\&quot;NSW\\&quot;),\\n  City: \\&quot;Sydney\\&quot;,\\n  HouseNumberOrName: \\&quot;123\\&quot;,\\n  Street: \\&quot;Happy Street\\&quot;,\\n  PostalCode: \\&quot;2000\\&quot;,\\n}\\n\\npaymentRequest := checkout.PaymentRequest{\\n  Amount: amount,\\n  TelephoneNumber: common.PtrString(\\&quot;+61 2 8520 3890\\&quot;),\\n  ShopperEmail: common.PtrString(\\&quot;s.hopper@example.com\\&quot;),\\n  Reference: \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  LineItems: []checkout.LineItem{\\n      lineItem1, lineItem2,\\n  },\\n  ShopperName: &amp;name,\\n  MerchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  DeliveryAddress: &amp;deliveryAddress,\\n  CountryCode: common.PtrString(\\&quot;AU\\&quot;),\\n  PaymentMethod: checkout.AfterpayDetailsAsCheckoutPaymentMethod(&amp;afterpayDetails),\\n  BillingAddress: &amp;billingAddress,\\n  ReturnUrl: \\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;,\\n  ShopperReference: common.PtrString(\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;),\\n}\\n\\n\\\/\\\/ Send the request\\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.5.1\\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;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;afterpaytouch\\&quot;\\n  },\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;value\\&quot;: 1000,\\n    \\&quot;currency\\&quot;: \\&quot;AUD\\&quot;\\n  },\\n  \\&quot;shopperName\\&quot;: {\\n    \\&quot;firstName\\&quot;: \\&quot;Simon\\&quot;,\\n    \\&quot;lastName\\&quot;: \\&quot;Hopper\\&quot;\\n  },\\n  \\&quot;shopperEmail\\&quot;: \\&quot;s.hopper@example.com\\&quot;,\\n  \\&quot;shopperReference\\&quot;: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;returnUrl\\&quot;: \\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;,\\n  \\&quot;countryCode\\&quot;: \\&quot;AU\\&quot;,\\n  \\&quot;telephoneNumber\\&quot;: \\&quot;+61 2 8520 3890\\&quot;,\\n  \\&quot;billingAddress\\&quot;: {\\n    \\&quot;city\\&quot;: \\&quot;Sydney\\&quot;,\\n    \\&quot;country\\&quot;: \\&quot;AU\\&quot;,\\n    \\&quot;houseNumberOrName\\&quot;: \\&quot;123\\&quot;,\\n    \\&quot;postalCode\\&quot;: \\&quot;2000\\&quot;,\\n    \\&quot;stateOrProvince\\&quot;: \\&quot;NSW\\&quot;,\\n    \\&quot;street\\&quot;: \\&quot;Happy Street\\&quot;\\n  },\\n  \\&quot;deliveryAddress\\&quot;: {\\n    \\&quot;city\\&quot;: \\&quot;Sydney\\&quot;,\\n    \\&quot;country\\&quot;: \\&quot;AU\\&quot;,\\n    \\&quot;houseNumberOrName\\&quot;: \\&quot;123\\&quot;,\\n    \\&quot;postalCode\\&quot;: \\&quot;2000\\&quot;,\\n    \\&quot;stateOrProvince\\&quot;: \\&quot;NSW\\&quot;,\\n    \\&quot;street\\&quot;: \\&quot;Happy Street\\&quot;\\n  },\\n  \\&quot;lineItems\\&quot;: [ {\\n    \\&quot;description\\&quot;: \\&quot;Shoes\\&quot;,\\n    \\&quot;quantity\\&quot;: \\&quot;1\\&quot;,\\n    \\&quot;amountIncludingTax\\&quot;: \\&quot;400\\&quot;,\\n    \\&quot;amountExcludingTax\\&quot;: \\&quot;331\\&quot;,\\n    \\&quot;taxAmount\\&quot;: \\&quot;69\\&quot;,\\n    \\&quot;id\\&quot;: \\&quot;Item #1\\&quot;\\n  }, {\\n    \\&quot;description\\&quot;: \\&quot;Socks\\&quot;,\\n    \\&quot;quantity\\&quot;: \\&quot;2\\&quot;,\\n    \\&quot;amountIncludingTax\\&quot;: \\&quot;300\\&quot;,\\n    \\&quot;amountExcludingTax\\&quot;: \\&quot;248\\&quot;,\\n    \\&quot;taxAmount\\&quot;: \\&quot;52\\&quot;,\\n    \\&quot;id\\&quot;: \\&quot;Item #2\\&quot;\\n  } ]\\n}\\n\\n# Send the request\\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.5.1\\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  :paymentMethod =&gt; {\\n    :type =&gt; 'afterpaytouch'\\n  },\\n  :amount =&gt; {\\n    :value =&gt; 1000,\\n    :currency =&gt; 'AUD'\\n  },\\n  :shopperName =&gt; {\\n    :firstName =&gt; 'Simon',\\n    :lastName =&gt; 'Hopper'\\n  },\\n  :shopperEmail =&gt; 's.hopper@example.com',\\n  :shopperReference =&gt; 'YOUR_UNIQUE_SHOPPER_ID',\\n  :reference =&gt; 'YOUR_ORDER_REFERENCE',\\n  :merchantAccount =&gt; 'ADYEN_MERCHANT_ACCOUNT',\\n  :returnUrl =&gt; 'adyencheckout:\\\/\\\/your.package.name',\\n  :countryCode =&gt; 'AU',\\n  :telephoneNumber =&gt; '+61 2 8520 3890',\\n  :billingAddress =&gt; {\\n    :city =&gt; 'Sydney',\\n    :country =&gt; 'AU',\\n    :houseNumberOrName =&gt; '123',\\n    :postalCode =&gt; '2000',\\n    :stateOrProvince =&gt; 'NSW',\\n    :street =&gt; 'Happy Street'\\n  },\\n  :deliveryAddress =&gt; {\\n    :city =&gt; 'Sydney',\\n    :country =&gt; 'AU',\\n    :houseNumberOrName =&gt; '123',\\n    :postalCode =&gt; '2000',\\n    :stateOrProvince =&gt; 'NSW',\\n    :street =&gt; 'Happy Street'\\n  },\\n  :lineItems =&gt; [ {\\n    :description =&gt; 'Shoes',\\n    :quantity =&gt; '1',\\n    :amountIncludingTax =&gt; '400',\\n    :amountExcludingTax =&gt; '331',\\n    :taxAmount =&gt; '69',\\n    :id =&gt; 'Item #1'\\n  }, {\\n    :description =&gt; 'Socks',\\n    :quantity =&gt; '2',\\n    :amountIncludingTax =&gt; '300',\\n    :amountExcludingTax =&gt; '248',\\n    :taxAmount =&gt; '52',\\n    :id =&gt; 'Item #2'\\n  } ]\\n}\\n\\n# Send the request\\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 v18.0.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;AUD\\&quot;,\\n  value: 1000\\n};\\n\\nconst lineItem1: Types.checkout.LineItem = {\\n  quantity: 1,\\n  amountExcludingTax: 331,\\n  description: \\&quot;Shoes\\&quot;,\\n  id: \\&quot;Item #1\\&quot;,\\n  amountIncludingTax: 400,\\n  taxAmount: 69\\n};\\n\\nconst lineItem2: Types.checkout.LineItem = {\\n  quantity: 2,\\n  amountExcludingTax: 248,\\n  description: \\&quot;Socks\\&quot;,\\n  id: \\&quot;Item #2\\&quot;,\\n  amountIncludingTax: 300,\\n  taxAmount: 52\\n};\\n\\nconst name: Types.checkout.Name = {\\n  firstName: \\&quot;Simon\\&quot;,\\n  lastName: \\&quot;Hopper\\&quot;\\n};\\n\\nconst deliveryAddress: Types.checkout.DeliveryAddress = {\\n  country: \\&quot;AU\\&quot;,\\n  stateOrProvince: \\&quot;NSW\\&quot;,\\n  city: \\&quot;Sydney\\&quot;,\\n  houseNumberOrName: \\&quot;123\\&quot;,\\n  street: \\&quot;Happy Street\\&quot;,\\n  postalCode: \\&quot;2000\\&quot;\\n};\\n\\nconst afterpayDetails: Types.checkout.AfterpayDetails = {\\n  type: Types.checkout.AfterpayDetails.TypeEnum.Afterpaytouch\\n};\\n\\nconst billingAddress: Types.checkout.BillingAddress = {\\n  country: \\&quot;AU\\&quot;,\\n  stateOrProvince: \\&quot;NSW\\&quot;,\\n  city: \\&quot;Sydney\\&quot;,\\n  houseNumberOrName: \\&quot;123\\&quot;,\\n  street: \\&quot;Happy Street\\&quot;,\\n  postalCode: \\&quot;2000\\&quot;\\n};\\n\\nconst paymentRequest: Types.checkout.PaymentRequest = {\\n  amount: amount,\\n  telephoneNumber: \\&quot;+61 2 8520 3890\\&quot;,\\n  shopperEmail: \\&quot;s.hopper@example.com\\&quot;,\\n  reference: \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n  lineItems: [lineItem1, lineItem2],\\n  shopperName: name,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  deliveryAddress: deliveryAddress,\\n  countryCode: \\&quot;AU\\&quot;,\\n  paymentMethod: afterpayDetails,\\n  billingAddress: billingAddress,\\n  returnUrl: \\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;,\\n  shopperReference: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;\\n};\\n\\n\\\/\\\/ Send the request\\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<p>In the  <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> response, check the <code>action<\/code> object for the information that you must use to redirect the shopper.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/payments response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"resultCode\\\":\\\"RedirectShopper\\\",\\n  \\\"action\\\":{\\n    \\\"paymentMethodType\\\":\\\"afterpaytouch\\\",\\n    \\\"method\\\":\\\"GET\\\",\\n    \\\"url\\\":\\\"https:\\\/\\\/checkoutshopper-test.adyen.com\\\/checkoutshopper\\\/checkoutPaymentRedirect?redirectData=...\\\",\\n    \\\"type\\\":\\\"redirect\\\"\\n  }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Pass the <code>action<\/code> object to your client app. You need this to initialize the Redirect Component.<\/p>\n<\/li>\n<\/ol>\n<h2>Handle the redirect<\/h2>\n<ol>\n<li>\n<p>Use the <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow\/?platform=Android&amp;integration=Components#handle-a-redirect\">Redirect Component<\/a> to redirect the shopper to Afterpay.<\/p>\n<\/li>\n<li>\n<p>After the shopper returns to your app, make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> request from your server, providing:<\/p>\n<ul>\n<li><code>details<\/code>: The <code>actionComponentData.details<\/code> object from the Redirect Component.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'\/payments\/details request'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v68\\\/payments\\\/details \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n     \\&quot;details\\&quot;: {\\n       \\&quot;redirectResult\\&quot;: \\&quot;eyJ0cmFuc1N0YXR1cyI6IlkifQ==\\&quot;\\n   }\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>You receive a response containing:<\/p>\n<ul>\n<li><code>resultCode<\/code>: Use this to present the payment result to your shopper.<\/li>\n<li><code>pspReference<\/code>: Our unique identifier for the transaction.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'\/payments\/details response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n      \\\"resultCode\\\": \\\"Authorised\\\",\\n      \\\"pspReference\\\": \\\"PPKFQ89R6QRXGN82\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2>Present the payment result<\/h2>\n<p>Use the <code>resultCode<\/code> that you received in the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> response to present the payment result to your shopper.<\/p>\n<p>The <code>resultCode<\/code> values you can receive for Afterpay are:<\/p>\n<table>\n<thead>\n<tr>\n<th>resultCode<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Authorised<\/strong><\/td>\n<td>The payment was successful.<\/td>\n<td>Inform the shopper that the payment was successful.<\/td>\n<\/tr>\n<tr>\n<td><strong>Cancelled<\/strong><\/td>\n<td>The shopper cancelled the payment.<\/td>\n<td>Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.<\/td>\n<\/tr>\n<tr>\n<td><strong>Pending<\/strong> or  <br> <strong>Received<\/strong><\/td>\n<td>The shopper has completed the payment but the final result is not yet known. It may take minutes or hours to confirm this.<\/td>\n<td>Inform the shopper that you have received their order, and are waiting for the payment to be completed. <br> To know the final result of the payment, wait for the <a href=\"\/pt\/development-resources\/webhooks\/webhook-types\">AUTHORISATION webhook<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Refused<\/strong><\/td>\n<td>The payment was refused by Afterpay.<\/td>\n<td>Ask the shopper to try the payment again using a different payment method.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a id=\"webhooks\"><\/a> If the shopper failed to return to your website or app, wait for webhooks to know the outcome of the payment:<\/p>\n<table>\n<thead>\n<tr>\n<th>eventCode<\/th>\n<th>success field<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>false<\/strong><\/td>\n<td>The transaction failed.<\/td>\n<td>Cancel the order and inform the shopper that the payment failed.<\/td>\n<\/tr>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>true<\/strong><\/td>\n<td>The shopper successfully completed the payment.<\/td>\n<td>Inform the shopper that the payment was successful and proceed with the order.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Capture the payment<\/h2>\n<p>Depending on your merchant account configuration, Afterpay payments are captured automatically after authorisation, or manually captured. If you prefer to capture the payment after the goods have been sent, you need to set up a <a href=\"\/pt\/online-payments\/capture#delayed-automatic-capture\">capture delay<\/a> or use <a href=\"\/pt\/online-payments\/capture#capture-a-payment\">manual capture<\/a>. To partially capture a payment, you also need to use manual capture.<\/p>\n<p>Afterpay payments have to be captured within 13 days after authorisation.<\/p>\n<p>During authorisation, the shopper is charged for the first installment. If the payment is not captured within 13 days, before the second installment, Afterpay cancels the payment and refunds the first installment to the shopper.<\/p>\n<div class=\"notices blue\">\n<p>For testing purposes, Afterpay authorisations expire in one day. When you use manual capture, you need to capture test Afterpay payments within one day after authorisation.<\/p>\n<\/div>\n<h3 id=\"partial-captures\">Full or partial manual captures<\/h3>\n<p>When you use manual capture, in your  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/captures\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/{paymentPspReference}\/captures<\/a> request specify:<\/p>\n<ul>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/captures#request-amount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.value<\/a>: the full or partial amount that the shopper should pay.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/captures#request-lineItems\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">lineItems<\/a>: (optional) price and product information for the items that the shopper should pay for.<\/li>\n<\/ul>\n<p>Any unclaimed amount that is left over after partially capturing a payment is automatically cancelled. When your account is enabled for <em>multiple<\/em> partial captures, the unclaimed amount after an initial capture is not automatically cancelled.<\/p>\n<div class=\"sc-notice info\"><div>\n<p>To set up multiple partial captures, 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>. Multiple partial captures will create a new invoice for each capture.<\/p>\n<\/div><\/div>\n<h2>Discounts<\/h2>\n<p>To offer discounts, your payment request must include the negative amount to be added to the original price. The following example shows how to specify a discount of 1 AUD on Item #2:<\/p>\n<pre><code class=\"language-json\">{\n  \"amount\":{\n     \"value\":800,\n     \"currency\":\"AUD\"\n  },\n  ...\n  \"lineItems\":[\n\n     {\n        \"description\":\"Test Afterpay 1\",\n        \"quantity\":\"1\",\n        \"amountIncludingTax\":\"400\",\n        \"id\":\"Item #1\"\n     },\n     {\n        \"description\":\"Test Afterpay 2\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"300\",\n        \"id\":\"Item #2\"\n     }\n\n     {\n        \"description\":\"Discount\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"-100\",\n        \"id\":\"Item #2 Discount\"\n     }\n  ]\n}<\/code><\/pre>\n<h2>Refunds and cancellations<\/h2>\n<p>If a payment has not yet been captured, you can <a href=\"\/pt\/online-payments\/cancel\">cancel<\/a> it. If a payment has already been captured and you want to return the funds to the shopper, you need to <a href=\"\/pt\/online-payments\/refund\">refund<\/a> the payment.<\/p>\n<h3 id=\"partial-refunds\">Full or partial refunds<\/h3>\n<p>To fully or partially refund a payment, in your  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/{paymentPspReference}\/refunds<\/a> request specify:<\/p>\n<ul>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-amount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.value<\/a>: the full or partial amount to be refunded to the shopper.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-lineItems\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">lineItems<\/a>: (optional) price and product information about the refunded items.<\/li>\n<\/ul>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>To test Afterpay payments, you need a test shopper account in the Afterpay sandbox environment. If you are testing in multiple countries or regions, create a different test account for each.<\/p>\n<p>To create a test account:<\/p>\n<ol>\n<li>Go to <a href=\"https:\/\/portal.sandbox.afterpay.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">https:\/\/portal.sandbox.afterpay.com\/<\/a>.<\/li>\n<li>Enter a real email address and select <strong>Continue<\/strong>. You'll get confirmations of payments and refunds like any other shopper on this email address.<\/li>\n<li>From the drop-down menu, select the country\/region for which you want to create a test shopper account. Select <strong>Australia<\/strong>, <strong>New Zealand<\/strong>, <strong>US<\/strong>, or <strong>Canada<\/strong>.<\/li>\n<li>Enter a unique mobile number in the correct format and select <strong>Continue<\/strong>. Ensure the number is not associated with an existing account to avoid being redirected to a login page.<\/li>\n<li>When you are prompted to enter your SMS verification code, enter <strong>111111<\/strong>.<\/li>\n<li>Follow the instructions on your screen to complete your profile, accept the terms and conditions, and select <strong>Continue<\/strong>.<\/li>\n<\/ol>\n<p> <\/p>\n<p>To test payments, add a test card to your Afterpay test shopper account.<\/p>\n<p>You can use the card details provided in the <a href=\"https:\/\/developers.afterpay.com\/afterpay-online-developer\/home\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Afterpay developer documentation<\/a>, or use one of the Adyen <a href=\"\/pt\/development-resources\/test-cards-and-credentials\/test-card-numbers\">test cards<\/a>. Use CVV 000 to simulate authorised payments, or CVV 051 to simulate refused payments.<\/p>\n<p> <\/p>\n<p>You can check the status of test payments in your\u00a0<a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>\u00a0&gt;\u00a0<strong>Transactions<\/strong>\u00a0&gt;\u00a0<strong>Payments<\/strong>.<\/p>\n<p> <\/p>\n<p>Before you can accept live Afterpay payments, you need to <a href=\"\/pt\/payment-methods\/add-payment-methods\">submit a request for Afterpay<\/a> in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a>.<\/p>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components\"\n                        target=\"_self\"\n                        >\n                    Android Components integration guide\n                <\/a><\/li><li><a href=\"\/development-resources\/webhooks\"\n                        target=\"_self\"\n                        >\n                    Webhooks\n                <\/a><\/li><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/overview\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    API Explorer\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/afterpaytouch\/android-component","articleFields":{"description":"Add Afterpay to an existing Components integration.","last_edit_on":"01-10-2019 14:19","parameters":{"payment_method":"Afterpay","payment_method_uk":"Clearpay","country_code":"AU","currency_code":"AUD","country_code_uk":"GB","currency_code_uk":"GBP","city":"Sydney","city_uk":"London","housenumberorname":123,"housenumberorname_uk":"8-10","postalcode":2000,"postalcode_uk":"SW1H 0BG","street":"Happy Street","street_uk":"Broadway","stateorprovince":"NSW","stateorprovince_uk":"Westminster","payment_method_type":"afterpaytouch","payment_method_type_uk":"clearpay","shopper_email":"s.hopper@example.com","telephone_number":"+61 2 8520 3890","telephone_number_uk":"+44 203 936 4029","return_url":"adyencheckout:\/\/your.package.name","module_import":"instant","android_component":"InstantPaymentComponent","integration":"Components","platform":"Android"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/afterpaytouch\/android-component","title":"Afterpay Redirect Component","content":"\nIf you are using Android Components v5.0.0 or later:\nThis payment method requires no additional configuration.\nFollow the  Components integration guide and use the following module and Component names:\n\nTo import the module: instant\nTo launch and show the Component: InstantPaymentComponent\n\n\nYou can use our Redirect Component to handle the redirect to Afterpay.\nWhen adding Afterpay to your existing Components integration, you also need to:\n\nShow Afterpay in your payment form.\nCollect shopper details, and specify these in your payment request.\nAfterpay uses these for risk checks.\nProvide information about the purchased items in your payment request.\nHandle the redirect result when the shopper returns to your website.\n\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built an Advanced flow Android Components integration. \n\n\nSetup steps\nBefore you begin, add Afterpay in your Customer Area.\n\n\n\nShow Afterpay in your payment form\nInclude Afterpay in the list of available payment methods, and collect the required shopper details:\n\n\nSpecify in your  \/paymentMethods request one of the following combinations of  countryCode and  amount.currency&#58;\n\n\n\nCountry\/region\ncountryCode\namount.currency\n\n\n\n\nAustralia\nAU\nAUD\n\n\nNew Zealand\nNZ\nNZD\n\n\nCanada\nCA\nCAD\n\n\n\nThe response contains paymentMethod.type: afterpaytouch.\n\n\nCollect the following shopper details:\n\nFull name\nEmail address\nBilling address and delivery address.\n\nAfterpay uses these information for risk checks.\n\n\n\nWe provide an Afterpay logo which you can use on your payment form. For more information, refer to Downloading logos.\n\nMake a payment\n\n\nWhen the shopper proceeds to pay, make a  \/payments request from your server, specifying:\n\n\npaymentMethod.type: set this to afterpaytouch to redirect to Afterpay.\n\n\n shopperName&#58;\u00a0the shopper's full name.\u00a0\n\n\n shopperEmail&#58; the shopper's email address.\u00a0\u00a0\n\n\n telephoneNumber (Optional)&#58; the shopper's phone number.\n\n\n billingAddress&#58;\u00a0the postal address to be included on the invoice.\u00a0\n\n\n deliveryAddress&#58;\u00a0the postal address where the goods will be shipped.\n\n\n lineItems&#58; price and product information about the purchased items.\u00a0\u00a0\n\n\nreturnURL: URL to where the shopper should be redirected back to after they complete the payment. Get this URL from the Component in the RedirectComponent.getReturnUrl(context).\n\n\n\n\n\nIn the  \/payments response, check the action object for the information that you must use to redirect the shopper.\n\n\n\n\n\nPass the action object to your client app. You need this to initialize the Redirect Component.\n\n\nHandle the redirect\n\n\nUse the Redirect Component to redirect the shopper to Afterpay.\n\n\nAfter the shopper returns to your app, make a POST  \/payments\/details request from your server, providing:\n\ndetails: The actionComponentData.details object from the Redirect Component.\n\n\n\n\n    \n\nYou receive a response containing:\n\nresultCode: Use this to present the payment result to your shopper.\npspReference: Our unique identifier for the transaction.\n\n\n    \n\nPresent the payment result\nUse the resultCode that you received in the  \/payments\/details response to present the payment result to your shopper.\nThe resultCode values you can receive for Afterpay are:\n\n\n\nresultCode\nDescription\nAction to take\n\n\n\n\nAuthorised\nThe payment was successful.\nInform the shopper that the payment was successful.\n\n\nCancelled\nThe shopper cancelled the payment.\nAsk the shopper whether they want to continue with the order, or ask them to select a different payment method.\n\n\nPending or   Received\nThe shopper has completed the payment but the final result is not yet known. It may take minutes or hours to confirm this.\nInform the shopper that you have received their order, and are waiting for the payment to be completed.  To know the final result of the payment, wait for the AUTHORISATION webhook.\n\n\nRefused\nThe payment was refused by Afterpay.\nAsk the shopper to try the payment again using a different payment method.\n\n\n\n If the shopper failed to return to your website or app, wait for webhooks to know the outcome of the payment:\n\n\n\neventCode\nsuccess field\nDescription\nAction to take\n\n\n\n\nAUTHORISATION\nfalse\nThe transaction failed.\nCancel the order and inform the shopper that the payment failed.\n\n\nAUTHORISATION\ntrue\nThe shopper successfully completed the payment.\nInform the shopper that the payment was successful and proceed with the order.\n\n\n\nCapture the payment\nDepending on your merchant account configuration, Afterpay payments are captured automatically after authorisation, or manually captured. If you prefer to capture the payment after the goods have been sent, you need to set up a capture delay or use manual capture. To partially capture a payment, you also need to use manual capture.\nAfterpay payments have to be captured within 13 days after authorisation.\nDuring authorisation, the shopper is charged for the first installment. If the payment is not captured within 13 days, before the second installment, Afterpay cancels the payment and refunds the first installment to the shopper.\n\nFor testing purposes, Afterpay authorisations expire in one day. When you use manual capture, you need to capture test Afterpay payments within one day after authorisation.\n\nFull or partial manual captures\nWhen you use manual capture, in your  \/payments\/{paymentPspReference}\/captures request specify:\n\n amount.value: the full or partial amount that the shopper should pay.\n lineItems: (optional) price and product information for the items that the shopper should pay for.\n\nAny unclaimed amount that is left over after partially capturing a payment is automatically cancelled. When your account is enabled for multiple partial captures, the unclaimed amount after an initial capture is not automatically cancelled.\n\nTo set up multiple partial captures, contact our Support Team. Multiple partial captures will create a new invoice for each capture.\n\nDiscounts\nTo offer discounts, your payment request must include the negative amount to be added to the original price. The following example shows how to specify a discount of 1 AUD on Item #2:\n{\n  \"amount\":{\n     \"value\":800,\n     \"currency\":\"AUD\"\n  },\n  ...\n  \"lineItems\":[\n\n     {\n        \"description\":\"Test Afterpay 1\",\n        \"quantity\":\"1\",\n        \"amountIncludingTax\":\"400\",\n        \"id\":\"Item #1\"\n     },\n     {\n        \"description\":\"Test Afterpay 2\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"300\",\n        \"id\":\"Item #2\"\n     }\n\n     {\n        \"description\":\"Discount\",\n        \"quantity\":\"2\",\n        \"amountIncludingTax\":\"-100\",\n        \"id\":\"Item #2 Discount\"\n     }\n  ]\n}\nRefunds and cancellations\nIf a payment has not yet been captured, you can cancel it. If a payment has already been captured and you want to return the funds to the shopper, you need to refund the payment.\nFull or partial refunds\nTo fully or partially refund a payment, in your  \/payments\/{paymentPspReference}\/refunds request specify:\n\n amount.value: the full or partial amount to be refunded to the shopper.\n lineItems: (optional) price and product information about the refunded items.\n\nTest and go live\nTo test Afterpay payments, you need a test shopper account in the Afterpay sandbox environment. If you are testing in multiple countries or regions, create a different test account for each.\nTo create a test account:\n\nGo to https:\/\/portal.sandbox.afterpay.com\/.\nEnter a real email address and select Continue. You'll get confirmations of payments and refunds like any other shopper on this email address.\nFrom the drop-down menu, select the country\/region for which you want to create a test shopper account. Select Australia, New Zealand, US, or Canada.\nEnter a unique mobile number in the correct format and select Continue. Ensure the number is not associated with an existing account to avoid being redirected to a login page.\nWhen you are prompted to enter your SMS verification code, enter 111111.\nFollow the instructions on your screen to complete your profile, accept the terms and conditions, and select Continue.\n\n \nTo test payments, add a test card to your Afterpay test shopper account.\nYou can use the card details provided in the Afterpay developer documentation, or use one of the Adyen test cards. Use CVV 000 to simulate authorised payments, or CVV 051 to simulate refused payments.\n \nYou can check the status of test payments in your\u00a0Customer Area\u00a0&gt;\u00a0Transactions\u00a0&gt;\u00a0Payments.\n \nBefore you can accept live Afterpay payments, you need to submit a request for Afterpay in your live Customer Area.\nSee also\n\n\n                    Android Components integration guide\n                \n                    Webhooks\n                \n                    API Explorer\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Afterpay","lvl3":"Afterpay Redirect Component"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/afterpaytouch","lvl3":"\/pt\/payment-methods\/afterpaytouch\/android-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["Afterpay","Redirect","Component"]},"articleFiles":{"payments.js":"<p alt=\"\">payments.js<\/p>"}}
