1"use strict";(self.webpackChunk_amzn_startup_guide=self.webpackChunk_amzn_startup_guide||[]).push([[5197,8374],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>m});var a=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=a.createContext({}),u=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},c=function(e){var n=u(e.components);return a.createElement(s.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},d=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),d=u(t),m=r,h=d["".concat(s,".").concat(m)]||d[m]||p[m]||o;return t?a.createElement(h,i(i({ref:n},c),{},{components:t})):a.createElement(h,i({ref:n},c))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,i=new Array(o);i[0]=d;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var u=2;u<o;u++)i[u]=t[u];return a.createElement.apply(null,i)}return a.createElement.apply(null,t)}d.displayName="MDXCreateElement"},5162:(e,n,t)=>{t.d(n,{Z:()=>i});var a=t(7294),r=t(6010);const o="tabItem_Ymn6";function i(e){let{children:n,hidden:t,className:i}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(o,i),hidden:t},n)}},4866:(e,n,t)=>{t.d(n,{Z:()=>w});var a=t(7462),r=t(7294),o=t(6010),i=t(2466),l=t(6775),s=t(1980),u=t(7392),c=t(12);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:n,label:t,attributes:a,default:r}}=e;return{value:n,label:t,attributes:a,default:r}}))}function d(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??p(t);return function(e){const n=(0,u.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[n,t])}function m(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function h(e){let{queryString:n=!1,groupId:t}=e;const a=(0,l.k6)(),o=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,s._X)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(a.location.search);n.set(o,e),a.replace({...a.location,search:n.toString()})}),[o,a])]}function y(e){const{defaultValue:n,queryString:t=!1,groupId:a}=e,o=d(e),[i,l]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!m({value:n,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const a=t.find((e=>e.default))??t[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:n,tabValues:o}))),[s,u]=h({queryString:t,groupId:a}),[p,y]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[a,o]=(0,c.Nk)(t);return[a,(0,r.useCallback)((e=>{t&&o.set(e)}
1),[t,o])]}({groupId:a}),b=(()=>{const e=s??p;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{b&&l(b)}),[b]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),y(e)}),[u,y,o]),tabValues:o}}var b=t(2389);const g="tabList__CuJ",f="tabItem_LNqP";function k(e){let{className:n,block:t,selectedValue:l,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,i.o5)(),d=e=>{const n=e.currentTarget,t=c.indexOf(n),a=u[t].value;a!==l&&(p(n),s(a))},m=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1];break}}n?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},n)},u.map((e=>{let{value:n,label:t,attributes:i}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,key:n,ref:e=>c.push(e),onKeyDown:m,onClick:d},i,{className:(0,o.Z)("tabs__item",f,i?.className,{"tabs__item--active":l===n})}),t??n)})))}function x(e){let{lazy:n,children:t,selectedValue:a}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==a}))))}function v(e){const n=y(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",g)},r.createElement(k,(0,a.Z)({},e,n)),r.createElement(x,(0,a.Z)({},e,n)))}function w(e){const n=(0,b.Z)();return r.createElement(v,(0,a.Z)({key:String(n)},e))}},2124:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>l,metadata:()=>u,toc:()=>p});var a=t(7462),r=(t(7294),t(3905)),o=t(4866),i=t(5162);const l={sidebar_position:10,sidebar_label:"\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4e2d\u8eab",title:"",slug:"/integration/apb/script_inside"},s=void 0,u={unversionedId:"integration/apb/script_inside",id:"integration/apb/script_inside",title:"",description:"* merchantId: Set merchantId you get from Step1 Get storeId, merchantId, publicKey and privateKey",source:"@site/i18n/en/docusaurus-plugin-content-docs/current/integration/apb/script_inside.mdx",sourceDirName:"integration/apb",slug:"/integration/apb/script_inside",permalink:"/en/integration/apb/script_inside",draft:!1,tags:[],version:"current",sidebarPosition:10,frontMatter:{sidebar_position:10,sidebar_label:"\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4e2d\u8eab",title:"",slug:"/integration/apb/script_inside"}},c={},p=[],d={toc:p};
1function m(e){let{components:n,...t}=e;return(0,r.kt)("wrapper",(0,a.Z)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)(o.Z,{mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"onetime-payandship",label:"OneTime-PayAndShip",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},'{\n "merchantId": "xxxxxx",\n "ledgerCurrency": "JPY",\n "sandbox": true,\n "checkoutLanguage": "ja_JP",\n "productType": "PayAndShip",\n "placement": "Cart",\n "buttonColor": "Gold",\n "createCheckoutSessionConfig": {\n "payloadJSON": {\n "webCheckoutDetails": {\n "checkoutResultReturnUrl": "http://localhost:3000/result_apb/",\n "checkoutCancelUrl": "http://localhost:3000/cancel/",\n "checkoutMode": "ProcessOrder"\n },\n "storeId": "amzn1.application-oa2-client.ccxxxxxx",\n "chargePermissionType": "OneTime",\n "merchantMetadata": {\n "merchantReferenceId": "",\n "merchantStoreName": "",\n "noteToBuyer": "",\n "customInformation": ""\n },\n "deliverySpecifications": {\n "addressRestrictions": {\n "type": "Allowed",\n "restrictions": {\n "JP": {\n "statesOrRegions": ["\u6771\u4eac\u90fd"],\n "zipCodes": ["1530064"]\n }\n }\n }\n },\n "paymentDetails": {\n "paymentIntent": "Authorize",\n "canHandlePendingAuthorization": false,\n "chargeAmount": {\n "amount": "700",\n "currencyCode": "JPY"\n },\n "allowOvercharge": false,\n "extendExpiration": false\n },\n "scopes": ["name","email","phoneNumber","billingAddress"],\n "addressDetails": {\n "name": "\u30c6\u30b9\u30c8\u592a\u90ce",\n "addressLine1": "\u76ee\u9ed2\u533a\u4e0b\u76ee\u9ed21-8-1",\n "stateOrRegion": "\u6771\u4eac\u90fd",\n "postalCode": "123-4567",\n "countryCode": "JP",\n "phoneNumber": "09012345678"\n }\n },\n "signature": "xxxxxx",\n "publicKeyId": "SANDBOX-xxxxxx"\n }\n}\n'))),(0,r.kt)(i.Z,{value:"onetime-payonly",label:"OneTime-PayOnly",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},'{\n "merchantId": "xxxxxx",\n "ledgerCurrency": "JPY",\n "sandbox": true,\n "checkoutLanguage": "ja_JP",\n "productType": "PayOnly",\n "placement": "Cart",\n "buttonColor": "Gold",\n "createCheckoutSessionConfig": {\n "payloadJSON": {\n "webCheckoutDetails": {\n "checkoutResultReturnUrl": "http://localhost:3000/result_apb/",\n "checkoutCancelUrl": "http://localhost:3000/cancel/",\n "checkoutMode": "ProcessOrder"\n },\n "storeId": "amzn1.application-oa2-client.ccxxxxxx",\n "chargePermissionType": "OneTime",\n "merchantMetadata": {\n "merchantReferenceId": "",\n "merchantStoreName": "",\n "noteToBuyer": "",\n "customInformation": ""\n },\n "paymentDetails": {\n "paymentIntent": "Authorize",\n "canHandlePendingAuthorization": false,\n "softDescriptor": "",\n "chargeAmount": {\n "amount": "700",\n "currencyCode": "JPY"\n },\n "allowOvercharge": false,\n "extendExpiration": false\n },\n "scopes": ["name","email","phoneNumber","billingAddress"]\n },\n "signature": "xxxxxx",\n "publicKeyId": "SANDBOX-xxxxxx"\n }\n}\n'))),(0,r.kt)(i.Z,{value:"recurring-payandship",label:"Recurring-PayAndShip",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},'{\n "merchantId": "xxxxxx",\n "ledgerCurrency": "JPY",\n "sandbox": true,\n "checkoutLanguage": "ja_JP",\n "productType": "PayAndShip",\n "placement": "Cart",\n "buttonColor": "Gold",\n "createCheckoutSessionConfig": {\n "payloadJSON": {\n "webCheckoutDetails": {\n "checkoutResultReturnUrl": "http://localhost:3000/result_apb/",\n "checkoutCancelUrl": "http://localhost:3000/cancel/",\n "checkoutMode": "ProcessOrder"\n },\n "storeId": "amzn1.application-oa2-client.ccxxxxxx",\n "chargePermissionType": "Recurring",\n "merchantMetadata": {\n "merchantReferenceId": "",\n "merchantStoreName": "",\n "noteToBuyer": "",\n "customInformation": ""\n },\n "deliverySpecifications": {\n "addressRestrictions": {\n "type": "Allowed",\n "restrictions": {\n "JP": {\n "statesOrRegions": ["\u6771\u4eac\u90fd"],\n "zipCodes": ["1530064"]\n }\n }\n }\n },\n "paymentDetails": {\n "paymentIntent": "Authorize",\n "canHandlePendingAuthorization": false,\n "chargeAmount": {\n "amount": "700",\n "currencyCode": "JPY"\n }\n },\n "scopes": ["name","email","phoneNumber","billingAddress"],\n "recurringMetadata": {\n "frequency": {\n "unit": "Month",\n "value": "1"\n },\n "amount": {\n "amount": "1000",\n "currencyCode": "JPY"\n }\n }
1,\n "addressDetails": {\n "name": "\u30c6\u30b9\u30c8\u592a\u90ce",\n "addressLine1": "\u76ee\u9ed2\u533a\u4e0b\u76ee\u9ed21-8-1",\n "stateOrRegion": "\u6771\u4eac\u90fd",\n "postalCode": "123-4567",\n "countryCode": "JP",\n "phoneNumber": "09012345678"\n }\n },\n "signature": "xxxxxx",\n "publicKeyId": "SANDBOX-xxxxxx"\n }\n}\n'))),(0,r.kt)(i.Z,{value:"recurring-payonly",label:"Recurring-PayOnly",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},'{\n "merchantId": "xxxxxx",\n "ledgerCurrency": "JPY",\n "sandbox": true,\n "checkoutLanguage": "ja_JP",\n "productType": "PayOnly",\n "placement": "Cart",\n "buttonColor": "Gold",\n "createCheckoutSessionConfig": {\n "payloadJSON": {\n "webCheckoutDetails": {\n "checkoutResultReturnUrl": "http://localhost:3000/result_apb/",\n "checkoutCancelUrl": "http://localhost:3000/cancel/",\n "checkoutMode": "ProcessOrder"\n },\n "storeId": "amzn1.application-oa2-client.ccxxxxxx",\n "chargePermissionType": "Recurring",\n "merchantMetadata": {\n "merchantReferenceId": "",\n "merchantStoreName": "",\n "noteToBuyer": "",\n "customInformation": ""\n },\n "paymentDetails": {\n "paymentIntent": "AuthorizeWithCapture",\n "canHandlePendingAuthorization": false,\n "softDescriptor": "",\n "chargeAmount": {\n "amount": "700",\n "currencyCode": "JPY"\n }\n },\n "scopes": ["name","email","phoneNumber","billingAddress"],\n "recurringMetadata": {\n "frequency": {\n "unit": "Month",\n "value": "1"\n },\n "amount": {\n "amount": "1000",\n "currencyCode": "JPY"\n }\n }\n },\n "signature": "xxxxxx",\n "publicKeyId": "SANDBOX-xxxxxxx"\n }\n}\n')))),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"merchantId: Set merchantId you get from ",(0,r.kt)("a",{parentName:"li",href:"/integration/2step/step1"},"Step1 Get storeId, merchantId, publicKey and privateKey")),(0,r.kt)("li",{parentName:"ul"},'ledgerCurrency: Always set "JPY".'),(0,r.kt)("li",{parentName:"ul"},"sandbox: Set true if you are using sandbox"),(0,r.kt)("li",{parentName:"ul"},'checkoutLanguage: Always set "ja_JP"'),(0,r.kt)("li",{parentName:"ul"},'productType: Set "PayAndShip" in case shipping of goods is involved, or set "PayOnly" in case of digital contents.'),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"/specification/parameter/placement"},"placement"),(0,r.kt)("br",null),"\nRegardless of which value you set in placement, Amazon Pay button look and its behavior won't change. However, we use placement value to understand which Amazon Pay button on your site is used to initaite respective checkout, and may use such metrics to provide you with further insights and improvement proposal in the future. So please use different plamcent value for each Amazon Pay button depending on the button location or checkout scenario. If you need any advise on placement value, please kindly contact Amazon Pay members."),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://www.amazonpay-faq.jp/faq/QA-605#2-%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E8%89%B2"},"buttonColor")),(0,r.kt)("li",{parentName:"ul"},"webCheckoutDetails",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"checkoutResultReturnUrl: Set URL where Amazon Pay redirects buyer when Amazon payment preparation is ready."),(0,r.kt)("li",{parentName:"ul"},'checkoutCancelUrl: Set URL where Amazon Pay redirects buyer when buyer clicks on "cancel" link on Amazon hosted page.'),(0,r.kt)("li",{parentName:"ul"},'checkoutMode: Always set "ProcessOrder"'))),(0,r.kt)("li",{parentName:"ul"},"storeId: Set store ID you got from ",(0,r.kt)("a",{parentName:"li",href:"/integration/2step/step1"},"Step1 Get storeId, merchantId, publicKey and privateKey"),"."),(0,r.kt)("li",{parentName:"ul"},"chargePermissionType: OneTime or Recurring"),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://developer.amazon.com/docs/amazon-pay-api-v2/checkout-session.html#type-deliveryspecifications"},"deliverySpecification")),(0,r.kt)("li",{parentName:"ul"},"paymentDetails",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://developer.amazon.com/docs/amazon-pay-api-v2/checkout-session.html#type-paymentdetails"},"paymentIntent")),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://www.amazonpay-faq.jp/faq/QA-68"},"canHandlePendingAuthorization")),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://developer.amazon.com/docs/amazon-pay-api-v2/checkout-session.html#type-paymentdetails"},"chargeAmount")),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://www.amazonpay-faq.jp/faq/QA-12"},"allowOvercharge")),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://www.amazonpay-faq.jp/faq/QA-48"},"extendExpiration")))),(0,r.kt)("li",{parentName:"ul"},"scopes: Set scopes if you want to get such data during checkout session"),(0,r.kt)("li",{parentName:"ul"},"recurringMetadata: Only in case of Recurring checkout. See ",(0,r.kt)("a",{parentName:"li",href:"https://developer.amazon.com/docs/amazon-pay-api-v2/checkout-session.html#type-recurringmetadata"},"this page")),(0,r.kt)("li",{parentName:"ul"},"See ",(0,r.kt)("a",{parentName:"li",href:"https://developer.amazon.com/docs/amazon-pay-api-v2/checkout-session.html#type-addressdetails"}
1,"addressDetails")),(0,r.kt)("li",{parentName:"ul"},'signature: Set signature for payload. There are two ways to generate signature which is explained in "Sign the payload" below.'),(0,r.kt)("li",{parentName:"ul"},"publicKeyId: Set publicKeyId you got from ",(0,r.kt)("a",{parentName:"li",href:"/integration/2step/step1"},"Step1 Get storeId, merchantId, publicKey and privateKey"),".")))}m.isMDXComponent=!0},2210:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var a=t(7462),r=(t(7294),t(3905)),o=t(2124);const i={sidebar_position:3,sidebar_label:"Step2 Get SDK and prepare for button rendering",slug:"/integration/apb/step2"},l="Step2 Get SDK and prepare for button rendering",s={unversionedId:"integration/apb/step2",id:"integration/apb/step2",title:"Step2 Get SDK and prepare for button rendering",description:"1. Download SDK",source:"@site/i18n/en/docusaurus-plugin-content-docs/current/integration/apb/step2.mdx",sourceDirName:"integration/apb",slug:"/integration/apb/step2",permalink:"/en/integration/apb/step2",draft:!1,tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,sidebar_label:"Step2 Get SDK and prepare for button rendering",slug:"/integration/apb/step2"},sidebar:"tutorialSidebar",previous:{title:"Step1 Get storeId, merchantId, publicKey and privateKey",permalink:"/en/integration/apb/step1"},next:{title:"Step3 Add javascript to render Amazon Pay button on your site",permalink:"/en/integration/apb/step3"}},u={},c=[{value:"1. Download SDK",id:"1-download-sdk",level:2},{value:"2. Prepare fundamental parts to put in Amazon Pay button rendering script",id:"2-prepare-fundamental-parts-to-put-in-amazon-pay-button-rendering-script",level:2},{value:"Parts sample",id:"parts-sample",level:3},{value:"Sign the payload",id:"sign-the-payload",level:3}],p={toc:c};function d(e){let{components:n,...t}=e;return(0,r.kt)("wrapper",(0,a.Z)({},p,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"step2-get-sdk-and-prepare-for-button-rendering"},"Step2 Get SDK and prepare for button rendering"),(0,r.kt)("h2",{id:"1-download-sdk"},"1. Download SDK"),(0,r.kt)("p",null,"Amazon Pay provides SDK and sample code for PHP, Java, .NET(C#), Node.js, Ruby and Perl.\n",(0,r.kt)("a",{parentName:"p",href:"https://developer.amazon.com/ja/docs/amazon-pay/intro.html#3-%E9%96%8B%E7%99%BA%E3%83%84%E3%83%BC%E3%83%AB"},"Download SDK"),"."),(0,r.kt)("h2",{id:"2-prepare-fundamental-parts-to-put-in-amazon-pay-button-rendering-script"},"2. Prepare fundamental parts to put in Amazon Pay button rendering script"),(0,r.kt)("h3",{id:"parts-sample"},"Parts sample"),(0,r.kt)("p",null,"OneTime/Recurring x PayAndShip/PayOnly sample parts as below."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Note that payloadJSON should be written in one line, but below sample is broken in line for readbility")),(0,r.kt)(o.default,{mdxType:"ScriptExample"}),(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("h3",{id:"sign-the-payload"},"Sign the payload"),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"payload")," is the part shown below within Parts sample."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},'{\n "webCheckoutDetails": {\n .\n .\n .\n "scopes": ["name","email","phoneNumber","billingAddress"] \n}\n')),(0,r.kt)("p",null,"You must secure the payload using a signature.\nThe payload does not include a timestamp so you can re-use the signature as long as the payload does not change."),(0,r.kt)("p",null,"There are two ways to generate signature. "),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Generate a signature using the helper function provided in the Amazon Pay SDKs: ",(0,r.kt)("a",{parentName:"li",href:"https://developer.amazon.com/docs/amazon-pay-checkout/add-the-amazon-pay-button.html#3-sign-the-payload"},"Integration Guide - Sign the payload")),(0,r.kt)("li",{parentName:"ol"},"Build the signature manually: ",(0,r.kt)("a",{parentName:"li",href:"https://developer.amazon.com/docs/amazon-pay-api-v2/signing-requests.html"},"Integration Guide - Signing requests"))))}d.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.