Here is what I have so far. Not sure if I am doing this right.
<?php
class Payment {
// Initial Setting Functions
function sendPayment(&$bean, $event, $arguments) {
//create a new cURL resource
$username = 'demo';
$password = 'password';
$type = $bean->type;
$ccnumber = $bean->ccnumber;
$ccexp = $bean->ccexp;
$cvv = $bean->cvv;
$amount = $bean->amount;
$url = "https://secure.chargebackguardiangateway.com/api/transact.php";
$post = "?username=$username&password=$password&type=$type&ccnumber=$ccnumber&ccexp=$ccexp&cvv=$cvv&amount=$amount";
$type1 ='sale';
switch ($type) {
case $type1:
$ch = curl_init($url);
//set URL and oter appropriate options
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_POST, 1);
curl_close($ch);
break;
}
}
}
?>