The Ggapi component simplifies credit card processing using the First Data/Yourpay/Linkpoint Global Gateway API. It supports testing and live configurations, along with local to remote field mapping. Once configured, all you have to do is feed the component an array of order data (fields used are up to you) and it will map the fields, build the XML string, submit the string, read the response from the gateway, and convert the response back into an array.
Requirements: PHP5 with curl support and a Global Gateway API account (live or testing).
Download/git clone at http://github.com/chronon/ggapi.
The FirstData gateway needs a .pem file installed. This file can be downloaded from the downloads area of your FirstData account. test account of first data is http://www.firstdata.com/gg/apply_test_account.htm
If you access your website’s files (either using FTP or the host’s control panel file manager) drill down into the wp-content/plugins directory and drill down further into event-espresso.3.1.21.P/gateways/firstdata. There should be a few files in there. Upload the Pem file that you downloaded from First Data to that folder.
Make sure the file you upload has the same name as your store number. So if your store number is 12345678, the PEM file name should be 12345678.pem
Requirements: PHP5 with curl support and a Global Gateway API account (live or testing).
Example controller code:
<?php Ggapi->ggProcess($data, true); // update the order table with the response if ($response) { if ($response['r_approved'] == 'APPROVED') { // merge the response data with the order data $this->data['Order'] = array_merge($this->data['Order'],
$response);
} else {
// card was DECLINED
$error = explode(':', $response['r_error']);
$this->Session->setFlash(
'Your credit card was declined. The message was: '.
$error[1],'modal',
array('class' => 'modal error')
);
$this->redirect(array('controller' => 'orders',
'action' => 'checkout'));
}
} else {
// no response from the gateway
$this->Session->setFlash(
'There was a problem connecting to our payment gateway,
please try again.',
'modal',
array('class' => 'modal error')
);
$this->redirect(array('controller' => 'orders',
'action' => 'checkout')); } ?>
Download/git clone at http://github.com/chronon/ggapi.
The FirstData gateway needs a .pem file installed. This file can be downloaded from the downloads area of your FirstData account. test account of first data is http://www.firstdata.com/gg/apply_test_account.htm
If you access your website’s files (either using FTP or the host’s control panel file manager) drill down into the wp-content/plugins directory and drill down further into event-espresso.3.1.21.P/gateways/firstdata. There should be a few files in there. Upload the Pem file that you downloaded from First Data to that folder.
Make sure the file you upload has the same name as your store number. So if your store number is 12345678, the PEM file name should be 12345678.pem
No comments:
Post a Comment