0

当用户从通讯簿中选择任何地址时,我想要完整的选定地址。

以下是执行“getOrderReferenceDetails”时得到的响应。

{
"GetOrderReferenceDetailsResult": {
    "OrderReferenceDetails": {
        "OrderReferenceStatus": {
            "State": "Draft"
        },
        "Destination": {
            "DestinationType": "Physical",
            "PhysicalDestination": {
                "StateOrRegion": "IA",
                "City": "CLEAR LAKE",
                "CountryCode": "US",
                "PostalCode": "50428"
            }
        },
        "ExpirationTimestamp": "2018-01-01T12:51:02.920Z",
        "IdList": {

        },
        "SellerOrderAttributes": {
            "StoreName": "TEST1234"
        },
        "OrderTotal": {
            "CurrencyCode": "USD",
            "Amount": "253.98"
        },
        "ReleaseEnvironment": "Sandbox",
        "SellerNote": "LEED Green Associate Exam Prep Online Anytime",
        "AmazonOrderReferenceId": "S01-2494539-9324741",
        "CreationTimestamp": "2017-07-05T12:51:02.920Z",
        "RequestPaymentAuthorization": "false"
    }
},
"ResponseMetadata": {
    "RequestId": "ffa51eb9-a31a-48d2-a2a5-b37126eba592"
},
"ResponseStatus": "200"

}

4

1 回答 1

0

为了在确认订单之前检索整个送货地址,您需要执行以下步骤:

  • 确保在您的 Amazon Pay 按钮代码中请求“payments:shipping_address”范围
  • 在登录过程中捕获访问令牌(可以在返回 URL 中找到,或使用 Login with Amazon JS SDK 检索)
  • 通过 AddressConsentToken 字段将访问令牌传递给 GetOrderReferenceDetails API 调用

如果采取了上述三个操作,您将在订单仍处于草稿状态时收到完整的送货地址。下面是一个示例响应。请注意,它现在包含AddressLine1,NamePhone字段。

<?xml version="1.0" ?>
<GetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
  <GetOrderReferenceDetailsResult>
    <OrderReferenceDetails>
      <AmazonOrderReferenceId>P01-7416549-1234567</AmazonOrderReferenceId>
      <ExpirationTimestamp>2015-07-09T00:54:54.828Z</ExpirationTimestamp>
      <Constraints>
        <Constraint>
          <ConstraintID>AmountNotSet</ConstraintID>
          <Description>The seller has not set the amount for the Order Reference.</Description>
        </Constraint>
      </Constraints>
      <IdList/>
      <OrderReferenceStatus>
        <State>Draft</State>
      </OrderReferenceStatus>
      <Destination>
        <DestinationType>Physical</DestinationType>
        <PhysicalDestination>
          <Phone>2061112222</Phone>
          <PostalCode>98100-2000</PostalCode>
          <Name>John Doe</Name>
          <CountryCode>US</CountryCode>
          <StateOrRegion>WA</StateOrRegion>
          <AddressLine1>100 SEATTLE ST</AddressLine1>
          <City>SEATTLE</City>
        </PhysicalDestination>
      </Destination>
      <ReleaseEnvironment>Live</ReleaseEnvironment>
      <Buyer>
        <Email>john.doe@abc.com</Email>
        <Name>John Doe</Name>
      </Buyer>
      <SellerOrderAttributes/>
      <CreationTimestamp>2015-01-10T00:54:54.828Z</CreationTimestamp>
    </OrderReferenceDetails>
  </GetOrderReferenceDetailsResult>
  <ResponseMetadata>
    <RequestId>e1de6c1f-64fd-48ec-9a69-a34646464</RequestId>
  </ResponseMetadata>
</GetOrderReferenceDetailsResponse>
于 2017-07-07T20:28:37.867 回答