我试图在我的应用中使用Payum 1.0,Payum Bundle 1.0和Omnipay桥接器与omnipay-skrill捆绑包实现付款,因为skrill不支持开箱即用。
payum.yml
payum:
security:
token_storage:
XXX\PaymentBundle\Entity\PaymentToken: { doctrine: orm }
storages:
XXX\PaymentBundle\Entity\Payment: { doctrine: orm }
gateways:
skrill:
omnipay:
type: Skrill
options:
email: me@me.net
notifyUrl: /payment/skrill
testMode: true
这是我的控制器准备动作:
public function prepareAction()
{
$paymentName = 'skrill';
$storage = $this->get('payum')->getStorage('XXX\PaymentBundle\Entity\Payment');
$payment = $storage->create();
$payment->setNumber(uniqid($this->container->getParameter('shoppingCart')));
$payment->setCurrencyCode('EUR');
$payment->setTotalAmount($this->container->getParameter('price_of_xxx'));
$payment->setDescription('desc');
$payment->setClientId($this->getUser()->getId());
$payment->setClientEmail($this->getUser()->getEmail());
$payment->setLanguage('EN');
$storage->update($payment);
$captureToken = $this->get('payum.security.token_factory')->createCaptureToken(
$paymentName,
$payment,
'xxx_buy_premium_done' // the route to redirect after capture
);
return $this->redirect($captureToken->getTargetUrl());
}
因此,当我访问与准备行动相关的链接时,我会收到Payum信用卡表格。但是当我输入所有数据作为响应时,我得到一个错误,说必须提供语言参数。我无法弄清楚为什么会发生这种情况,因为我尝试将语言参数放在配置文件中并设置付款语言字段。我想它必须以表格数据的形式作为隐藏字段发送。
是否可以将用户重定向到https://pay.skrill.com/app/?sid= 使用参数并从Skrill服务器获取对captureDoneAction的响应?
答案 0 :(得分:1)
尝试将语言设置为如下所示的详细信息:
$payment->setDetails(array(
'language' => 'EN',
));