{"id":495,"date":"2024-08-08T19:49:19","date_gmt":"2024-08-08T19:49:19","guid":{"rendered":"https:\/\/lddpay.com\/?post_type=docs&#038;p=495"},"modified":"2024-08-10T08:37:52","modified_gmt":"2024-08-10T08:37:52","password":"","slug":"sdk-checkout","status":"publish","type":"docs","link":"https:\/\/lddpay.com\/zh\/docs\/sdk-checkout\/","title":{"rendered":"SDK CHECKOUTS"},"content":{"rendered":"<h1 class=\"wp-block-heading\">SDK CHECKOUTS<\/h1>\n\n\n\n<p>Version: 1.1.1<br>Released: 2024\/05\/09<\/p>\n\n\n\n<p>Copyrighted by lddPay<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Checkout SDK Documentation<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"general\">General<\/h2>\n\n\n\n<p>For the checkout page, a wide range of settings is available through the admin panel, for example, placing your own logo, changing the colors of basic elements. But if these opportunities are not enough to ensure corporate style, design, merchants also have the option of uploading their own checkout page on the platform resources. In this case, all the advantages of HPP integration are retained, one of which is the absence of necessity for the merchant to conduct a complex and expensive PCI DSS certification.<\/p>\n\n\n\n<p>\u26a0\ufe0f Currently, only acquiring payment forms with a CARD<\/p>\n\n\n\n<p>payment method, ApplePay<\/p>\n\n\n\n<p>and GooglePay<\/p>\n\n\n\n<p>are supported (where card data is entered on the form itself). P2P, debit payment forms are not supported.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"payment-form-development\">Payment form development<\/h2>\n\n\n\n<p>When developing your own payment page or adapting an existing one, the following conditions must be met:<\/p>\n\n\n\n<ol>\n<li>Technology stack &#8211; HTML \/ CSS \/ JavaScript<\/li>\n\n\n\n<li>Project folder structure:<\/li>\n<\/ol>\n\n\n\n<ul>\n<li>\/img<\/li>\n\n\n\n<li>\/style<\/li>\n\n\n\n<li>\/js<\/li>\n\n\n\n<li>\/<\/li>\n<\/ul>\n\n\n\n<ol start=\"3\">\n<li>You need to connect Checkout SDK module in the payment page code:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script src=\"https:\/\/{{CHECKOUT_URL}}\/sdk\/pay-session.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<ol start=\"4\">\n<li>It is necessary to create a new instance of the <code>PaySession<\/code> class by passing to the constructor function the identifier of the HTML element of the form for entering data on the payment page and the parameter if on-the-fly validation of the payment form fields is needed (optional parameter). Next, call the <code>begin()<\/code> method:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script&gt;<br>    const session = new PaySession({formName: \"paymentForm\", validateOnInput: true});<br>    session.begin();<br>&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<ol start=\"5\">\n<li>In the payment page HTML code, you need to link the <code>&lt;input&gt;<\/code> tags of the form to Checkout SDK module using special <code>id<\/code> identifiers. The module interacts only with those <code>&lt;input&gt;<\/code> elements that are inside the <code>&lt;form&gt;<\/code> tag and are indicated by the corresponding <code>id<\/code>:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong><code>&lt;input&gt;<\/code><\/strong><\/th><th><strong>Type<\/strong><\/th><\/tr><\/thead><tbody><tr><td>Payment card number<\/td><td><code>payer_card<\/code><\/td><\/tr><tr><td>CVV code<\/td><td><code>payer_cvv<\/code><\/td><\/tr><tr><td>Expiry date<\/td><td><code>payer_expiryDate<\/code><\/td><\/tr><tr><td>Payer name<\/td><td><code>payer_name<\/code><\/td><\/tr><tr><td>ZIP code<\/td><td><code>payer_zip<\/code><\/td><\/tr><tr><td>Payer city<\/td><td><code>payer_city<\/code><\/td><\/tr><tr><td>Payer phone number<\/td><td><code>payer_phone<\/code><\/td><\/tr><tr><td>Payer email<\/td><td><code>payer_email<\/code><\/td><\/tr><tr><td>Payer state<\/td><td><code>payer_state<\/code><\/td><\/tr><tr><td>Payer address<\/td><td><code>payer_address<\/code><\/td><\/tr><tr><td>Payer country<\/td><td><code>payer_country<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u26a0\ufe0f The form must contain at least inputs with such id: <code>payer_card<\/code>, <code>payer_cvv<\/code>, <code>payer_expiryDate<\/code>, <code>payer_name<\/code>.<\/p>\n<\/blockquote>\n\n\n\n<ol start=\"6\">\n<li>The Checkout SDK library implements a set of methods for obtaining some session checkout parameters.<\/li>\n<\/ol>\n\n\n\n<p><strong>getBillingAddress<\/strong>() &#8211; getting the billing_address object from the merchant&#8217;s Authentication request. Object properties may be empty if the corresponding information has not been provided by the merchant. Result example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{address: \"Moore Building\", city: \"Los Angeles\", country: \"US\", phone: \"12345678\", state: \"\", zip: \"12345\"}<\/code><\/pre>\n\n\n\n<p><strong>getOrderInfo<\/strong>() &#8211; obtaining information on the current order. The function returns an object with data, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{number: \"111-222\", amount: \"10.00\", currency: \"USD\", description: \"Important gift\"}<\/code><\/pre>\n\n\n\n<p><strong>getSessionExpiry<\/strong>() &#8211; getting the checkout session lifetime date\/time in unixtime format. Result example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1711378966<\/code><\/pre>\n\n\n\n<p><strong>getSessionState<\/strong>() &#8211; getting the current session status. Possible values: complete, redirect, waiting \u0438 decline. Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"decline\"<\/code><\/pre>\n\n\n\n<p><strong>getDeclinesMax<\/strong>() &#8211; receiving the set limit on the number of declines on the payment page. This parameter can be defined by the merchant in Authentication request and after receiving such a number of declines an automatic redirect of the user to cancelUrl will be performed.. Example of function call result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2<\/code><\/pre>\n\n\n\n<p><strong>getCancelUrl<\/strong>() &#8211; getting success_url passed by the merchant in Authentication request. Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"https:\/\/example.domain.com\/cancel\"<\/code><\/pre>\n\n\n\n<p><strong>getCardTokens<\/strong>() &#8211; getting a set of available payment card tokens. The result of the call will be an array of objects, example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;<br> {<br>    \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",<br>    \"last\": \"1111\",<br>    \"month\": \"01\",<br>    \"year\": \"2025\",<br>    \"brand\": \"visa\"<br> }<br>]<\/code><\/pre>\n\n\n\n<p><strong>setCardToken<\/strong>(token: string) &#8211; selecting a specific token for the payment process. Stored card data in the token has priority over card data from form fields.<\/p>\n\n\n\n<p><strong>getActiveCardToken<\/strong>() &#8211; getting active token, if such token was set using setCardToken function. The method returns either a string with the token or an empty value if no active token is selected. Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"<\/code><\/pre>\n\n\n\n<p><strong>clearCardToken<\/strong>() &#8211; to deselect the active token. This method should be used if you want to revert to the option of directly entering card data in the form fields instead of using data from the token.<\/p>\n\n\n\n<p><strong>getCountries<\/strong>() &#8211; reference function to get a complete list of countries with regions. Returns an array of objects:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;<br> {<br>    regions: null,<br>    value: \"AF\",<br>    text: \"Afghanistan\"<br>  },<br>  {<br>    regions: &#91; {value: \"ACT\", text: \"Australian Capital Territory\"}, ... ],<br>    value: \"AU\",<br>    text: \"Australia\",<br>  }<br>]<\/code><\/pre>\n\n\n\n<ol start=\"7\">\n<li>Also the Checkout SDK module implements a number of event listeners, the result of which is available for processing on the form page. Event handling is optional.<\/li>\n<\/ol>\n\n\n\n<p><strong>onDecline<\/strong> &#8211; is called when the response <code>declined<\/code> is received at the time of payment processing or when checking the session state. Returns an object with the error message: <code>{message: string}<\/code>.<\/p>\n\n\n<div\n    class=\"betterdocs-faq-wrapper layout-classic icon-before betterdocs-faq-layout-2 betterdocs-faq-n6dqw2q betterdocs-shortcode\">\n    <h2 class=\"betterdocs-faq-layout-2 betterdocs-faq-n6dqw2q betterdocs-faq-section-title\">\n            <\/h2>\n\n    <div class=\"betterdocs-faq-inner-wrapper\">\n        <div class=\"betterdocs-faq-title\">\n    <h2>OnDecline Event Handler<\/h2>\n<\/div>\n<ul class=\"betterdocs-faq-list\"><li><div class=\"betterdocs-faq-group\"><div class=\"betterdocs-faq-post\">\n    <div class=\"betterdocs-faq-post-icon-group\"><svg class=\"betterdocs-faq-iconplus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M18 10h-4V6h-4v4H6v4h4v4h4v-4h4\"><\/path><\/svg><svg class=\"betterdocs-faq-iconminus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M6 10h12v4H6z\"><\/path><\/svg><\/div>    <span class=\"betterdocs-faq-post-name\">\n        Event handler code example    <\/span>\n    <\/div>\n<div class=\"betterdocs-faq-main-content\">\n    <p>session.onDecline = function (event) {<\/p>\n<p>&nbsp;&nbsp;&nbsp;document.querySelector(&#8220;.decline-message&#8221;).innerText = event.message;<\/p>\n<p>}<\/p>\n<\/div>\n<\/div><\/li><\/ul><script type=\"application\/ld+json\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"Event handler code example\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>session.onDecline = function (event) {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;document.querySelector(\\\".decline-message\\\").innerText = event.message;<\\\/p>\\n<p>}<\\\/p>\\n\"}}]}<\/script>    <\/div>\n<\/div>\n\n\n\n<p><strong>onSuccess<\/strong> &#8211; is called when the response <code>completed<\/code> is received at the time of payment processing or when checking the session status. Returns an object with successUrl: <code>{successUrl: string}<\/code>.<\/p>\n\n\n<div\n    class=\"betterdocs-faq-wrapper layout-classic icon-before betterdocs-faq-layout-2 betterdocs-faq-85hw9pt betterdocs-shortcode\">\n    <h2 class=\"betterdocs-faq-layout-2 betterdocs-faq-85hw9pt betterdocs-faq-section-title\">\n            <\/h2>\n\n    <div class=\"betterdocs-faq-inner-wrapper\">\n        <div class=\"betterdocs-faq-title\">\n    <h2>OnSuccess Event Handler<\/h2>\n<\/div>\n<ul class=\"betterdocs-faq-list\"><li><div class=\"betterdocs-faq-group\"><div class=\"betterdocs-faq-post\">\n    <div class=\"betterdocs-faq-post-icon-group\"><svg class=\"betterdocs-faq-iconplus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M18 10h-4V6h-4v4H6v4h4v4h4v-4h4\"><\/path><\/svg><svg class=\"betterdocs-faq-iconminus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M6 10h12v4H6z\"><\/path><\/svg><\/div>    <span class=\"betterdocs-faq-post-name\">\n        Event handler code example    <\/span>\n    <\/div>\n<div class=\"betterdocs-faq-main-content\">\n    <p>session.onSuccess = function (event) {<\/p>\n<p>&nbsp;&nbsp;&nbsp;location.href = event.successUrl;<\/p>\n<p>}<\/p>\n<\/div>\n<\/div><\/li><\/ul><script type=\"application\/ld+json\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"Event handler code example\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>session.onSuccess = function (event) {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;location.href = event.successUrl;<\\\/p>\\n<p>}<\\\/p>\\n\"}}]}<\/script>    <\/div>\n<\/div>\n\n\n\n<p><strong>onFormReady<\/strong> &#8211; is called after getting the current session. Doesn&#8217;t return any values.<\/p>\n\n\n<div\n    class=\"betterdocs-faq-wrapper layout-classic icon-before betterdocs-faq-layout-2 betterdocs-faq-3zp297b betterdocs-shortcode\">\n    <h2 class=\"betterdocs-faq-layout-2 betterdocs-faq-3zp297b betterdocs-faq-section-title\">\n            <\/h2>\n\n    <div class=\"betterdocs-faq-inner-wrapper\">\n        <div class=\"betterdocs-faq-title\">\n    <h2>OnFormReady Event Handler<\/h2>\n<\/div>\n<ul class=\"betterdocs-faq-list\"><li><div class=\"betterdocs-faq-group\"><div class=\"betterdocs-faq-post\">\n    <div class=\"betterdocs-faq-post-icon-group\"><svg class=\"betterdocs-faq-iconplus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M18 10h-4V6h-4v4H6v4h4v4h4v-4h4\"><\/path><\/svg><svg class=\"betterdocs-faq-iconminus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M6 10h12v4H6z\"><\/path><\/svg><\/div>    <span class=\"betterdocs-faq-post-name\">\n        Event handler code example    <\/span>\n    <\/div>\n<div class=\"betterdocs-faq-main-content\">\n    <p>session.onFormReady = function () {<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;document.querySelector(&#8220;.form-wrapper&#8221;).classList.add(&#8220;show&#8221;);<\/p>\n<p>}<\/p>\n<\/div>\n<\/div><\/li><\/ul><script type=\"application\/ld+json\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"Event handler code example\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>session.onFormReady = function () {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;document.querySelector(\\\".form-wrapper\\\").classList.add(\\\"show\\\");<\\\/p>\\n<p>}<\\\/p>\\n\"}}]}<\/script>    <\/div>\n<\/div>\n\n\n\n<p><strong>handleError<\/strong> &#8211; is called after an error occurs when sending a payment processing request. Returns an error object.<\/p>\n\n\n\n<p><strong>onInputValidation<\/strong> &#8211; is called when an on-the-fly validation error occurs for one of the inputs with <code>id<\/code> listed earlier (if the parameter <code>validateOnInput: true<\/code> was passed to the constructor) or as a general validation when submitting the form. Returns a validation error object: <code>{result: string, inputId: string}<\/code>.<\/p>\n\n\n<div\n    class=\"betterdocs-faq-wrapper layout-classic icon-before betterdocs-faq-layout-2 betterdocs-faq-ggbu090 betterdocs-shortcode\">\n    <h2 class=\"betterdocs-faq-layout-2 betterdocs-faq-ggbu090 betterdocs-faq-section-title\">\n            <\/h2>\n\n    <div class=\"betterdocs-faq-inner-wrapper\">\n        <div class=\"betterdocs-faq-title\">\n    <h2>onInputValidation Event Handler<\/h2>\n<\/div>\n<ul class=\"betterdocs-faq-list\"><li><div class=\"betterdocs-faq-group\"><div class=\"betterdocs-faq-post\">\n    <div class=\"betterdocs-faq-post-icon-group\"><svg class=\"betterdocs-faq-iconplus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M18 10h-4V6h-4v4H6v4h4v4h4v-4h4\"><\/path><\/svg><svg class=\"betterdocs-faq-iconminus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M6 10h12v4H6z\"><\/path><\/svg><\/div>    <span class=\"betterdocs-faq-post-name\">\n        Event handler code example    <\/span>\n    <\/div>\n<div class=\"betterdocs-faq-main-content\">\n    <p>session.onInputValidation = function (event) {<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (event.result === &#8220;error&#8221;) {<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId)?.classList.add(&#8220;text-field&#8211;error&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId + &#8220;Error&#8221;)?.classList.add(&#8220;display-error&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId)?.classList.remove(&#8220;text-field&#8211;error&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId + &#8220;Error&#8221;)?.classList.remove(&#8220;display-error&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n<p>&nbsp;};<\/p>\n<\/div>\n<\/div><\/li><\/ul><script type=\"application\/ld+json\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"Event handler code example\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>session.onInputValidation = function (event) {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (event.result === \\\"error\\\") {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId)?.classList.add(\\\"text-field--error\\\");<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId + \\\"Error\\\")?.classList.add(\\\"display-error\\\");<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId)?.classList.remove(\\\"text-field--error\\\");<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(event.inputId + \\\"Error\\\")?.classList.remove(\\\"display-error\\\");<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\\\/p>\\n<p>&nbsp;};<\\\/p>\\n\"}}]}<\/script>    <\/div>\n<\/div>\n\n\n\n<p>8. To add ApplePay and GooglePay payment methods to the payment form you need to:<\/p>\n\n\n\n<p><strong>ApplePay<\/strong><\/p>\n\n\n\n<p>1) The container should be assigned <code>id = applepay-container<\/code>, in the body of which you need to create a div block for the button and define styles for it.<\/p>\n\n\n<div\n    class=\"betterdocs-faq-wrapper layout-classic icon-before betterdocs-faq-layout-2 betterdocs-faq-1yosgvz betterdocs-shortcode\">\n    <h2 class=\"betterdocs-faq-layout-2 betterdocs-faq-1yosgvz betterdocs-faq-section-title\">\n            <\/h2>\n\n    <div class=\"betterdocs-faq-inner-wrapper\">\n        <div class=\"betterdocs-faq-title\">\n    <h2>ApplePay Example<\/h2>\n<\/div>\n<ul class=\"betterdocs-faq-list\"><li><div class=\"betterdocs-faq-group\"><div class=\"betterdocs-faq-post\">\n    <div class=\"betterdocs-faq-post-icon-group\"><svg class=\"betterdocs-faq-iconplus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M18 10h-4V6h-4v4H6v4h4v4h4v-4h4\"><\/path><\/svg><svg class=\"betterdocs-faq-iconminus\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M6 10h12v4H6z\"><\/path><\/svg><\/div>    <span class=\"betterdocs-faq-post-name\">\n        Example code    <\/span>\n    <\/div>\n<div class=\"betterdocs-faq-main-content\">\n    <p>&lt;div id=&quot;&rdquo;applepay-container&rdquo;&quot;&gt;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&quot;&rdquo;applepay-button&rdquo;&quot;&gt;&lt;\/div&gt;<\/p>\n<p>&lt;\/div&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>@supports (-webkit-appearance: -apple-pay-button) {<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;.applepay-button {<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;display: block;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;width: 100%;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;height: 40px;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;-webkit-appearance: -apple-pay-button;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;-apple-pay-button-type: plain;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;-apple-pay-button-style: black;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;overflow: hidden;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;height: 45px;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n<p>}<\/p>\n<\/div>\n<\/div><\/li><\/ul><script type=\"application\/ld+json\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"Example code\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>&lt;div id=\\\"applepay-container\\\"&gt;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=\\\"applepay-button\\\"&gt;&lt;\\\/div&gt;<\\\/p>\\n<p>&lt;\\\/div&gt;<\\\/p>\\n<p>&nbsp;<\\\/p>\\n<p>@supports (-webkit-appearance: -apple-pay-button) {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;.applepay-button {<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;display: block;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;width: 100%;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;height: 40px;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;-webkit-appearance: -apple-pay-button;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;-apple-pay-button-type: plain;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;-apple-pay-button-style: black;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;overflow: hidden;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;height: 45px;<\\\/p>\\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\\\/p>\\n<p>}<\\\/p>\\n\"}}]}<\/script>    <\/div>\n<\/div>\n\n\n\n<p>2) An event handler should be added to the button, code example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"applepay-container\"&gt;<br>    &lt;div class=\"applepay-button\" onclick=\"handleApplePayClick()\"&gt;&lt;\/div&gt;<br>&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<p><strong>GooglePay<\/strong><\/p>\n\n\n\n<p>1) The container should be assigned id = &#8220;googlepay-container&#8221;. Example code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=&quot;googlepay-container&quot;&gt;&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<p>2) Set the button color, the available options are &#8220;default&#8221; | &#8220;black&#8221; | &#8220;white&#8221;. Example code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>session.setGooglePayButtonColor(\"default\")<\/code><\/pre>\n\n\n\n<p>3) Set button size, available options are &#8220;static&#8221; | &#8220;fill&#8221;. Example code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>session.setGooglePayButtonSizeMode(\"fill\")<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"further-steps\">Further steps<\/h2>\n\n\n\n<p>After developing the payment form, it is necessary to send the project archive, including the source code and all used files, to the manager for review, security testing and placement on the platform resources.<\/p>\n\n\n\n<p>The payment form will be assigned a unique identifier that should be used in Checkout Authentication Request to display this payment form to customers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"form_id\": \"xxxxx-xxxxx-xxxxx\"}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example\">Example<\/h2>\n\n\n\n<p>An example of the payment form code can be downloaded from the <ins><a href=\"https:\/\/lddpay.com\/wp-content\/uploads\/2024\/08\/sdk-form-example-aaec4ff235d65535156260295631efef.zip\" target=\"_blank\" rel=\"noreferrer noopener\">link<\/a><\/ins><\/p>","protected":false},"excerpt":{"rendered":"<p>SDK CHECKOUTS Version: 1.1.1Released: 2024\/05\/09 Copyrighted by lddPay Checkout SDK Documentation General For the checkout page, a wide range of [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"doc_category":[13],"doc_tag":[],"year_month":"2026-04","word_count":1050,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"author_nicename":"admin","author_url":"https:\/\/lddpay.com\/zh\/author\/admin\/"},"doc_category_info":[{"term_name":"SDK CHECKOUTS","term_url":"https:\/\/lddpay.com\/zh\/docs-category\/sdk-checkouts\/"}],"doc_tag_info":[],"author_list":[{"ID":"3","user_login":"jony","display_name":"jony","id":"3"},{"ID":"2","user_login":"Merchantlogin","display_name":"Merchantlogin","id":"2"},{"ID":"1","user_login":"w2863431","display_name":"admin","id":"1"}],"_links":{"self":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs\/495"}],"collection":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":3,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs\/495\/revisions"}],"predecessor-version":[{"id":742,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs\/495\/revisions\/742"}],"wp:attachment":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/doc_category?post=495"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/doc_tag?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}