亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

亞馬遜支付授權參考編號

亞馬遜支付授權參考編號

PHP
慕工程0101907 2022-09-17 21:31:16
我將亞馬遜支付集成到我的網站中,并按照亞馬遜支付SDK簡單結賬中的說明進行操作。到目前為止,它一切都在工作,但是在最后一步中,代碼示例顯示我需要一個授權參考ID。namespace AmazonPay;session_start();// Create the parameters array$requestParameters = array();// Refer to GetDetails.php where the Amazon Order Reference ID was set$requestParameters['amazon_order_reference_id'] = 'AMAZON_ORDER_REFERENCE_ID';// Confirm the order by making the ConfirmOrderReference API call$response = $client->confirmOrderReference($requestParameters);$responsearray['confirm'] = json_decode($response->toJson());// If the API call was a success make the Authorize API callif($client->success){$requestParameters['authorization_amount'] = '175.00';############################################################## WHERE DO I GET THIS? ################$requestParameters['authorization_reference_id'] = 'Your Unique Reference Id';$requestParameters['seller_authorization_note'] = 'Authorizing payment';$requestParameters['transaction_timeout'] = 0;$response = $client->authorize($requestParameters);$responsearray['authorize'] = json_decode($response->toJson());}// If the Authorize API call was a success, make the Capture API call when you are ready to capture             for the order (for example when the order has been dispatched)if($client->success){$requestParameters['amazon_authorization_id'] = 'Parse the Authorize Response for this id';$requestParameters['capture_amount'] = '175.00';$requestParameters['currency_code'] = 'USD';$requestParameters['capture_reference_id'] = 'Your Unique Reference Id';$response = $client->capture($requestParameters);$responsearray['capture'] = json_decode($response->toJson());}// Echo the Json encoded array for the Ajax successecho json_encode($responsearray);如上所示,需要設置“authorization_reference_id”。但我不知道如何得到它。它不在我之前對設置新訂單的響應中。它也不包括在“確認訂單參考”響應中。我在這里錯過了什么,還是代碼示例不完整?$requestParameters['authorization_reference_id'] = 'Your Unique Reference Id';感謝您的任何幫助
查看完整描述

1 回答

?
慕田峪7331174

TA貢獻1828條經驗 獲得超13個贊

authorization_reference_id是你給的。它應該是唯一的。

您可以使用PHP中的內置函數來生成它。對于每個請求,它必須是唯一的。uniqid

$requestParameters['authorization_reference_id'] = uniqid();


查看完整回答
反對 回復 2022-09-17
  • 1 回答
  • 0 關注
  • 143 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號