danibram / trustly-client

A node client to comunicate with trustly.
https://github.com/danibram/trustly-client
MIT License
6 stars 8 forks source link

Fix issue with serialization of arrays, add Balance method #22

Closed zappen999 closed 6 years ago

zappen999 commented 6 years ago

Fix issue when verifying response signature. The serialized data would end up being: Balancef36bd672-5a9a-4e37-84d2-a356b0be3334[object Object]

This PR makes it handle arrays as well. I also added the Balance method (untested).

danibram commented 6 years ago

PR merged im uploading new version! Can you provide an example of the input output of the serialization? I want to add test for this part, its important that you test with the test environment the example before send to me, i dont have a trustly account anymore to test... Thanks for your contribution!!

danibram commented 6 years ago

Version 3.0.1 up!

zappen999 commented 6 years ago

This was the response from trustly:

[
    {
        "currency": "SEK",
        "balance": 12344.23
    }
]

The output would become: balance12344.23currencySEK which matches Trustlys own serialize-tester-tool: https://trustly.com/en/developer/api/#/signaturetester