我正在尝试使用 express-checkout (Payum/paypal-express-checkout-nvp) 创建一个经常性的配置文件。
private function createAgreement(Purchase $purchase)
{
$storage = $this->payum->getStorage('Coachup\PaymentBundle\Entity\PaymentAgreement');
$agreementDetails = $storage->createModel();
$agreementDetails['L_BILLINGTYPE0'] = Api::BILLINGTYPE_RECURRING_PAYMENTS;
$agreementDetails['L_BILLINGAGREEMENTDESCRIPTION0'] = 'test';
$agreementDetails['PAYMENTREQUEST_0_AMT'] = 0;
$agreementDetails->setPurchase($purchase);
$storage->updateModel($agreementDetails);
$captureToken = $this->securityTokenFactory->createCaptureToken(
$this->paymentName,
$agreementDetails,
'payment_checkout_progress_payment',
['purchaseId' => $purchase->getId(), 'paymentType' => $this->getId()]
);
$agreementDetails['RETURNURL'] = $captureToken->getTargetUrl();
$agreementDetails['CANCELURL'] = $captureToken->getTargetUrl();
$storage->updateModel($agreementDetails);
return $captureToken->getTargetUrl();
}
一个令牌似乎是用贝宝生成的,用户被重定向到贝宝(沙箱),一旦我登录确认协议,我收到一条通用错误消息(粗略翻译)“无法处理请求,请返回存储并选择另一个选项”。甚至没有错误代码...
有什么帮助吗?