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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 782ff730d1ac1d0476cba0dbefc6be067b728b1b
4
- data.tar.gz: 7bbce7b21d58a8036efae5332882cdd4ccf4a6ae
3
+ metadata.gz: ea59b9c101cd2d69299eb6b7168322331278de2f
4
+ data.tar.gz: e4eb587d6b0f8a22ac149856bf992edea4e9208e
5
5
  SHA512:
6
- metadata.gz: e191247e97b161da4d1eef3cc24c319a10118d6ec38b8b1bca29634d5957120447f47944dcdd13417390b93bd230fc81896d0434f84a2c0c058d3acb701a2c2f
7
- data.tar.gz: 08aab6a28c4aa756ae744af7a3493e469a5461c8aa0535a22603bb15b1a2e66743dff1313e49cebf7484b830fbfc99267211bcf114c5120d02d9a037ebe4c4f7
6
+ metadata.gz: b26b614a9a9489605a62700a02e5e821998cbf1fca20bc028fa77b46bb4edc3fffe85e9e7f2aaaf9a520609112479777762517f4f6938b7c44991a68e84085fd
7
+ data.tar.gz: 15957fd799f9c946a7d76d8a88f6b03f41a7911fa3e19ca0951ff7503366579dac9c449cc4317da320c48bb895dc915631b53aad764e9a22277da33608c723c2
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in adyen_cse_ruby.gemspec
4
4
  gemspec
5
5
 
6
- gem "openssl-ccm"
6
+ gem "openssl-ccm", git: "https://github.com/jooeycheng/openssl-ccm", branch: "update-cipher-validation"
7
7
 
8
8
  group :development do
9
9
  gem "pry"
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
+ [![Gem Version](https://badge.fury.io/rb/adyen-cse-ruby.svg)](https://badge.fury.io/rb/adyen-cse-ruby)
1
2
  [![Build Status](https://travis-ci.org/jooeycheng/adyen-cse-ruby.svg?branch=master)](https://travis-ci.org/jooeycheng/adyen-cse-ruby)
3
+ [![](https://api.codeclimate.com/v1/badges/ac46c6f16792ed094d7f/maintainability)](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, :nonce
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 self.public_key
73
- "your_public_key_here"
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
- nonce do
86
- AdyenCse::Encrypter.new(AdyenTestCard.public_key).encrypt!(
87
- holder_name: holder_name,
88
- number: number,
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
@@ -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
- spec.add_runtime_dependency "openssl-ccm", "~> 1.2.1"
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"
@@ -1,3 +1,3 @@
1
1
  module AdyenCse
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
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.0
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: 2018-06-22 00:00:00.000000000 Z
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