Ajax Checkout & Payment
The Checkout and Payment family of Ajax methods allow you to validate some payment methods from anywhere in Aurora. This is currently limited to use with Gift Cards from the following providers:
- Givex
- EagleEye
This article describes how to use the payment methods and what they do.
Get Balance AJAX Interface
Overview
Permission Required: None
Method Call: /checkout/payment-balance
Aurora Demo Example: http://demo.auroracommerce.com/checkout/
This method validates a balance driven additional payment method such as a Givex Gift Card.
Method Description
Method specific parameters
Name | Description | Example | Required? |
---|---|---|---|
payment_type | The Aurora payment process type. | hcc | Yes |
transaction_type | The Aurora payment transaction type identifier. | Givex GiftCard or EagleEye GiftCard | Yes |
card_number | The card number. | 4000 0000 1234 5678 | Yes |
expiry_month | The card export month (please provide 00 if your cards do not support expiry dates). | 06 | Yes |
expiry_year | The card export year (please provide 00 if your cards do not support expiry dates). | 2020 | Yes |
cvv | The card CVV. | 123 | No |
recaptcha_response | The response given resulting from a successful ReCaptcha validation attempt. | N/A | Yes, if no CVV has been provided, otherwise No. |
The ReCapture process is only require if:
a) It is configured in Aurora.
b) The CVV number has not been provided. If the CVV number is provided, then it will be assumed that the Gift Card provider requires this for validation and so will be used in place of the ReCapture process.
Example Template Code
<script type="text/javascript">
var request_data = {
payment_type: 'hcc',
transaction_type: 'Givex GiftCard',
card_number: card_number.val(),
expiry_month: expiry_month.val(),
expiry_year: expiry_year.val(),
cvv: cvv.val()
};
$.get('/checkout/payment-balance', request_data, function(response) {
if (response.balance > 0) {
alert('Card is valid');
} else {
alert('Card is not valid or has no balance');
}
}, 'json');
</script>
Updated over 2 years ago