我想实施亚马逊支付。该按钮工作正常,但我想限制除德国以外的每个国家
这是我的代码片段。我尝试了几种 addressRestriction 格式:
$client = new Client($amazonPayConfig);
$amazonPayPayload['storeId'] = $amazonPayStoreId;
$amazonPayPayload['webCheckoutDetails']['checkoutReviewReturnUrl'] = $checkoutReviewReturnUrl;
$amazonPayPayload['deliverySpecifications']['addressRestrictions']['type'] = 'Allowed';
$amazonPayPayload['deliverySpecifications']['addressRestrictions']['restrictions'][] = ['DE'];
$amazonPayPayloadJson = json_encode($amazonPayPayload);
$amazonPaySignature = $client->generateButtonSignature($amazonPayPayloadJson);
Error Code: InvalidRequestFormat Error Message: Invalid request format, check fields are in correct format.
单击按钮时收到错误消息。如果我删除这些行:
$amazonPayPayload['deliverySpecifications']['addressRestrictions']['type'] = 'Allowed';
$amazonPayPayload['deliverySpecifications']['addressRestrictions']['restrictions'][] = ['DE'];
有用...
有什么提示吗?