我正在尝试使用 Payum 1.0、Payum Bundle 1.0 和带有omnipay-skrill 捆绑包的Omnipay 桥在我的应用程序中实现支付,因为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 的响应?