0

Hello I need your help I've been working on this since yesterday with no success at all. I'm creating an MD5 string for token value but it's not passing at all below are the information. Must be a hex-encoded MD5 HASH (32 digit hexadecimal number) of a concatenation of the following parameter values separated by”:” (values should be in lower case)

First, values should be converted to lower case: Parameter: merchant_id value: test Parameter: amount value: 15.25 Parameter: currency value: usd Parameter: key value: alfa

Then their values are contacted: test:15.25:aed:alfa

what I've did is the following codes: a. md5($this->data['merchant_id'] . $this->data['amount'] . $this->data['currency'] . $this->data['key'])

b. md5($this->data['merchant_id'] . ':; . $this->data['amount'] . ':; . $this->data['currency'] . ':; . $this->data['encryption_key'])

c. $hash = $this->request->post['merchant_id']; $hash .= $this->request->post['amount']; $hash .= $this->request->post['currency']; $hash .= $this->request->post['key'];

None of them is working can anybody help me please and thank you!

4

1 回答 1

0

It looks like you're using php. The first thing you can do is to use additional string variable to create the concatenated value:

$stringValue = $this->data['merchant_id'] . ':' . $this->data['amount'] . ':' 
    . $this->data['currency'] . ':' . $this->data['key'];

Check if it outputs the proper values (echo $stringValue;). If it's okay, then use md5:

$md5Value = md5($stringValue);
于 2013-03-29T22:06:01.563 回答