-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help please. Asking for card parameter when integrating sagepay form #150
Comments
The I can't remember which of those are mandatory (if any), so try using an empty Docs need updating regardless. |
Hi, Do you mean adding: use Omnipay\Common\CreditCard; to the top of the script I then populate it as per your server example (although this is being used for a form) $card = new CreditCard([ then push this array in to the authorize function (instead of purchase)? Sorry, a little confused here. TIA |
Yes, that's right. In your authorize or purchase method array, include the element, along with everything you already have:
I have this in some test scripts: $card = new CreditCard([
'firstName' => 'Jason',
'lastName' => 'Judge',
...
]);
$requestMessage = $gateway->purchase([
// or
//$requestMessage = $gateway->authorize([
'amount' => '99.99',
'currency' => 'GBP',
'card' => $card,
'transactionId' => $transactionId,
'description' => 'Pizzas for everyone',
...
]); Look from page 36 here: A number of fields are listed as mandatory, such as the billing and delivery names, and billing address. These fields are supplied by Omnipay through the |
Hi, Thanks. Therefore should DeliveryAddress1 be repeated in the purchase array? My code follows: $card = new CreditCard([ $request = $gateway->purchase([ $response = $request->send(); |
Ok, figured out the problem. |
If you just supply the billing address, the driver will duplicate it into the delivery address for you. The first name, last name, and billing address is the minimum requirements. |
I am integrating SagePay\Form to my site and have the following:
$gateway = OmniPay::create('SagePay\Form')->initialize([
'vendor' => 'my_vendor',
'testMode' => true,
'encryptionKey' => 'my_encryption_key',
]);
$request = $gateway->authorize([
'VendorTxCode' => 'ABC_1234',
'transactionId' => 12345,
'Amount' => 10,
'Currency' => 'GBP',
'Description' => 'my_description',
'SuccessURL' => 'https://example.com/success',
'returnURL' => 'https://example.com/success',
'FailureURL' => 'https://example.com/failure',
... other sagepay parameters ...
]);
$request->send();
$response->redirect();
However, After the parameters have been sent for authorization I get an
error:
PHP Fatal error: Uncaught Omnipay\Common\Exception\InvalidRequestException: The card parameter is required
in /vendor/omnipay/common/src/Common/Message/AbstractRequest.php
As this is a Form, I don't have any card details to send.
Do you know what I am doing wrong?
The text was updated successfully, but these errors were encountered: