나는 페이팔 체인 지불로 테스트를하려고하고 있는데, 정말 실망 스럽다. 이 테스트의 목표는 주 수신기를 $ 15, $ 1을 보조 수신기에 보내는 것입니다. 여기 내 코드입니다 :PayPal Chained Payment Help [PHP]
: 나는이 작업을 수행 할 때{"paymentInfo":[{"receiver":{"amount":"1.00","email":"[email protected]","primary":"false","paymentType":"SERVICE","accountId":"6LBSVJQNVE9DA"},"pendingRefund":"false"}]}
$api = "https://svcs.sandbox.paypal.com/AdaptivePayments/Pay";
$input = array(
"actionType" => "PAY",
"currencyCode" => "USD",
"feesPayer" => "EACHRECEIVER",
"cancelUrl" => "https://www.google.com", //test url
"returnUrl" => "https://www.google.com", //test url
"receiverList" => array(
"receiver" => array(//send primary receiver $15
"amount" => "15.00",
"email" => "[email protected]",
"primary" => true
),
"receiver" => array(//send owner of site $1 commission
"amount" => "1.00",
"email" => "[email protected]",
"primary" => false
)
),
"requestEnvelope" => array(
"errorLanguage" => "en_US"
)
);
$headers = array(
"X-PAYPAL-SECURITY-USERID: ".USER_ID, //predefined
"X-PAYPAL-SECURITY-PASSWORD: ".USER_PASS, //predefined
"X-PAYPAL-SECURITY-SIGNATURE: ".USER_SIG, //predefined
"X-PAYPAL-REQUEST-DATA-FORMAT: JSON",
"X-PAYPAL-RESPONSE-DATA-FORMAT: JSON",
"X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T"
);
$ch = curl_init($api);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($input));
$response = curl_exec($ch);
var_dump($response);
, 그것은 작동하지만, 결제 정보에서 단지 보조 수신기에 $ 1 보여 주 수신기의 흔적이 없다
나는 "PAY_PRIMARY"에 "actionType"를 설정 시도하고 나에게이 오류 준 :
내가 YouTube에서 살펴본 것처럼 그것은 아주 실망 점점"message":"Invalid request parameter: action type PAY_PRIMARY can only be used in chained payments","parameter":["PAY_PRIMARY"]
, 유래, 어떤 포럼 웹 사이트 등 많은 도움이되는 정보를 찾지 못했습니다.
시간을내어 읽어 주시고 저를 도와 주실 분께 고맙습니다!
페이팔의 세계에 오신 걸 환영합니다. – Martin