Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi again!
I've a need to be able to buy cards in multiple currencies and regions in the same app so I've added a couple of changes to make this easier. Again, I don't know if you're interested in these changes but here they are if you do :)
Firstly, the API has different endpoints for different regions which only service certain currencies. I've altered
AGCOD.config.uri
to return the correct URI given the currently set region and whether it's in production mode. This can, of course, still be overriden with a custom URISecondly, I've changed the way the
AGCOD.configure
config works slightly. Previously it would always create a newAGCOD::Config
object, initialised with the defaults, which meant in order to change one value (like the region for instance) you'd have to re-set everything again including secret keys and so on. I've changed it so that it will use an existing configuration for attributes you don't change.It's worth mentioning that there's a tiny edge case where this could break an existing app if it was relying on
AGCOD.configure
to change theproduction
,region
ortimeout
values back to their defaults from a previously set value. It would be a bit of a weird way to do it but I thought it worth mentioning!While I'm here, thanks for this gem by the way, which saved me from doing a lot of irritating work 😄