Pay Bill - Status 'https://staging.linkpt.net', 'port' => '1129', 'key' => $dir.'/1001303973.pem', 'configfile' => '1001303973' ); $config['Ggapi']['live'] = array( 'url' => 'https://secure.linkpt.net', 'port' => '1129', 'key' => $dir.'/1001303973.pem', 'configfile' => '1001303973' ); // Starting GGApi $ggapi = new Ggapi($config); // GGApi Data - to be send to GGApi $ggapi_data = array( 'order_total' => $_POST['x_amount'], 'subtotal' => $_POST['x_amount'], 'tax' => 0, 'shipping' => 0, 'card_num' => $_POST['x_card_num'], 'card_date' => array('month' => substr($_POST['x_exp_date'],0,2)), 'short_year' => substr($_POST['x_exp_date'],4,2), 'card_cvc' => $_POST['x_card_code'], 'full_name' => $_POST['x_first_name'].' '.$_POST['x_last_name'], 'address' => $_POST['x_address'], 'city' => $_POST['x_city'], 'state' => $_POST['x_state'], 'zip' => $_POST['x_zip'], 'email' => $_POST['x_email'], 'phone' => $_POST['x_phone'], 'shipping_full_name' => '', 'shipping_address' => '', 'shipping_city' => '', 'shipping_state' => '', 'shipping_zip' => '', 'ip_address' => '', 'patient_name' => 'Patient Name: '.$_POST['x_patient_name'], 'invoice_num' => $_POST['x_invoice_num'], 'quantity' => 1 ); // Send data to GGApi, and get response $response = $ggapi->ggProcess($ggapi_data, true); if ($response && $response['r_approved'] == 'APPROVED') { echo "

".$_POST["x_first_name"].", your payment was successfully submitted. Thank you.

"; } else { file_put_contents('payments.txt', print_r($_POST, true), FILE_APPEND); file_put_contents('payments.txt', print_r($response, true), FILE_APPEND); echo "

".$_POST["x_first_name"]." your payment failed. Please try again.

"; } ?>