You know how generic error messages arent much helpfull.
I'm trying to get Omnipay to work with Pin Payments.
This is what I have so far:
<?php
require 'vendor/autoload.php';
use Omnipay\CreditCard;
use Omnipay\Common\GatewayFactory;
$gateway = GatewayFactory::create('Pin');
$gateway->setSecretKey('KEY'); // TEST
$formData = ['number' => '4111111111111111', 'cvv' => '333','expiryMonth' => 6, 'expiryYear' => 2016];
$response = $gateway->purchase([
'email' => '[email protected]',
'description' => 'Widgets',
'amount' => '49.99',
'currency' => 'USD',
'card_token' => 'card_nytGw7koRg23EEp9NTmz9w',
'testMode' => true,
'ip_address' => '203.192.1.172',
'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
exit($response->getMessage());
}
echo $response->getMessage();
?>
And this is the error I get: One or more parameters were missing or invalid
Any help appreciated:)
Problem Solved:
Replace Above with the code below (note:->purchase(array( NOT ->purchase([