Search code examples
javasha256payfort

Payfort Signature mismatch


I have this request body to generate report:

{
    "from_date":"2020-06-17T00:00:01+03:00",
    "to_date":"2020-06-18T10:59:59+03:00",
    "signature":"df4c2bbbd5dd044036e11f26845a170b93249fd657339bf88b59b6340e2f****",
    "merchant_identifier":"gGRRR***",
    "merchant_reference":"1592472727964",
    "columns":["amount","card_number"],
    "query_command":"GENERATE_REPORT",
    "access_code":"VYqRIJEhOHNFgDMbu***"
}

And I have my signature before signing as :

MYPASSaccess_code=VYqRIJEhOHNFgDMbu***columns=[amount,card_number]from_date=2020-06-17T00:00:01+03:00merchant_identifier=gGRRR***merchant_reference=1592472727964query_command=GENERATE_REPORTto_date=2020-06-18T10:59:59+03:00MYPASS

So its Hash256 = df4c2bbbd5dd044036e11f26845a170b93249fd657339bf88b59b6340e2f****

But the hash I have received in the response is:

1b3d301ff248ec0848eeb1376f4b4344e648cba60f18c63dcc9e939d6c83****

What am I making wrong? May be something related to date?


Solution

  • So far: I found in the documentation an important note:

    NOTE!

     In the columns parameter; you should:

    1. Open brackets.

    2. Put a “comma” then a “space” between the columns value.

    Example: columns=[acquirer_name, authorization_code, amount, bin_number]

     In the filters parameter; you should:

    1. Open brackets.
    2. Then open a curly brackets.
    3. Write the “key”
    4. Put a “comma” then a “space.
    5. Write the “value” of the key.