{"title":"PayMe Redirect Component","category":"default","creationDate":1776961628,"content":"<p>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 the PayMe app. When adding PayMe to your existing Components integration, you also need to:<\/p>\n<ol>\n<li><a href=\"#show-in-payment-form\">Show PayMe in your payment form<\/a>.<\/li>\n<li><a href=\"#handle-the-redirect\">Handle the redirect result<\/a> when the shopper returns to your app.<\/li>\n<\/ol>\n<div class=\"notices green\">\n<p>PayMe is supported from Android Components version 4.0.0.<\/p>\n<\/div>\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 your <a href=\"\/pt\/online-payments\/build-your-integration\">Anddroid 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 PayMe in your test Customer Area<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"show-in-payment-form\">Show PayMe in your payment form<\/h2>\n<p>Include PayMe in the list of available payment methods.<\/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:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/PaymentSetupAndVerificationService\/latest\/paymentMethods\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">countryCode<\/a>: <span translate=\"no\"><strong>HK<\/strong><\/span>.<\/li>\n<li> <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; <span translate=\"no\"><strong>HKD<\/strong><\/span>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>The response contains <code>paymentMethod.type<\/code>: <span translate=\"no\"><strong>payme<\/strong><\/span>.<\/p>\n<h2>Make a payment<\/h2>\n<ol>\n<li>When the shopper selects the button 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, specifying:<\/li>\n<\/ol>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter name<\/th>\n<th>Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>paymentMethod.type<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>payme<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>returnURL<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The URL to redirect the shopper back to after they complete the payment. Get this URL from the Component in the <code>RedirectComponent.getReturnUrl(context)<\/code>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>channel<\/code><\/td>\n<td><\/td>\n<td style=\"text-align: left;\">To determine whether the shopper is using a desktop, laptop or mobile.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/sessions#request-lineItems-quantity\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\n  <code>lineItems.quantity<\/code>\n<\/a><\/td>\n<td><\/td>\n<td style=\"text-align: left;\">The number of items. Must be between 0 and 9999.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/sessions#request-lineItems-sku\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\n  <code>lineItems.sku<\/code>\n<\/a><\/td>\n<td><\/td>\n<td style=\"text-align: left;\">The stock keeping unit. Maximum length 200 characters.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/sessions#request-lineItems-description\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\n  <code>lineItems.description<\/code>\n<\/a><\/td>\n<td><\/td>\n<td style=\"text-align: left;\">The order description to display to the shopper. Maximum length 200 characters.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/sessions#request-lineItems-amountIncludingTax\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\n  <code>lineItems.amountIncludingTax<\/code>\n<\/a><\/td>\n<td><\/td>\n<td style=\"text-align: left;\">Item amount including the tax, in minor units. Must be between 1 and 100000000.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/sessions#request-lineItems-itemCategory\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\n  <code>lineItems.itemCategory<\/code>\n<\/a><\/td>\n<td><\/td>\n<td style=\"text-align: left;\">The item category. Maximum length 200 characters.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'\/payments request'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;kotlin&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;const {Client, Config, CheckoutAPI} = require('@adyen\\\/api-library');\\nconst config = new Config();\\n\\\/\\\/ Set ADYEN_API_KEY with your API key from the Customer Area.\\nconfig.apiKey = 'ADYEN_API_KEY';\\nconfig.merchantAccount = '[MERCHANT_ACCOUNT]';\\nconst client = new Client({ config });\\nclient.setEnvironment(\\&quot;TEST\\&quot;);\\nconst checkout = new CheckoutAPI(client);\\ncheckout.payments({\\n    \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;payme\\&quot;\\n    },\\n    \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;HKD\\&quot;,\\n    \\&quot;value\\&quot;: 4200\\n    },\\n    \\&quot;countryCode\\&quot;: \\&quot;HK\\&quot;,\\n    \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n    \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_REFERENCE\\&quot;,\\n    \\&quot;returnUrl\\&quot;: \\&quot;https:\\\/\\\/your-company.example.com\\\/...\\&quot;,\\n    \\&quot;channel\\&quot;:\\&quot;Android\\&quot;,\\n    \\&quot;lineItems\\&quot;: [\\n    {\\n        \\&quot;quantity\\&quot;: \\&quot;1\\&quot;,\\n        \\&quot;sku\\&quot;: \\&quot;3232\\&quot;,\\n        \\&quot;description\\&quot;: \\&quot;Shoes\\&quot;,\\n        \\&quot;amountIncludingTax\\&quot;: 4200,\\n        \\&quot;itemCategory\\&quot;: \\&quot;Fashion\\&quot;\\n    }\\n    ]\\n})&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>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 contains:<\/p>\n<ul>\n<li>\n<p><code>action<\/code>: Object containing information about the redirect.<\/p>\n<pre><code>~~~~ json\n{\n\"resultCode\": \"RedirectShopper\",\n\"action\": {\n    \"expiresAt\": \"2021-01-30T16:09:09Z\",\n    \"paymentMethodType\": \"payme\",\n    \"url\": \"https:\/\/qr.payme.hsbc.com.hk\/...\",\n    \"method\": \"GET\",\n    \"type\": \"redirect\"\n    }\n}\n\n~~~~<\/code><\/pre>\n<\/li>\n<\/ul>\n<ol>\n<li>Pass the <code>action<\/code> object to your client app. You need this to initialize the Redirect Component.<\/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 PayMe.<\/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<p>See the <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components\">Android Components integration guide<\/a> to get the payment outcome and show your shopper the result of the payment.<\/p>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>Use the PayMe sandbox to test your integration. You do not need to use the PayMe app to test using the sandbox.<\/p>\n<p>Use the amounts specified below to simulate different payment outcomes.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Amount ending in<\/th>\n<th>Result<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">30 or 81<\/td>\n<td>Authorised<\/td>\n<td style=\"text-align: left;\">Successful payment.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">77 or 90<\/td>\n<td>OfferCancelled<\/td>\n<td style=\"text-align: left;\">The payment request expired after PayMe's default expiry time of ten minutes.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">40 or 44<\/td>\n<td>Error<\/td>\n<td style=\"text-align: left;\">There was an error when creating the payment request.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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\/payme\/android-component","articleFields":{"description":"Add PayMe to an existing Components integration.","parameters":{"payment_method":"PayMe","payment_method_type":"payme","integration_guide_url":"build-your-integration\/sessions-flow?platform=Android&integration=Components","integration":"Components","platform":"Anddroid"},"id":"47481283","type":"page","_expandable":{"operations":""},"status":"current"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/payme\/android-component","title":"PayMe Redirect Component","content":"Use our Redirect Component to handle the redirect to the PayMe app. When adding PayMe to your existing Components integration, you also need to:\n\nShow PayMe in your payment form.\nHandle the redirect result when the shopper returns to your app.\n\n\nPayMe is supported from Android Components version 4.0.0.\n\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built your Anddroid Components integration.  \n\n\nSetup steps\nBefore you begin, add PayMe in your test Customer Area.\n\n\n\nShow PayMe in your payment form\nInclude PayMe in the list of available payment methods.\n\n\nSpecify in your  \/paymentMethods request:\n\ncountryCode: HK.\n amount.currency&#58; HKD.\n\n\n\nThe response contains paymentMethod.type: payme.\nMake a payment\n\nWhen the shopper selects the button to pay, make a  \/payments request, specifying:\n\n\n\n\nParameter name\nRequired\nDescription\n\n\n\n\npaymentMethod.type\n\npayme\n\n\nreturnURL\n\nThe URL to redirect the shopper back to after they complete the payment. Get this URL from the Component in the RedirectComponent.getReturnUrl(context).\n\n\nchannel\n\nTo determine whether the shopper is using a desktop, laptop or mobile.\n\n\n\n  lineItems.quantity\n\n\nThe number of items. Must be between 0 and 9999.\n\n\n\n  lineItems.sku\n\n\nThe stock keeping unit. Maximum length 200 characters.\n\n\n\n  lineItems.description\n\n\nThe order description to display to the shopper. Maximum length 200 characters.\n\n\n\n  lineItems.amountIncludingTax\n\n\nItem amount including the tax, in minor units. Must be between 1 and 100000000.\n\n\n\n  lineItems.itemCategory\n\n\nThe item category. Maximum length 200 characters.\n\n\n\n\n    \n\nThe  \/payments response contains:\n\n\naction: Object containing information about the redirect.\n~~~~ json\n{\n\"resultCode\": \"RedirectShopper\",\n\"action\": {\n    \"expiresAt\": \"2021-01-30T16:09:09Z\",\n    \"paymentMethodType\": \"payme\",\n    \"url\": \"https:\/\/qr.payme.hsbc.com.hk\/...\",\n    \"method\": \"GET\",\n    \"type\": \"redirect\"\n    }\n}\n\n~~~~\n\n\n\nPass the action object to your client app. You need this to initialize the Redirect Component.\n\nHandle the redirect\n\n\nUse the Redirect Component to redirect the shopper to PayMe.\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\nSee the Android Components integration guide to get the payment outcome and show your shopper the result of the payment.\nTest and go live\nUse the PayMe sandbox to test your integration. You do not need to use the PayMe app to test using the sandbox.\nUse the amounts specified below to simulate different payment outcomes.\n\n\n\nAmount ending in\nResult\nDescription\n\n\n\n\n30 or 81\nAuthorised\nSuccessful payment.\n\n\n77 or 90\nOfferCancelled\nThe payment request expired after PayMe's default expiry time of ten minutes.\n\n\n40 or 44\nError\nThere was an error when creating the payment request.\n\n\n\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":"PayMe","lvl3":"PayMe 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\/payme","lvl3":"\/pt\/payment-methods\/payme\/android-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["PayMe","Redirect","Component"]}}
