Skip to content

Commit

Permalink
Improve the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Jun 10, 2018
1 parent 30b5750 commit dad8778
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ If successful, this will print:
}
```

**Very important** Make sure that you handle properly the trailing "=" symbols of the Base64 payload. More on the FAQ.

### Checking an invalid response/signature
If an invalid response or signature is provided:

Expand Down Expand Up @@ -176,6 +178,13 @@ This will print:
null
```

## FAQ

***Sometimes, random requests may fail, even if parameters are just what comes from RedSys***

* If you are getting the `Ds_MerchantParameters` and `Ds_Signature` from a URL, you may have trouble parsing the data properly. RedSys appends the Base64 payload without escaping the "=" symbols, and query string parsers may treat them as if they were a parameter assignment like `?id=123&test=456`.
* You are responsible of parsing and handling the entire payload, or otherwise the deciding will not match.

## Testing

To test the component, run `npm test`.
Expand Down

0 comments on commit dad8778

Please sign in to comment.