PHP code example of collizo4sky / omnipay-wepay
1. Go to this page and download the library: Download collizo4sky/omnipay-wepay library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
collizo4sky / omnipay-wepay example snippets
$gateway = Omnipay::create('WePay');
$gateway->setAccountId('583276666');
$gateway->setAccessToken('STAGE_ca4cf9c5d209343d18dae0fc47b908f2d17b47654eecb1fc55bc8652946kdirl');
$gateway->setTestMode(true);
$formData = array('firstName' => 'Foo', 'lastName' => 'Baz', 'email' => '[email protected] ');
$response = $gateway->purchase(
array(
'token' => '3843295557',
'transactionId' => '12345678',
'amount' => '25.50',
'currency' => 'USD',
'description' => 'A vacation home rental',
'returnUrl' => 'http://localhost.dev/wepay/complete.php',
'card' => $formData
)
)->send();
$gateway = Omnipay::create('WePay');
$gateway->setAccountId('583276666');
$gateway->setAccessToken('STAGE_ca4cf9c5d209343d18dae0fc47b908f2d17b47654eecb1fc55bc8652946kdirl');
$gateway->setTestMode(true);
$formData = array('firstName' => 'Foo', 'lastName' => 'Baz', 'email' => '[email protected] ');
$response = $gateway->purchase(
array(
'transactionId' => '12345678',
'amount' => '25.50',
'currency' => 'USD',
'description' => 'A vacation home rental',
'returnUrl' => 'http://localhost.dev/wepay/complete.php',
'card' => $formData
)
)->send();