Payfort Error code: 00002 Invalid parameter format

3.5k Views Asked by At

I'm trying to add payfort as a payent gateway to a new section in a website. The same code works correctly in another section. I always get "Error code: 00002 Invalid parameter format"

<form method="post" action="https://checkout.payfort.com/FortAPI/paymentPage" class="pay_form" name="form1">
<input type="hidden" name="access_code" value="access_code">
<input type="hidden" name="amount" value="1000.00">
<input type="hidden" name="command" value="PURCHASE">
<input type="hidden" name="currency" value="USD">
<input type="hidden" name="customer_email" value="[email protected]">
<input type="hidden" name="customer_name" value="customer name">
<input type="hidden" name="language" value="en">
<input type="hidden" name="merchant_identifier" value="identifier_code">
<input type="hidden" name="merchant_reference" value="order_id">
<input type="hidden" name="return_url" value="my_return_url">
<input type="hidden" name="signature" value="form_signature">
</form>

I compared this form to another form in the other section and they are similar to each other but order id, return url and amount are different but the first form works without any issues. Any ideas?

1

There are 1 best solutions below

0
On

It's because payfort only accepts whole number as amount. You need to multiply the actual amount by 100 and before sending request to payfort make sure its whole number.