adyen-cse-ruby 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +21 -13
- data/adyen-cse-ruby.gemspec +2 -1
- data/lib/adyen_cse/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea59b9c101cd2d69299eb6b7168322331278de2f
|
4
|
+
data.tar.gz: e4eb587d6b0f8a22ac149856bf992edea4e9208e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b26b614a9a9489605a62700a02e5e821998cbf1fca20bc028fa77b46bb4edc3fffe85e9e7f2aaaf9a520609112479777762517f4f6938b7c44991a68e84085fd
|
7
|
+
data.tar.gz: 15957fd799f9c946a7d76d8a88f6b03f41a7911fa3e19ca0951ff7503366579dac9c449cc4317da320c48bb895dc915631b53aad764e9a22277da33608c723c2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
[](https://badge.fury.io/rb/adyen-cse-ruby)
|
1
2
|
[](https://travis-ci.org/jooeycheng/adyen-cse-ruby)
|
3
|
+
[](https://codeclimate.com/github/jooeycheng/adyen-cse-ruby/maintainability)
|
2
4
|
|
3
5
|
# Adyen CSE for Ruby
|
4
6
|
|
@@ -24,6 +26,10 @@ Or install it yourself as:
|
|
24
26
|
|
25
27
|
$ gem install adyen-cse-ruby
|
26
28
|
|
29
|
+
## Known issue
|
30
|
+
|
31
|
+
If you are facing error `OpenSSL::CCMError: unsupported cipher algorithm (AES)`, refer to [issue #11](https://github.com/jooeycheng/adyen-cse-ruby/issues/11).
|
32
|
+
|
27
33
|
## Usage
|
28
34
|
|
29
35
|
```ruby
|
@@ -58,7 +64,9 @@ Example of an `:adyen_test_card` factory with [factory_bot](https://github.com/t
|
|
58
64
|
require 'adyen_cse'
|
59
65
|
|
60
66
|
class AdyenTestCard
|
61
|
-
attr_reader :holder_name, :number, :expiry_month, :expiry_year, :cvc
|
67
|
+
attr_reader :holder_name, :number, :expiry_month, :expiry_year, :cvc
|
68
|
+
|
69
|
+
PUBLIC_KEY = "your_public_key_here"
|
62
70
|
|
63
71
|
def initialize(params = {})
|
64
72
|
@holder_name = params[:holder_name]
|
@@ -66,30 +74,30 @@ class AdyenTestCard
|
|
66
74
|
@expiry_month = params[:expiry_month]
|
67
75
|
@expiry_year = params[:expiry_year]
|
68
76
|
@cvc = params[:cvc]
|
69
|
-
@nonce = params[:nonce]
|
70
77
|
end
|
71
78
|
|
72
|
-
def
|
73
|
-
|
79
|
+
def nonce
|
80
|
+
AdyenCse::Encrypter.new(PUBLIC_KEY).encrypt!(
|
81
|
+
holder_name: holder_name,
|
82
|
+
number: number,
|
83
|
+
expiry_month: expiry_month,
|
84
|
+
expiry_year: expiry_year,
|
85
|
+
cvc: cvc
|
86
|
+
)
|
74
87
|
end
|
75
88
|
end
|
76
89
|
|
77
90
|
FactoryBot.define do
|
78
91
|
factory :adyen_test_card do
|
79
92
|
sequence(:holder_name) { |n| "Shopper #{n}" }
|
80
|
-
number { 4111_1111_1111_1111.to_s }
|
81
93
|
expiry_month { '08' }
|
82
94
|
expiry_year { '2018' }
|
83
95
|
cvc { '737' }
|
84
96
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
expiry_month: expiry_month,
|
90
|
-
expiry_year: expiry_year,
|
91
|
-
cvc: cvc
|
92
|
-
)
|
97
|
+
visa
|
98
|
+
|
99
|
+
trait :visa do
|
100
|
+
number { 4111_1111_1111_1111.to_s }
|
93
101
|
end
|
94
102
|
|
95
103
|
trait :mastercard do
|
data/adyen-cse-ruby.gemspec
CHANGED
@@ -21,7 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
|
24
|
+
# Temporary disabled until https://github.com/SmallLars/openssl-ccm/pull/4 is patched.
|
25
|
+
# spec.add_runtime_dependency "openssl-ccm"
|
25
26
|
|
26
27
|
spec.add_development_dependency "bundler", "~> 1.14"
|
27
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/adyen_cse/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adyen-cse-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joey Cheng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: openssl-ccm
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2.1
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.2.1
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|