-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4.0.0 - Add AdyenResponse class *Note this is a breaking change from 3.x.x
- Loading branch information
Showing
11 changed files
with
123 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Contribution guidelines | ||
|
||
## How to contribute step-by-step | ||
|
||
1. Fork the `Adyen/adyen-ruby-api-library` repository. | ||
2. Create a new branch from `develop` in your fork. This makes it easier for you to keep track of your changes. | ||
3. Make the desired changes to the code. | ||
* If you are adding new functionality or fixing a bug, we recommend you add unit tests that cover it. | ||
4. Push the changes to your fork. | ||
5. Create a pull request to the `Adyen/adyen-ruby-api-library` repository. | ||
6. In your pull request, please describe in detail: | ||
* What problem you’re solving | ||
* Your approach to fixing the problem | ||
* Any tests you wrote | ||
7. Check Allow edits from maintainers. | ||
8. Create the pull request. | ||
9. Ensure that all checks have passed. | ||
|
||
After you create your pull request, one of the code owners will review your code. | ||
We aim to review your request within 2-3 business days. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ response = adyen.checkout.payments({ | |
|
||
### Change API Version | ||
```ruby | ||
adyen.checkout.version = 49 | ||
adyen.checkout.version = 50 | ||
``` | ||
|
||
## List of supported methods | ||
|
@@ -139,7 +139,15 @@ adyen.checkout.version = 49 | |
## Support | ||
|
||
If you have any problems, questions or suggestions, create an issue here or send your inquiry to [email protected]. | ||
|
||
|
||
## Contributing | ||
We strongly encourage you to join us in contributing to this repository so everyone can benefit from: | ||
* New features and functionality | ||
* Resolved bug fixes and issues | ||
* Any general improvements | ||
|
||
Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how. | ||
|
||
## Licence | ||
|
||
MIT license. For more information, see the LICENSE file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'json' | ||
|
||
module Adyen | ||
class AdyenResult | ||
attr_reader :response, :header, :status | ||
|
||
def initialize(response, header, status) | ||
@response = JSON.parse(response) | ||
|
||
# `header` in Faraday response is not a JSON string, but rather a | ||
# Faraday `Headers` object. Convert first before parsing | ||
@header = JSON.parse(header.to_json) | ||
@status = status | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This utility method monkey-patches Ruby's Hash class to allow keys to be read | ||
# and updated with dot notation. Usage is entirely optional (i.e., hash values | ||
# can still be accessed via symbol and string keys). | ||
# | ||
# Credit: https://gist.github.com/winfred/2185384#file-ruby-dot-hash-access-rb | ||
|
||
class Hash | ||
class NoKeyOrMethodError < NoMethodError; end | ||
def method_missing(method,*args) | ||
m = method.to_s | ||
string_key = m.gsub(/=$/,'') | ||
sym_key = string_key.to_sym | ||
if self.has_key? string_key | ||
m.match(/=$/) ? self.send("[#{string_key}]=", *args) : self[string_key] | ||
elsif self.has_key? sym_key | ||
m.match(/=$/) ? self.send("[#{sym_key}]=", *args) : self[sym_key] | ||
else | ||
raise NoKeyOrMethodError | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Adyen | ||
module Adyen | ||
NAME = "adyen-ruby-api-library" | ||
VERSION = "3.0.2".freeze | ||
VERSION = "4.0.0".freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters