dongle2627 2014-04-11 06:39
浏览 46

omn​​ipay pin支付蛋糕php 2.0

I need help regarding omnipay pin payments. i have no clue how to integrate this to cake php.

i tried this sample code but dint get success

$gateway = GatewayFactory::create('Pin');
$gateway->setSecretKey('your-secret-api-key');
$gateway->purchase([
  'email'       => 'customer@email.com',
  'description' => 'Widgets',
  'amount'      => '4999',
  'currency'    => 'USD',
  'card_token'  => 'card_nytGw7koRg23EEp9NTmz9w',
  'ip_address'  => '1.2.3.4'
])->send(); 

Fatal error: Class 'GatewayFactory'

Please help me . Thanks in advance

  • 写回答

1条回答 默认 最新

  • doulu1968 2014-04-12 01:14
    关注

    You need to use Composer to install Omnipay. This is explained in the Omnipay Readme.

    Make a file called composer.json in the root of your project directory:

    {
        "require": {
            "omnipay/pin": "~2.0"
        }
    }
    

    Then run the following commands in a terminal window:

    $ curl -s http://getcomposer.org/installer | php
    $ php composer.phar update
    

    This will download the Omnipay files into your vendor/ directory.

    Next, you will need to put the following line at the top of your index.php file, to register the composer autoloader:

    require 'vendor/autoload.php';
    

    Finally, you can use Omnipay in your project to create the Pin gateway:

    $gateway = Omnipay\Omnipay::create('Stripe');
    
    评论

报告相同问题?

悬赏问题

  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗