omise / omise-ruby

Omise Ruby Library
https://docs.opn.ooo
MIT License
40 stars 20 forks source link

Add documentation for overriding API key #22

Closed jagdeepsingh closed 5 years ago

scomma commented 5 years ago

It isn't always this straightforward. This is what we're using in our adapter's method_missing:

if args.last.is_a? Hash
  args.last.merge!(key: @key)
else
  args << {key: @key}
end

Nor is there an elegant solution when you are accessing nested resources, e.g. charge.transaction or charge.capture.

robinclart commented 5 years ago

Currently working on a solution to this problem. Will update the gem soon. Closing for now. Thanks for your contribution.