hello i ' m using Alertpay payment module ,i find it for free in this website :http://www.joellipman.com.
my issue is that my shop is base on tunisian dinar currency code is TND. Alertpay don't accept this currency code.
my installed currency conversion plugin is oandaCONVERT. could you help me . you can find the extra info bellow :
<?php $payment_url="https://www.alertpay.com/PayProcess.aspx";
$post_variables=Array( "ap_purchasetype"=>AP_PURCHASETYPE,
"ap_merchant"=>AP_MERCHANT,
"ap_additionalcharges"=>"0.00",
"ap_shippingcharges"=>$db->f("order_shipping"),
"ap_taxamount"=>$db->f("order_tax")+$db->f("order_shipping_tax"),
"ap_discountamount"=>$db->f("coupon_discount")+$db->f("order_discount"),
"ap_currency"=>$_SESSION["vendor_currency"],
"ap_returnurl"=>AP_RETURNURL."?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id"),
"ap_cancelurl"=>AP_CANCELURL,
"apc_1"=>$order_num_display );
$db1 = new ps_DB();
$q = "SELECT order_item_sku,order_item_name,product_quantity,product_final_price,product_attribute FROM #__vm_order_item WHERE order_id='".$db->f("order_id")."' ORDER BY order_item_id ASC";
$rows = $db1->query($q);
$i=0;
$order_num_display=$db->f("order_id");
while ($db1->next_record())
{ $this_item_name=trim($db1->f("order_item_name"));
$this_item_qty=$db1->f("product_quantity");
$this_item_sku=trim($db1->f("order_item_sku"));
$this_item_price=round($db1->f("product_final_price"),2);
$this_item_desc=strip_tags(str_replace("<br/>", " ", str_replace("<br />", " ", $db1->f("product_attribute"))));
$temp_item_name_varname=($i==0)?"ap_itemname":"ap_itemname_".$i;
$temp_item_qty_varname=($i==0)?"ap_quantity":"ap_quantity_".$i;
$temp_item_sku_varname=($i==0)?"ap_itemcode":"ap_itemcode_".$i;
$temp_item_price_varname=($i==0)?"ap_amount":"ap_amount_".$i;
$temp_item_desc_varname=($i==0)?"ap_description":"ap_description_".$i;
$post_variables[$temp_item_name_varname]=($i==0)?"Order #".$order_num_display.": ".$this_item_name:$this_item_name; $post_variables[$temp_item_qty_varname]=$this_item_qty;
$post_variables[$temp_item_sku_varname]=$this_item_sku;
$post_variables[$temp_item_price_varname]=$this_item_price;
$post_variables[$temp_item_desc_varname]=$this_item_desc; $i++; }
$ap_currency = "USD";
global $vendor_currency;
$amt_a = $post_variables["amount"];
$amt_s = $post_variables["shipping"];
if (!$vendor_currency){
$vendor_currency = $_SESSION['vendor_currency'];
}
if (file_exists( CLASSPATH.'currency/convertOANDA.php')) {
$traznet = new convertOANDA();
}
$convert = true;
require_once(CLASSPATH.'currency/convertOANDA.php');
$tmp_a = $traznet->convert( $amt_a, $vendor_currency, $paypal_currency );
$tmp_s = $traznet->convert( $amt_s, $vendor_currency, $paypal_currency );
if( !empty($tmp_a) && !empty($tmp_s)) {
$convert = 1;
$post_variables["amount"] = round( $tmp_a, 2);
$post_variables["shipping"] = round( $tmp_s, 2);
$post_variables["currency_code"] = $paypal_currency;
$update_post = 1;
}
if($page=="checkout.thankyou")
{
$query_string="?";
foreach($post_variables as $name=>$value)
{
$query_string.=$name."=".urlencode($value)."&";
}
vmRedirect($payment_url.$query_string);
}
else
{
echo '<form action="https://www.alertpay.com/PayProcess.aspx" enctype="application/x-www-form-urlencoded" method="post">';
foreach($post_variables as $name=>$value)
{
echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'" />';
} echo '</form>';
} ?>