WebSite X5Help Center

 
Andre Kruger
Andre Kruger
User

I need help with setting up custom payment  en

Auteur : Andre Kruger
Visité 1154, Followers 1, Partagé 0  

I have trouble with the format of the [PRICE]

I attached a screenshot of the error message.

In what format is  [PRICE] ?

It seems I need it in this format "12345.89"

I asume that [PRICE] is passed down as an integer ie"1234589"

How can I convert it to 2 point decimal to use as currency?

The url is https://www.dixi.co.za

<form action="https://sandbox.payfast.co.za/eng/process" method="post">
<input type="hidden" name="merchant_id" value="10000100">
<input type="hidden" name="merchant_key" value="46f0cd694581a">
<input type="hidden" name="return_url" value="https://www.dixi.co.za/success.html">
<input type="hidden" name="cancel_url" value="https://www.dixi.co.za/cancel.html">
<input type="hidden" name="notify_url" value="https://www.dixi.co.za/notify.html">

<input type="hidden" name="amount" value="[PRICE]">
<input type="hidden" name="item_name" value="[ORDER_NO]">
<input type="submit">
</form>

Posté le
3 RéPONSES - 1 UTILES - 1 CORRECT
Aleksej H.
Aleksej H.
Moderator

Hello. I sent a notification about your question to the company employees, expect an answer from them here in the comments.

Lire plus
Posté le de Aleksej H.
Incomedia
Stefano G.
Incomedia

Hello Andre

Unfortunately, this is not something that the Staff can provide support for.

The software can provide data about the order, but it's up to the user that adds the custom code to convert it accordingly. You need to implement additional custom code that receives the number and converts it to do so, but the official Staff cannot provide support for this

I will leave the topic open so that other users might eventually stop by and help you out with this

Thank you for your understanding

Stefano

Lire plus
Posté le de Stefano G.
Axel  
Axel  
User

Hello André,

The Stefano's / Incomedia's reply is absolutely abnormal... Because they provide a [PRICE] variable.

So their jos is to inform us how to use this one... 
And their documentation is poorlees on the payment variables.

Again I am not agree with the previous Stefano's reply.... it is not professionnal... !! yell

So I can help you because I have developped many custom payments with no Incomedia support because their is no support. Probably no knowledge too. foot-in-mouth

You can check all my custom payments into my demo here

https://wsx5demo.afsoftware.fr/boutik.php

Try to buy a fictive product and check all offered payments.

Regarding your issue because I have already worked on Payfast, try this into you payment code.


<script type="text/javascript">


// Price with 2 decimals
var m = [PRICE];
montant = m.toFixed(2);

....

document.getElementById('amount').value = montant;

.....

</script>

and

<input type='hidden' id='amount' name='amount' size='10'value=''><br><br>

Hope this helps

Enjoy!

Axel

Lire plus
Posté le de Axel