Pin payment laravel
use Omnipay\Omnipay;
use Omnipay\Common\GatewayFactory;
$load = new GatewayFactory();
$gateway= $load->create('Pin');
$gateway->initialize(array(
'secretKey' => 'your key',
'testMode' => true,
));
$card = array('number' => '4200000000000000', 'expiryMonth' => '6', 'expiryYear' => '2019', 'cvv' => '123','name'=>'name ','address1'=>'address','city'=>'city','country'=>'india');
$response=$gateway->purchase([
'email' => 'customer@email.com',
'description' => 'Widgets',
'amount' => '20.00',
'currency' => 'USD',
'card' => $card,
'ip_address' => $_SERVER['REMOTE_ADDR']
])->send();
if ($response->isRedirect()) {
// redirect to offsite payment gateway
$response->redirect();
} elseif ($response->isSuccessful()) {
// payment was successful: update database
print_r($response);
} else {
// payment failed: display message to customer
echo $response->getMessage();
print_r($response);
}
use Omnipay\Common\GatewayFactory;
$load = new GatewayFactory();
$gateway= $load->create('Pin');
$gateway->initialize(array(
'secretKey' => 'your key',
'testMode' => true,
));
$card = array('number' => '4200000000000000', 'expiryMonth' => '6', 'expiryYear' => '2019', 'cvv' => '123','name'=>'name ','address1'=>'address','city'=>'city','country'=>'india');
$response=$gateway->purchase([
'email' => 'customer@email.com',
'description' => 'Widgets',
'amount' => '20.00',
'currency' => 'USD',
'card' => $card,
'ip_address' => $_SERVER['REMOTE_ADDR']
])->send();
if ($response->isRedirect()) {
// redirect to offsite payment gateway
$response->redirect();
} elseif ($response->isSuccessful()) {
// payment was successful: update database
print_r($response);
} else {
// payment failed: display message to customer
echo $response->getMessage();
print_r($response);
}
Thanks, for providing good Information to community…
ReplyDeletePhp Web Development Company Bangalore | Ecommerce Website Designer India | Internet Marketing Company in Bangalore | Magento Website Developer In India