我将JMSPaymentCoreBundle与JMSPaymentPaypalBundle结合使用,一切都很好。但是现在我需要向Paypal发送一个自定义字段,IPN消息确认会在稍后发送给我。
我尝试将这个“自定义”字段作为ExtendedData添加到PaymentInstruction中,但是Paypal并没有将这个自定义字段发送回我。有办法这样做吗?当我准备PaymentInstruction时,我的代码的一部分:
$router = $this->get('router');
$extendedData = new ExtendedData();
$extendedData->set('return_url',$router->generate('payment_complete', array(
'id' => $orden->getId(),
), true));
$extendedData->set('cancel_url', $router->generate('payment_cancel', array(
'id' => $orden->getId(),
), true));
$extendedData->set('default_method', 'payment_paypal');
$extendedData->set('item_name', $orden->getItemName());
$extendedData->set('item_number', $orden->getId());
$extendedData->set('custom', 'customvalue');
$instruction = new PaymentInstruction((float)$orden->getAmount(), $orden->getCurrency(), 'paypal_express_checkout', $extendedData);
$ppc = $this->get('payment.plugin_controller');
$ppc->createPaymentInstruction($instruction);
$orden->setPaymentInstruction($instruction);
$em->persist($orden);
$em->flush();谢谢!
发布于 2013-09-16 22:37:46
我回答自己:
$extendedData->set('checkout_params',array(
'PAYMENTREQUEST_0_CUSTOM' => $orden->getId()));它可以包括其他参数,如: L_PAYMENTREQUEST__NAME0,L_PAYMENTREQUEST__NUMBER0,L_PAYMENTREQUEST__DESC0,L_PAYMENTREQUEST__AMT0,L_PAYMENTREQUEST__QTY0,
https://stackoverflow.com/questions/18571766
复制相似问题