VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: ressel on November 23, 2007, 20:35:42 PM

Title: a payment module - howto do total price
Post by: ressel on November 23, 2007, 20:35:42 PM
Hello everyone,

I was thinking, isn't it possible to do something like this:

I tried to make this "link" button that will auto fill a payment form at the site ewire, with price, and subject = orderid, shouldn't it be possible?

The only thing i need is the price to be correct.

So what i need is the total price in this format how can i make the at:
2123.25 = 2123,25 in form: = (TransactionEmail_Amount=2123%2C25&)
decimal = , = ( %2C )

<?
$subtotal = $db->f("order_subtotal");
$orderid = $db->f("order_id");
$email = $user->email;
?>

<a target="_blank" href="https://secure.ewire.dk/payment/email.asp?TransactionEmail_Emailaddress=shop%40ybmail%2Edk&amp;TransactionEmail_Name=minBNC&amp;TransactionEmail_Subject=<? print "$orderid"; ?>&amp;TransactionEmail_Message=<? print "$email"; ?>&amp;TransactionEmail_Amount=<? print "$subtotal"; ?>&amp;TransactionEmail_Currency=DKK&amp;TransactionEmail_AllowChange=30&amp;TransactionEmail_ViewEmail=1">
<img src=/images/stories/ewire.gif></a>
Title: Re: a payment module - howto do total price
Post by: ressel on November 29, 2007, 19:24:35 PM
Doesn't anyone in here know how i can convert the price??
Title: Re: a payment module - howto do total price
Post by: ressel on November 29, 2007, 20:43:44 PM
Its maybe not the best solution, but it works :D

<?
$subtotal = $db->f("order_subtotal");
$tax = $db->f("order_tax");
$discount = $db->f("order_discount");
$newsubtotal = $subtotal + $tax - $discount;
$orderid = $db->f("order_id");
$email = $user->email;
$newprice = str_replace(".","%2C",$newsubtotal);
?>
Husk at kontrollere at prisen er korrekt indtastet hos ewire!<br>
<a target="_blank" href="https://secure.ewire.dk/payment/email.asp?TransactionEmail_Emailaddress=shop%40ybmail%2Edk&amp;TransactionEmail_Name=minBNC&amp;TransactionEmail_Subject=<? print "$orderid"; ?>&amp;TransactionEmail_Message=<? print "$email"; ?>&amp;TransactionEmail_Amount=<? print "$newprice"; ?>&amp;TransactionEmail_Currency=DKK&amp;TransactionEmail_AllowChange=30&amp;TransactionEmail_ViewEmail=1">
<img src=http://www.ybnet.dk/images/stories/ewire.gif></a>