如何设置多方付款(Onboard Sellers)
我正在尝试实施 Paypal 多方付款,以便我可以连接卖家和买家,然后我向他们收取 x% 使用该平台的费用 例如。 Fiverr,Upwork,自由职业者, 所以首先卖家连接他的帐户,然后他们可以销售服务并通过 paypal 接受付款,但我不知道如何将 Paypal 帐户连接到我的应用程序
我正在使用 laravel 9 和 srmklive/laravel-paypal 包
这是我的代码
Route::get('https://api-m.sandbox.paypal.com/v2/customer/partner-referrals', function () {
$provider = new PayPalClient;
$provider->setApiCredentials(config('paypal'));
$paypalToken = $provider->getAccessToken();
$partner = $provider->createPartnerReferral([
"operations" => [
[
"operation" => "API_INTEGRATION",
"api_integration_preference" => [
"rest_api_integration" => [
"integration_method" => "PAYPAL",
"integration_type" => "FIRST_PARTY",
"first_party_details" => [
"features" => [
"PAYMENT",
"REFUND"
],
"seller_nonce" => uniqid()
]
]
]
]
],
"products" => [
"EXPRESS_CHECKOUT"
],
"legal_consents" => [
[
"type" => "SHARE_DATA_CONSENT",
"granted" => true
]
]
]);
dd($partner);
})
这是输出
^ array:2 [▼
"type" => "error"
"message" => "{"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","REFUND"],"seller_nonce":"623a1fcec9be3"}}}}],"products":["EXPRESS_CHECKOUT"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}]} {"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"f64fe0ec63213","information_link":"","details":[{"issue":"INVALID_STRING_LENGTH","description":"The length of a field value should not be shorter than 44 characters.","field":"/operations/0/api_integration_preference/rest_api_integration/first_party_details/seller_nonce","location":"body"}],"links":[]} ◀"
]
提前致谢
Route::get('https://api-m.sandbox.paypal.com/v2/customer/partner-referrals', function () {
$provider = new PayPalClient;
$provider->setApiCredentials(config('paypal'));
$paypalToken = $provider->getAccessToken();
$partner = $provider->createPartnerReferral([
"operations" => [
[
"operation" => "API_INTEGRATION",
"api_integration_preference" => [
"rest_api_integration" => [
"integration_method" => "PAYPAL",
"integration_type" => "FIRST_PARTY",
"first_party_details" => [
"features" => [
"PAYMENT",
"REFUND"
],
"seller_nonce" => uniqid()
]
]
]
]
],
"products" => [
"EXPRESS_CHECKOUT"
],
"legal_consents" => [
[
"type" => "SHARE_DATA_CONSENT",
"granted" => true
]
]
]);
dd($partner);
})
这是输出
^ array:2 [▼
"type" => "error"
"message" => "{"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","REFUND"],"seller_nonce":"623a1fcec9be3"}}}}],"products":["EXPRESS_CHECKOUT"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}]} {"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"f64fe0ec63213","information_link":"","details":[{"issue":"INVALID_STRING_LENGTH","description":"The length of a field value should not be shorter than 44 characters.","field":"/operations/0/api_integration_preference/rest_api_integration/first_party_details/seller_nonce","location":"body"}],"links":[]} ◀"
]
I am Trying To Implement Paypal Multiparty payment so i can connect seller and Buyers and then i take x% of fee from them for using the platform
eg. Fiverr,Upwork,Freelancer,
so first the seller connect his account and then they can sell services and accept payment through paypal but i dont know how to connect There Paypal account to My app
I am using laravel 9 with srmklive/laravel-paypal package
This is my Code
Route::get('https://api-m.sandbox.paypal.com/v2/customer/partner-referrals', function () {
$provider = new PayPalClient;
$provider->setApiCredentials(config('paypal'));
$paypalToken = $provider->getAccessToken();
$partner = $provider->createPartnerReferral([
"operations" => [
[
"operation" => "API_INTEGRATION",
"api_integration_preference" => [
"rest_api_integration" => [
"integration_method" => "PAYPAL",
"integration_type" => "FIRST_PARTY",
"first_party_details" => [
"features" => [
"PAYMENT",
"REFUND"
],
"seller_nonce" => uniqid()
]
]
]
]
],
"products" => [
"EXPRESS_CHECKOUT"
],
"legal_consents" => [
[
"type" => "SHARE_DATA_CONSENT",
"granted" => true
]
]
]);
dd($partner);
})
this is the out put
^ array:2 [▼
"type" => "error"
"message" => "{"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","REFUND"],"seller_nonce":"623a1fcec9be3"}}}}],"products":["EXPRESS_CHECKOUT"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}]} {"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"f64fe0ec63213","information_link":"","details":[{"issue":"INVALID_STRING_LENGTH","description":"The length of a field value should not be shorter than 44 characters.","field":"/operations/0/api_integration_preference/rest_api_integration/first_party_details/seller_nonce","location":"body"}],"links":[]} ◀"
]
Thank in Advance
Route::get('https://api-m.sandbox.paypal.com/v2/customer/partner-referrals', function () {
$provider = new PayPalClient;
$provider->setApiCredentials(config('paypal'));
$paypalToken = $provider->getAccessToken();
$partner = $provider->createPartnerReferral([
"operations" => [
[
"operation" => "API_INTEGRATION",
"api_integration_preference" => [
"rest_api_integration" => [
"integration_method" => "PAYPAL",
"integration_type" => "FIRST_PARTY",
"first_party_details" => [
"features" => [
"PAYMENT",
"REFUND"
],
"seller_nonce" => uniqid()
]
]
]
]
],
"products" => [
"EXPRESS_CHECKOUT"
],
"legal_consents" => [
[
"type" => "SHARE_DATA_CONSENT",
"granted" => true
]
]
]);
dd($partner);
})
this is the out put
^ array:2 [▼
"type" => "error"
"message" => "{"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","REFUND"],"seller_nonce":"623a1fcec9be3"}}}}],"products":["EXPRESS_CHECKOUT"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}]} {"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"f64fe0ec63213","information_link":"","details":[{"issue":"INVALID_STRING_LENGTH","description":"The length of a field value should not be shorter than 44 characters.","field":"/operations/0/api_integration_preference/rest_api_integration/first_party_details/seller_nonce","location":"body"}],"links":[]} ◀"
]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
错误消息详细信息很有用,是吗? href="https://developer.paypal.com/api/partner-referrals/v2/#partner-referrals_create" rel="nofollow noreferrer">API 参考。
Error message details are useful, yes? The field is documented in the API reference. You can also try omitting it.
经过一番搜索,我发现问题是我的
seller_nonce
字段低于 44 个字符,因此请确保您的seller_nounce
超过 44 个字符。另外,请确保您已选中付款后登机复选框seller_nonce => uniqid(Str::random(40), true)
After some search, I found out the problem was that my
seller_nonce
field was lowered than 44 characters, so make sure yourseller_nounce
is more than 44 characters. Also, make sure you have checked the box On Board After Paymentseller_nonce => uniqid(Str::random(40), true)