Have you looked at the demo code provided with the plugin?
PHP Code:
// attempt the charge (array $data, boolean $testing)
$response = $this->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'));
}
it looks like this assumes you've already collected the credit card number and other info from the user. I don't know much about CakePHP, so I couldn't say exactly how to integrate it. This isn't a "plugin" in the sense that you can just "plug it in" and expect it to work - you have to write your code to use it.
I will say that, if you're going to deal with CC info at all, you need to find someone who really knows what they're doing so you can be sure it's secure.
I'm not being dismissive or condescending - I'm as sincere as I can be.
Seriously: if you have to ask, about any of it, then you shouldn't be doing it yourself.
Money is a big responsibility, and a big risk. All of my clients get a strong recommendation for using PayPal instead.
Bookmarks