WebSite X5Help Center

 
Andre Kruger
Andre Kruger
User

I need help with setting up custom payment - update  en

Autor: Andre Kruger
Visitado 929, Seguidores 1, Compartilhado 0  

I have new information about my problem, but it seems I cannot edit a question after posting.

My posted problem is as follows:

I have trouble with the format of the [PRICE]

I attached a screenshot of  [PRICE], which I found while trying to fix the problem with my limited knowledge of php.

It seems that [PRICE] is passed down as a either 3 point or floating decimal ie"12345.890"

I receive this error message from my payment provider: "The amount format is invalid"

I need it in 2 point decimal ie "12345.89"

How can I convert [PRICE] to 2 point decimal to use as currency?

If I replace [PRICE] with a two point decimal, it works fine ie "100.00"

My Payment provider is very rigid that it must be in 2 point decimal.

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>

Publicado em
1 RESPOSTAS