PaypalのアダプティブペイメントAPIを使用しようとしていますが、本番環境に切り替えるのに苦労しています。サンドボックスモードではすべてが期待どおりに機能し、適切な応答が得られますが、ライブAPPIDに切り替えると機能しません。
これらは私がサンドボックスに使用している構成値です
PayPal URL : https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay?paykey=[TOKEN_HERE]
Application ID : APP-80W284485P519543T
これらの値は、サンドボックスモードで機能します。しかし、以下の製品値に切り替えると、機能しなくなります
PayPal URL : https://www.paypal.com/webapps/adaptivepayment/flow/pay?paykey=[TOKEN_HERE]
Application ID : [ACTUAL APP ID]
This is what I mean by stops working.
- 本番モードでは、アプリケーションはペイキーを取得します
- それをPaypalURLに追加してから、彼らのサイトにリダイレクトします
- サイトの読み込み時に、次のメッセージが表示されます
This transaction has already been approved. Please visit your PayPal Account Overview to see the details
最終的なURL-https://ic.paypal.com/webapps/adaptivepayment/flow/payinit?execution=e6s1
スクリーンショット-http ://screencast.com/t/28qJZ9CIk
そこには「戻る」ボタンもあり、それをクリックすると、毎回異なるサイトに移動します(ランダムなfailUrlsに送信されるようです)
以下に使用するコードを含めました
$payRequest = new PayRequest();
$payRequest->actionType = "PAY";
$payRequest->cancelUrl = $cancelURL; //my success and fail urls
$payRequest->returnUrl = $returnURL;
$payRequest->clientDetails = new ClientDetailsType();
$payRequest->clientDetails->applicationId = $this->config['application_id'];
$payRequest->clientDetails->deviceId = $this->config['device_id'];
$payRequest->clientDetails->ipAddress = $this->CI->input->ip_address();
$payRequest->currencyCode = $currencyCode;
$payRequest->requestEnvelope = new RequestEnvelope();
$payRequest->requestEnvelope->errorLanguage = "en_US";
//I set the receiver and the amounts. I also define that these are digital goods payments
$receiver1 = new receiver();
$receiver1->email = $opts['receiver_email'];
$receiver1->amount = $opts['amount'];
$receiver1->paymentType = 'DIGITALGOODS';
$payRequest->receiverList = new ReceiverList();
$payRequest->receiverList = array($receiver1);
//Then I make the call
$ap = new AdaptivePayments();
$response = $ap->Pay($payRequest);
if(strtoupper($ap->isSuccess) == 'FAILURE') {
log_message('error', "PAYMENT_FAIL : " . print_r($ap->getLastError(), true));
return false;
} else {
if($response->paymentExecStatus == "COMPLETED") {
header("Location: " . $this->config['success_url']);
exit;
} else {
$token = $response->payKey;
$payPalURL = $this->config['paypal_redirect_url'] . 'paykey='.$token;
header("Location: ".$payPalURL);
exit;
}
}
これはサンプル実装から取得したコードであるため、ここで何が問題になっているのかよくわかりません。関連する可能性のあるその他の情報
送信者と受信者が実際にトランザクションを実行したことを確認するために、適応型支払いを使用しています
お支払い方法を「デジタルグッズ」に設定しました
編集
支払いキーが添付されたサンプルURLを含めました
https://www.paypal.com/webapps/adaptivepayment/flow/pay?paykey=AP-0H388650F08226841