According to the docs, I can submit a form like this (example);
<form method="post" action="https://test.ipg-online.com/connect/gateway/processing">
<input type="hidden" name="txntype" value="sale">
<input type="hidden" name="timezone" value="CET"/>
<input type="hidden" name="txndatetime" value="2015:12:11-09:12:47"/>
<input type="hidden" name="hash" value="7a17dcc15df2819649ca80b7921"/>
<input type="hidden" name="storename" value="12345678"/>
<input type="hidden" name="mode" value="fullpay"/>
<input type="text" name="chargetotal" value="13.00"/>
<input type="hidden" name="currency" value="826"/>
<input type="hidden" name="responseSuccessURL" value="http://example.co.uk/thanks" />
<input type="hidden" name="responseFailURL" value="http://example.co.uk/failure" />
<input type="submit" value="Submit">
</form>
And that will work using something like Postman (but I've not supplied the correct storename
here). By "work" I mean, you get through to the their gateway and can enter your card details and shipping address etc.
In order to get the correct hash
and txndatetime
I can use the FirstData_Connect
Omnipay library.
I thought I could just use the public function getData
but actually, that requires details about the users card, cvv code, expiry etc. I don't want to have an interface like that on my site, I just want the user to be able to click through to https://test.ipg-online.com/connect/gateway/processing - like in the form example above.
So how do I structure the PHP side to make use of the Omnipay Library? So far I have;
$gateway = Omnipay::create('FirstData_Connect');
$gateway->setStoreId($storeId);
$gateway->setSharedSecret($sharedSecret);
$response = $gateway->purchase(array(
'returnUrl' => $returnUrl . '?' . http_build_query($arguments),
'cancelUrl' => $cancelUrl,
'amount' => $payment->getAmount(),
'transactionId' => $paymentId,
))->send();
$result = $response->getData();
return $result;
But, as I've said above, I am required to submit the users card details as well. So I get the error;
"message":"The card parameter is required",
"class":"Omnipay\\Common\\Exception\\InvalidRequestException