Php 我在通过Ominpay、Payum和Symfony配置Securepay时遇到困难
我目前通过Symfony2中的Payum让PayPal工作正常,现在我正在尝试配置SecurePay(通过Omnipay),但是它甚至似乎没有连接到SecurePay,也没有支持它的文档,所以我非常困惑 日志中似乎没有任何外部通信。在SecurePay中,没有我的付款记录 提前非常感谢您的帮助 丹 以下是付款单数据库记录的示例:Php 我在通过Ominpay、Payum和Symfony配置Securepay时遇到困难,php,symfony,omnipay,payum,Php,Symfony,Omnipay,Payum,我目前通过Symfony2中的Payum让PayPal工作正常,现在我正在尝试配置SecurePay(通过Omnipay),但是它甚至似乎没有连接到SecurePay,也没有支持它的文档,所以我非常困惑 日志中似乎没有任何外部通信。在SecurePay中,没有我的付款记录 提前非常感谢您的帮助 丹 以下是付款单数据库记录的示例: {"amount":45,"currency":"AUD","description":"Payment for #96","clientIp":"127.0.0.1"
{"amount":45,"currency":"AUD","description":"Payment for #96","clientIp":"127.0.0.1","card":{},"_reference":null,"_status":"failed","_status_code":null,"_status_message":null}
以下是我的配置:
payum:
security:
token_storage:
XX\PaymentBundle\Entity\PaymentToken: { doctrine: orm }
storages:
XX\PaymentBundle\Entity\Order: { doctrine: orm }
contexts:
SecurePay_DirectPost:
omnipay:
type: 'SecurePay_DirectPost'
options:
merchantId: ABC0001
transactionPassword: abc123
testMode: true
我的捕获方法是:
/**
* @Route("/{id}/cardcapture", name = "card_payment_capture")
* @Template()
*/
public function captureSecurePayAction(Collection $collection) {
$paymentName = 'SecurePay_DirectPost';
$storage = $this->get('payum')->getStorage('XX\PaymentBundle\Entity\Order');
$order = $storage->createModel();
$paymentDetails['amount'] = 10;
$paymentDetails['card'] = new SensitiveValue(array(
'number' => $_POST['card-number'],
'cvv' => $_POST['cvv'],
'expiryMonth' => $_POST['exp-month'],
'expiryYear' => $_POST['exp-year'],
'firstName' => $_POST['card-name'],
'lastName' => '',
));
$order->setNumber($collection->getId());
$order->setCurrencyCode('AUD');
$order->setTotalAmount($collection->getAmount()."00");
$order->setDescription('Payment for #' . $collection->getId());
$order->setClientId($collection->getId());
$order->setClientEmail($collection->getEmail());
$storage->updateModel($order);
$captureToken = $this->get('payum.security.token_factory')->createCaptureToken(
$paymentName,
$order,
'payment_complete'
);
return $this->redirect($captureToken->getTargetUrl());
}
最后是我的全部行动:
/**
* @Route("/complete", name = "payment_complete")
* @Template()
*/
public function completeAction()
{
$token = $this->get('payum.security.http_request_verifier')->verify($this->request);
$payment = $this->get('payum')->getPayment($token->getPaymentName());
$payment->execute($status = new GetHumanStatus($token));
$model = $status->getModel();
$id = explode("#", $model['description']);
$collection = $this->em->getRepository('XXCollectionBundle:Collection')->find($id[1]);
if ($status->isCaptured()) {
$collection->setStatus("PAID");
$collection->setAmountPaid($model['PAYMENTREQUEST_0_AMT']);
$collection->setIsActive(true);
} else if ($status->isPending()) {
$collection->setStatus("PAYMENT PENDING");
} else {
$collection->setStatus("PAYMENT FAILED");
}
$this->em->persist($collection);
$this->em->flush();
$this->sendReceiptEmail($collection, $status);
return array(
'status' => $status,
'collection' => $collection
);
}
你使用什么版本的Payum?以下是我的依赖项:
“Payum/Payum捆绑包”:“0.12.0”、“Payum/offline”:“*@stable”、“Payum/paypal express checkout nvp”:“~0.12”、“omnipay/securepay”:“~2.1”、“Payum/omnipay bridge”:“*@stable”
好的,我会尝试PaymentDetails对象。。我没有收到任何错误,虽然与当前设置,只是没有与网关通信。你在任何地方看到过任何好的文档吗?尝试升级到0.14。它目前很稳定,omnipay bridge中可能有一些错误修复。我已经升级了。。我认为omnipay bridge不能与新版本0.14.2配合使用。我在任何地方都找不到任何关于实现的文档。这太令人沮丧了!