Paypal支付REST API执行过程使用guzzle

时间:2018-01-03 09:51:35

标签: php rest curl paypal guzzle

我想问一下paypal REST执行过程。如文档中所定义,

curl -v https://api.sandbox.paypal.com/v1/payments/payment/payment_id/execute/ \\
  -H "Content-Type:application/json" \\
  -H "Authorization: Bearer Access-Token" \\
  -d '{
  "payer_id": "payer_id"
}'

代码用于 curl 版本,我想将其更改为 guzzle 版本,但对“授权:Bearer Access-Token”感到困惑

“授权:持有人访问令牌”是否位于标头配置中,如“Content-Type:application / json”

因为我总是从Paypal沙盒服务器获得错误500,当我尝试访问Paypal沙盒仪表板上的API调用历史页面时,它总是显示“取消沙箱API调用时出错。再试一次。”

1 个答案:

答案 0 :(得分:0)

是的,目前实施SELECT code,dates,available, CASE WHEN days_available=-1 THEN 0 ELSE ROW_NUMBER() over(PARTITION BY days_available ORDER BY dates desc) END as days_available FROM ( SELECT code,dates,available,CASE WHEN available=0 THEN -1 ELSE rn1-rn2 END AS days_available FROM ( SELECT k.*,ROW_NUMBER() over(ORDER BY dates) rn1,ROW_NUMBER() over(PARTITION BY available ORDER BY dates) rn2 FROM bltg.mytable k ) AS T1 ) fin ORDER BY dates 身份验证的最佳选择是添加标头:

Bearer