IkoroVictor / paystack-ruby

A ruby gem for easy integration of Paystack.
MIT License
31 stars 28 forks source link

I can't figure out what ['data'] means #1

Closed osazemeu closed 8 years ago

osazemeu commented 8 years ago

I can't figure out what ['data'] in this line of code means; auth_url = result['data']['authorization_url']

['authorization_url'] is for positive response or success page but I have read through the docs and couldn't figure out what params am passing to 'data'.

Could you help me out? Am I missing anything??

IkoroVictor commented 8 years ago

Here is a sample response format from paystack for initializing transactions

{ "status": true, "message": "Authorization URL created", "data": { "authorization_url": "https://standard.paystack.co/pay/0peioxfhpn", "access_code": "0peioxfhpn", "reference": "7PVGX8MEk85tgeEpVDtD" } }

You can see the data JSON object there.

When JSON.parse is called, it deserializes the object into a hashset.

Here is the link to the sample response

osazemeu commented 8 years ago

thanks