I am using Chronoforms 4.0 on Joomla 2.5
I have built a form that asks the visitor for a foreign currency amount to be sent to a company in that nation. I have written a custom PHP script that talks to Google Conversion and comes back with the equivalent dollar amount in US Currency plus a service fee. Then I am sending it to the Auth.net payment module and I need Auth.net to call up that amount from the database to process the payment. Upon successful payment transaction, I wish to bring up the order information as a confirmation & email reciept.
1.) How can I get my newly converted USD amount to save into the database since it is calculated in a custom PHP field?
2.) How can I call that dollar amount into the Amount Field of the Authorize.net module?
3.) How can I call that newly saved information to a confirmation page & email them a receipt with all the info including cf_id, cf_created, creditcardnumber (last 4 digits), and the amount they paid in usd from my php calculation?
Here is a copy of my PHP conversion script (I called the field kestousd:
I have built a form that asks the visitor for a foreign currency amount to be sent to a company in that nation. I have written a custom PHP script that talks to Google Conversion and comes back with the equivalent dollar amount in US Currency plus a service fee. Then I am sending it to the Auth.net payment module and I need Auth.net to call up that amount from the database to process the payment. Upon successful payment transaction, I wish to bring up the order information as a confirmation & email reciept.
1.) How can I get my newly converted USD amount to save into the database since it is calculated in a custom PHP field?
2.) How can I call that dollar amount into the Amount Field of the Authorize.net module?
3.) How can I call that newly saved information to a confirmation page & email them a receipt with all the info including cf_id, cf_created, creditcardnumber (last 4 digits), and the amount they paid in usd from my php calculation?
Here is a copy of my PHP conversion script (I called the field kestousd:
<?php
function currency_convert($amount, $from="kes", $to="usd") {
$exchangeProvider='http://www.google.com/ig/calculator?hl=en&q=' . $amount . $from . '=?' . $to;
$result=file_get_contents($exchangeProvider);
$result=preg_replace('/[^\w." ]/', '', $result);
$expl=explode('"', $result);
if (($expl[1] == '') || ($expl[3] == '')) {
return false;
} else {
return array($expl[1], $expl[3]);
}
}
$amountTotal=currency_convert($_POST['amount'], 'kes', 'usd');
$amountTotal=$amountTotal[1]*1.03;
$amountTotal=round($amountTotal+2.99,2);
?>