Author Topic: a payment module - howto do total price  (Read 3364 times)

ressel

  • Beginner
  • *
  • Posts: 8
a payment module - howto do total price
« 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 )

Code: [Select]
<?
$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>

ressel

  • Beginner
  • *
  • Posts: 8
Re: a payment module - howto do total price
« Reply #1 on: November 29, 2007, 19:24:35 pm »
Doesn't anyone in here know how i can convert the price??

ressel

  • Beginner
  • *
  • Posts: 8
Re: a payment module - howto do total price
« Reply #2 on: November 29, 2007, 20:43:44 pm »
Its maybe not the best solution, but it works :D

Code: [Select]
<?
$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>