如何在PayPal中捕获订单时修复"PAYEE_NOT_CONSENTED"错误?



我创建了开发人员帐户并创建了一些测试沙箱帐户。我创建了一个REST API应用程序。使用这个应用程序的client_id和client_secret,我创建了订单。我在订单请求中设置收款人如下:

$response = self::$guzzleClient->post(
"/v2/checkout/orders",
[
'headers' => [
'Content-Type' => 'application/json',
'Accept'     => 'application/json',
'Authorization' => "Bearer $accessToken"
],
'json' => [
'intent' => 'CAPTURE',
'purchase_units' => [
[
'amount' => [
'value' => 100,
'currency_code' => 'EUR',
],
'payee' => [
'email_address' => "test@example.com"
]
]
],
'payment_source' => [
"paypal" => [
"experience_context" => [
"payment_method_preference" => "IMMEDIATE_PAYMENT_REQUIRED",
"payment_method_selected" => "PAYPAL",
"locale" => "de-DE",
"landing_page" => "LOGIN",
"shipping_preference" => "SET_PROVIDED_ADDRESS",
"user_action" => "PAY_NOW",
"return_url" => "https://www.paypal.com",
"cancel_url" => "https://www.paypal.com"
]
]
]
]
]
);

我现在正在为医生开发web应用程序。治疗结束后,患者应将发票付款到医生账户,而不是医院账户。所以我应该设置收款人。我说的对吗?但"PAYEE_NOT_CONSENTED"创建订单后捕获订单时出现错误。我该怎么修理它?

是的,你需要设置一个收款人——但是为了允许他们代表他们付款,首先要使用合作伙伴推荐API将他们带到你的平台。

相关内容

  • 没有找到相关文章

最新更新