【问题标题】:Need help in implementing omnipay在实施omnipay方面需要帮助
【发布时间】:2014-10-28 10:18:00
【问题描述】:

大家好,我需要一个工作示例来使用 Omnipay 库的 stripe 和 skrill。

github 代码对我帮助不大。谢谢你

use Omnipay\Omnipay;

$gateway = Omnipay::create('Stripe'); $gateway->setApiKey('abc123');

$formData = ['number' => '4242424242424242', 'expiryMonth' => '6',
'expiryYear' => '2016', 'cvv' => '123']; $response =
$gateway->purchase(['amount' => '10.00', 'currency' => 'USD', 'card'
=> $formData])->send();

if ($response->isSuccessful()) {
    // payment was successful: update database
    print_r($response); } elseif ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect(); } else {
    // payment failed: display message to customer
    echo $response->getMessage(); }

【问题讨论】:

  • 嗨,Mihai,我使用 Omnipay for Paypal 并且可以正常工作,但是在为 Stripe 创建时却无法创建。

标签: omnipay


【解决方案1】:

我觉得应该是$gateway = GatewayFactory::create('PayPal_Express');

还有显示的确切错误是什么。

【讨论】: