{"title":"Level 2\/3 data for Hosted Payment Pages","category":"default","creationDate":1776961627,"content":"<div class=\"sc-notice warning\"><div>\n<p><strong>Hosted Payment Pages are no longer available<\/strong><\/p>\n<p>To accept payments through an Adyen-hosted page, use our <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Web&amp;integration=Hosted%2BCheckout\">Hosted Checkout<\/a>.<\/p>\n<p>This page is for the classic Hosted Payment Pages (HPP) integration, which has reached end-of-life.  We are no longer processing transactions though HPP.<\/p>\n<\/div><\/div>\n<p>Level 2 or Level 3 (L2\/L3) data provides commercial shoppers with additional information about purchases on their card statements. It allows companies to track how much is spent on their corporate cards where a single card may have multiple users.<\/p>\n<p>Companies can also track the amount of sales tax to pay or reconcile transactions using a unique customer code. Transactions submitted with L2\/L3 data that meet requirements have lower interchange rates.<\/p>\n<h2 id=\"code-example\">Code example<\/h2>\n<p>Below is a code example for submitting L2\/L3 data in an authorisation using the Adyen Hosted Payment Pages (HPP):<\/p>\n<pre><code class=\"language-php\">&lt;?php    \/*\n     This PHP code provides a payment form for the Adyen Hosted Payment Pages\n     *\/\n\n    \/*\n     account details\n     $skinCode:        the skin to be used\n     $merchantAccount: the merchant account we want to process this payment with.\n     $sharedSecret:    the shared HMAC key.\n     *\/\n\n    $skinCode        = \"[skin code e.g. GBIMwmE4]\";\n    $merchantAccount = \"[merchant Account e.g. TestCompanyCOM]\";\n    $hmacKey         = \"[HMAC key e.g. D21EB2ASD44BA234C8A0AF13CF0BCACA3D4727C6162630D712C857124B213270]\";\n\n    \/*\n     payment-specific details\n     *\/\n\n    $params = array(\n                    \"merchantReference\" =&gt; \"SKINTEST-1435226439255\",\n                    \"merchantAccount\"   =&gt;  $merchantAccount,\n                    \"currencyCode\"      =&gt; \"USD\",\n                    \"paymentAmount\"     =&gt; \"1190\",\n                    \"sessionValidity\"   =&gt; \"2020-07-11T07:07:13-08:00\",\n                    \"shopperLocale\"     =&gt; \"en_GB\",\n                    \"skinCode\"          =&gt; $skinCode,\n                    \"brandCode\"         =&gt; \"\",\n                    \"shopperEmail\"      =&gt; \"test@adyen.com\",\n                    \"shopperReference\"  =&gt; \"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\",\n\n                    \/\/ L2\/l3 Data lines\n                    \"enhancedSchemeData.destinationPostalCode\" =&gt; \"94025-1452\",\n                    \"enhancedSchemeData.shipFromPostalCode\" =&gt; \"94025-1452\",\n                    \"enhancedSchemeData.destinationStateProvinceCode\" =&gt; \"CA\",\n                    \"enhancedSchemeData.destinationCountryCode\" =&gt; \"US\",\n                    \"enhancedSchemeData.freightAmount\" =&gt; \"0\",\n                    \"enhancedSchemeData.dutyAmount\" =&gt; \"0\",\n                    \"enhancedSchemeData.orderDate\" =&gt; \"290518\",\n                    \"enhancedSchemeData.customerReference\" =&gt; \"100001\",\n                    \"enhancedSchemeData.totalTaxAmount\" =&gt; \"190\",\n                    \"enhancedSchemeData.itemDetailLine1.commodityCode\" =&gt; \"82101603\",\n                    \"enhancedSchemeData.itemDetailLine1.description\" =&gt; \"Ads\",\n                    \"enhancedSchemeData.itemDetailLine1.productCode\" =&gt; \"Ads\",\n                    \"enhancedSchemeData.itemDetailLine1.quantity\" =&gt; \"1\",\n                    \"enhancedSchemeData.itemDetailLine1.unitOfMeasure\" =&gt; \"EAC\",\n                    \"enhancedSchemeData.itemDetailLine1.unitPrice\" =&gt; \"1000\",\n                    \"enhancedSchemeData.itemDetailLine1.totalAmount\" =&gt; \"1190\",\n\n    );\n\n    \/*\n     process fields\n     *\/\n\n    \/\/ The character escape function\n    $escapeval = function($val) {\n        return str_replace(':','\\\\:',str_replace('\\\\','\\\\\\\\',$val));\n    };\n\n    \/\/ Sort the array by key using SORT_STRING order\n    ksort($params, SORT_STRING);\n\n    \/\/ Generate the signing data string\n    $signData = implode(\":\",array_map($escapeval,array_merge(array_keys($params), array_values($params))));\n\n    \/\/ base64-encode the binary result of the HMAC computation\n    $merchantSig = base64_encode(hash_hmac('sha256',$signData,pack(\"H*\" , $hmacKey),true));\n    $params[\"merchantSig\"] = $merchantSig;\n\n    ?&gt;\n\n&lt;!-- Complete submission form --&gt;\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN\"\n\"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd\"&gt;\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\" xml:lang=\"en\" lang=\"en\"&gt;\n&lt;head&gt;\n&lt;title&gt;Adyen Payment&lt;\/title&gt;\n&lt;meta http-equiv=\"content-type\" content=\"text\/html; charset=UTF-8\" \/&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;form name=\"adyenForm\" action=\"https:\/\/test.adyen.com\/hpp\/select.shtml\" method=\"post\"&gt;\n&lt;?php\n    foreach ($params as $key =&gt; $value){\n        echo '        &lt;input type=\"hidden\" name=\"' .htmlspecialchars($key,   ENT_COMPAT | ENT_HTML401 ,'UTF-8').\n        '\" value=\"' .htmlspecialchars($value, ENT_COMPAT | ENT_HTML401 ,'UTF-8') . '\" \/&gt;' .\"\\n\" ;\n    }\n    ?&gt;\n&lt;input type=\"submit\" value=\"Submit\" \/&gt;\n&lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>","url":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations\/hosted-payment-pages\/hpp-payments-with-l2l3-data","articleFields":{"id":"39953520","type":"page","_expandable":{"operations":""},"status":"current","sitemap":{"priority":0.3},"parameters":{"anchor_new":"<a href=\"\/payment-methods\/cards\/send-additional-data-for-cards\/send-level-2-3-data-for-commercial-cards\">Level 2\/3 data<\/a>","parent_page":"classic Hosted Payment Pages (HPP)","new_desc":"integrating using our Checkout APIs"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations\/hosted-payment-pages\/hpp-payments-with-l2l3-data","title":"Level 2\/3 data for Hosted Payment Pages","content":"\nHosted Payment Pages are no longer available\nTo accept payments through an Adyen-hosted page, use our Hosted Checkout.\nThis page is for the classic Hosted Payment Pages (HPP) integration, which has reached end-of-life.  We are no longer processing transactions though HPP.\n\nLevel 2 or Level 3 (L2\/L3) data provides commercial shoppers with additional information about purchases on their card statements. It allows companies to track how much is spent on their corporate cards where a single card may have multiple users.\nCompanies can also track the amount of sales tax to pay or reconcile transactions using a unique customer code. Transactions submitted with L2\/L3 data that meet requirements have lower interchange rates.\nCode example\nBelow is a code example for submitting L2\/L3 data in an authorisation using the Adyen Hosted Payment Pages (HPP):\n&lt;?php    \/*\n     This PHP code provides a payment form for the Adyen Hosted Payment Pages\n     *\/\n\n    \/*\n     account details\n     $skinCode:        the skin to be used\n     $merchantAccount: the merchant account we want to process this payment with.\n     $sharedSecret:    the shared HMAC key.\n     *\/\n\n    $skinCode        = \"[skin code e.g. GBIMwmE4]\";\n    $merchantAccount = \"[merchant Account e.g. TestCompanyCOM]\";\n    $hmacKey         = \"[HMAC key e.g. D21EB2ASD44BA234C8A0AF13CF0BCACA3D4727C6162630D712C857124B213270]\";\n\n    \/*\n     payment-specific details\n     *\/\n\n    $params = array(\n                    \"merchantReference\" =&gt; \"SKINTEST-1435226439255\",\n                    \"merchantAccount\"   =&gt;  $merchantAccount,\n                    \"currencyCode\"      =&gt; \"USD\",\n                    \"paymentAmount\"     =&gt; \"1190\",\n                    \"sessionValidity\"   =&gt; \"2020-07-11T07:07:13-08:00\",\n                    \"shopperLocale\"     =&gt; \"en_GB\",\n                    \"skinCode\"          =&gt; $skinCode,\n                    \"brandCode\"         =&gt; \"\",\n                    \"shopperEmail\"      =&gt; \"test@adyen.com\",\n                    \"shopperReference\"  =&gt; \"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\",\n\n                    \/\/ L2\/l3 Data lines\n                    \"enhancedSchemeData.destinationPostalCode\" =&gt; \"94025-1452\",\n                    \"enhancedSchemeData.shipFromPostalCode\" =&gt; \"94025-1452\",\n                    \"enhancedSchemeData.destinationStateProvinceCode\" =&gt; \"CA\",\n                    \"enhancedSchemeData.destinationCountryCode\" =&gt; \"US\",\n                    \"enhancedSchemeData.freightAmount\" =&gt; \"0\",\n                    \"enhancedSchemeData.dutyAmount\" =&gt; \"0\",\n                    \"enhancedSchemeData.orderDate\" =&gt; \"290518\",\n                    \"enhancedSchemeData.customerReference\" =&gt; \"100001\",\n                    \"enhancedSchemeData.totalTaxAmount\" =&gt; \"190\",\n                    \"enhancedSchemeData.itemDetailLine1.commodityCode\" =&gt; \"82101603\",\n                    \"enhancedSchemeData.itemDetailLine1.description\" =&gt; \"Ads\",\n                    \"enhancedSchemeData.itemDetailLine1.productCode\" =&gt; \"Ads\",\n                    \"enhancedSchemeData.itemDetailLine1.quantity\" =&gt; \"1\",\n                    \"enhancedSchemeData.itemDetailLine1.unitOfMeasure\" =&gt; \"EAC\",\n                    \"enhancedSchemeData.itemDetailLine1.unitPrice\" =&gt; \"1000\",\n                    \"enhancedSchemeData.itemDetailLine1.totalAmount\" =&gt; \"1190\",\n\n    );\n\n    \/*\n     process fields\n     *\/\n\n    \/\/ The character escape function\n    $escapeval = function($val) {\n        return str_replace(':','\\\\:',str_replace('\\\\','\\\\\\\\',$val));\n    };\n\n    \/\/ Sort the array by key using SORT_STRING order\n    ksort($params, SORT_STRING);\n\n    \/\/ Generate the signing data string\n    $signData = implode(\":\",array_map($escapeval,array_merge(array_keys($params), array_values($params))));\n\n    \/\/ base64-encode the binary result of the HMAC computation\n    $merchantSig = base64_encode(hash_hmac('sha256',$signData,pack(\"H*\" , $hmacKey),true));\n    $params[\"merchantSig\"] = $merchantSig;\n\n    ?&gt;\n\n&lt;!-- Complete submission form --&gt;\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN\"\n\"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd\"&gt;\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\" xml:lang=\"en\" lang=\"en\"&gt;\n&lt;head&gt;\n&lt;title&gt;Adyen Payment&lt;\/title&gt;\n&lt;meta http-equiv=\"content-type\" content=\"text\/html; charset=UTF-8\" \/&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;form name=\"adyenForm\" action=\"https:\/\/test.adyen.com\/hpp\/select.shtml\" method=\"post\"&gt;\n&lt;?php\n    foreach ($params as $key =&gt; $value){\n        echo '        &lt;input type=\"hidden\" name=\"' .htmlspecialchars($key,   ENT_COMPAT | ENT_HTML401 ,'UTF-8').\n        '\" value=\"' .htmlspecialchars($value, ENT_COMPAT | ENT_HTML401 ,'UTF-8') . '\" \/&gt;' .\"\\n\" ;\n    }\n    ?&gt;\n&lt;input type=\"submit\" value=\"Submit\" \/&gt;\n&lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Classic integrations for Ecommerce","lvl3":"Hosted Payment Pages","lvl4":"Level 2\/3 data for Hosted Payment Pages"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/online-payments","lvl2":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations","lvl3":"https:\/\/docs.adyen.com\/pt\/online-payments\/classic-integrations\/hosted-payment-pages","lvl4":"\/pt\/online-payments\/classic-integrations\/hosted-payment-pages\/hpp-payments-with-l2l3-data"},"levels":5,"category":"Online Payments","category_color":"green","tags":["Level","Hosted","Payment","Pages"]}}
