回复中未显示完整地址
Posted
技术标签:
【中文标题】回复中未显示完整地址【英文标题】:Full address is not showing in the response 【发布时间】:2017-07-05 14:18:38 【问题描述】:当用户从通讯录中选择任何地址时,我想要完整选择的地址。
以下是执行“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"
【问题讨论】:
【参考方案1】:为了在确认订单之前检索整个送货地址,您需要采取以下步骤:
确保在您的 Amazon Pay 按钮代码中请求“payments:shipping_address”范围 在登录过程中捕获访问令牌(可以在返回 URL 后找到,或使用 Login with Amazon JS SDK 检索) 通过 AddressConsentToken 字段将访问令牌传递给 GetOrderReferenceDetails API 调用如果采取上述三项措施,您将在订单仍处于草稿状态时收到完整的送货地址。下面是一个示例响应。请注意,它现在包含 AddressLine1
、Name
和 Phone
字段。
<?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>
【讨论】:
以上是关于回复中未显示完整地址的主要内容,如果未能解决你的问题,请参考以下文章
WooCommerce 订单电子邮件中未显示自定义电话号码字段