paymenwall gateway integration with laravel 5.1

393 views Asked by At

I tried to implement paymentwall gateway with laravel 5.1 using omnipay.But there is no exact documentation or sample codes available.Is there any implementation samples available for omnipay paymentwall integration with laravel.

1

There are 1 answers

0
delatbabel On

There is documentation including usage examples in the class header files for the omnipay-paymentwall library.

Example

// Create a gateway for the PaymentWall REST Gateway
// (routes to GatewayFactory::create)
$gateway = Omnipay::create('PaymentWall');

// Initialise the gateway
$gateway->initialize(array(
    'apiType'      => $gateway::API_GOODS,
    'publicKey'    => 'YOUR_PUBLIC_KEY',
    'privateKey'   => 'YOUR_PRIVATE_KEY',
));

// Create a credit card object
// This card can be used for testing.
$card = new CreditCard(array(
            'firstName'             => 'Example',
            'lastName'              => 'Customer',
            'number'                => '4242424242424242',
            'expiryMonth'           => '01',
            'expiryYear'            => '2020',
            'cvv'                   => '123',
            'email'                 => '[email protected]',
            'billingPostcode'       => '4999',
));

// Do a purchase transaction on the gateway
$transaction = $gateway->purchase(array(
    'amount'                    => '10.00',
    'accountId'                 => 12341234,
    'currency'                  => 'AUD',
    'clientIp'                  => '127.0.0.1',
    'packageId'                 => 1234,
    'description'               => 'Super Deluxe Excellent Discount Package',
    'fingerprint'               => '*token provided by Brick.js*',
    'browserDomain'             => 'SiteName.com',
    'card'                      => $card,
));
$response = $transaction->send();
if ($response->isSuccessful()) {
    echo "Purchase transaction was successful!\n";
    $sale_id = $response->getTransactionReference();
    echo "Transaction reference = " . $sale_id . "\n";
}