【发布时间】:2014-08-13 18:29:45
【问题描述】:
我已经到处搜索并在 OmniPays github 上转了一圈,试图找到有关如何在 OmniPay 中实施 PayPal Express 的文档。
$response = Omnipay::purchase([
'amount' => $total,
'encodedTestIDs' => serialize($payForTestID),
'returnUrl' => 'http://php.bhiceu.com/payment/return',
'cancelUrl' => 'http://php.bhiceu.com/payment/cancel'
])->send();
//dd($response);
//die;
if ($response->isRedirect()) {
// redirect to offsite payment gateway
$response->redirect();
} else {
// payment failed: display message to customer
echo $response->getMessage();
}
上面的代码成功地将我发送到适当金额的 PayPal,当我取消或检查时,我返回到相应的 URL,但是我得到的只是 paypal 令牌,我找不到任何关于如何处理的文档.
【问题讨论】:
-
是的... Omnipay 似乎很方便,但文档根本不存在。你找到答案了吗?