Jump to content

Recommended Posts

Hello, Could any one help me fix this I don't know what's the problem 

 

               I added the digital signing in the attached file unfortunately we still receive the invalid signature error

 

Any suggestion or help will be appreciated - this module is used in Opencart platform 

 

this is the line code – line 193 in the attached file and main integration file attached.

 

$data['fawry_signature'] = hash('sha256', $data['fawry_merchant_code'] . $data['fawry_merchantRefNumber'] . $data['fawry_customer']['customerProfileId'] . $product['productSKU'] . $product['quantity'] . $product['price'] . $payment_fawry_security_key);

 

Line 226

$signature = hash('sha256', $this->config->get('payment_fawry_merchant_code') . $data['fawry_merchant_code'] . $data['fawry_merchantRefNumber'] . $data['fawry_customer']['customerProfileId'] . $product['productSKU'] . $product['quantity'] . $product['price'] . $this->config->get('payment_fawry_security_key'));

 

and this is the request from the API documentation

 

If you’re using the old plugin

You need to send signature element in the request by hashing the below concatenating string in Sha256

Case of 1 charge item:

merchantCode + merchantrefNumber + customerProfileId(if exist) + productSKU + quantity + price(in two decimal format) + secure Key

 

Case of multiple charge items should be sorted first by sku:

merchantCode + merchantrefNumber + customerProfileId(if exist) + productSKU(of item-1) + quantity(of item-1) + price(of item-1 in two decimal format) + productSKU(of item-2) + quantity(of item-2) + price(of item-2 in two decimal format) + secure Key 

fawry.txt

Your description doesn't say whether the signature is raw bytes in base 64-encoding or hexadecimal bytes, so you need to confirm which is those is desired.

Otherwise, for the first line of code, my guess is you're not formatting the price with the correct "two decimal format".
For the second, you seem to be using the merchant code value twice. Seems pretty clear to be just by looking at that line...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.