buckaruby 1.3.0 → 1.3.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
  SHA256:
3
- metadata.gz: 855a453200b91387930947cdd68b6d315e5cf3072f0f96af43c9aedd602d2a19
4
- data.tar.gz: 811de69c1218ab1e5a10c8f9d3ca1ddf8e8e01bea31da9157bc6203fde9a3a1a
3
+ metadata.gz: b9964baf09c9cec43bb7f60c48391d92a6a86bd444fc8203a7bf48aab2af40fa
4
+ data.tar.gz: 78cfb8676c812e6aa3eece2c6e8d61236640b4dcbc57e957f522420cb3e423d5
5
5
  SHA512:
6
- metadata.gz: 4ce0ce26ff6272ccd8fa73d95c7af0078b1f68a20723a6c8214cb1a1fafe1e2a8755ee8ccf05202f921904f8d54b603daed3d378f0465467be958da346fe756d
7
- data.tar.gz: c569a0978c2723ba373a00f620a08dc8593f6fb9a0e4e8e21a1804fbf34e3163f0cb06ff8802b588e020bb92fcbae96e5d20a6a00f84a1c6f48e0f76764590b1
6
+ metadata.gz: 0b4790df338a409eec26bf7d8b7149f655a40a43bfe6f425ffc69e861efc5b05f91b1a61582109c279fe2db4f9ebcdb32926582b28046bfb43149ef6cdc94bf9
7
+ data.tar.gz: 253733f74de7c6abeecfdbb255bfc951a224466fe36d33fc9cd71329e681e7202ef8a7e172768c9d1688f49491f8040dfbda1988730d1f060084007a3d4555ef
@@ -6,6 +6,6 @@ before_install:
6
6
  - gem install bundler -v '< 2'
7
7
  rvm:
8
8
  - 2.3.8
9
- - 2.4.6
10
- - 2.5.5
11
- - 2.6.3
9
+ - 2.4.9
10
+ - 2.5.7
11
+ - 2.6.5
@@ -1,5 +1,9 @@
1
1
  # Buckaruby changelog
2
2
 
3
+ ## 1.3.1 (2019-12-04)
4
+
5
+ - Update list of credit card transaction types.
6
+
3
7
  ## 1.3.0 (2019-10-08)
4
8
 
5
9
  - Added payment method American Express.
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  group :test do
9
- gem 'rubocop', '~> 0.74.0'
10
- gem 'rubocop-performance', '~> 1.4.0'
11
- gem 'rubocop-rspec', '~> 1.35.0'
9
+ gem 'rubocop', '~> 0.77.0'
10
+ gem 'rubocop-performance', '~> 1.5.1'
11
+ gem 'rubocop-rspec', '~> 1.37.0'
12
12
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buckaruby (1.3.0)
4
+ buckaruby (1.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,9 +13,9 @@ GEM
13
13
  safe_yaml (~> 1.0.0)
14
14
  diff-lcs (1.3)
15
15
  hashdiff (1.0.0)
16
- jaro_winkler (1.5.3)
17
- parallel (1.17.0)
18
- parser (2.6.3.0)
16
+ jaro_winkler (1.5.4)
17
+ parallel (1.19.1)
18
+ parser (2.6.5.0)
19
19
  ast (~> 2.4.0)
20
20
  public_suffix (3.1.1)
21
21
  rainbow (3.0.0)
@@ -33,17 +33,17 @@ GEM
33
33
  diff-lcs (>= 1.2.0, < 2.0)
34
34
  rspec-support (~> 3.8.0)
35
35
  rspec-support (3.8.2)
36
- rubocop (0.74.0)
36
+ rubocop (0.77.0)
37
37
  jaro_winkler (~> 1.5.1)
38
38
  parallel (~> 1.10)
39
39
  parser (>= 2.6)
40
40
  rainbow (>= 2.2.2, < 4.0)
41
41
  ruby-progressbar (~> 1.7)
42
42
  unicode-display_width (>= 1.4.0, < 1.7)
43
- rubocop-performance (1.4.1)
43
+ rubocop-performance (1.5.1)
44
44
  rubocop (>= 0.71.0)
45
- rubocop-rspec (1.35.0)
46
- rubocop (>= 0.60.0)
45
+ rubocop-rspec (1.37.0)
46
+ rubocop (>= 0.68.1)
47
47
  ruby-progressbar (1.10.1)
48
48
  safe_yaml (1.0.5)
49
49
  unicode-display_width (1.6.0)
@@ -60,9 +60,9 @@ DEPENDENCIES
60
60
  bundler (~> 1.7)
61
61
  rake (~> 10.0)
62
62
  rspec (~> 3.0)
63
- rubocop (~> 0.74.0)
64
- rubocop-performance (~> 1.4.0)
65
- rubocop-rspec (~> 1.35.0)
63
+ rubocop (~> 0.77.0)
64
+ rubocop-performance (~> 1.5.1)
65
+ rubocop-rspec (~> 1.37.0)
66
66
  webmock (~> 2.3)
67
67
 
68
68
  BUNDLED WITH
@@ -182,9 +182,20 @@ module Buckaruby
182
182
  'V010', 'V014', # PayPal
183
183
  'C090', 'V090', # Bancontact
184
184
  'C001', # Transfer
185
- 'C044', 'C192', 'V002', 'V032', 'V044', 'V192', # Visa
186
- 'C043', 'C089', 'V001', 'V043', 'V089', 'V031', # MasterCard
187
- 'C046', 'C251', 'V034', 'V046', 'V245', 'V094', # Maestro
185
+
186
+ 'C044', 'C192', 'C283', 'C293', 'C318', 'C345',
187
+ 'C880', 'C963', 'V002', 'V032', 'V038', 'V044',
188
+ 'V192', 'V283', 'V293', 'V313', 'V318', 'V345',
189
+ 'V696', # Visa
190
+
191
+ 'C043', 'C089', 'C273', 'C303', 'C328', 'C355',
192
+ 'C876', 'C969', 'V001', 'V031', 'V037', 'V043',
193
+ 'V089', 'V273', 'V303', 'V328', 'V355', 'V702', # MasterCard
194
+
195
+ 'C046', 'C251', 'C288', 'C308', 'C333', 'C872',
196
+ 'C972', 'V034', 'V040', 'V046', 'V094', 'V245',
197
+ 'V288', 'V308', 'V333', 'V705', # Maestro
198
+
188
199
  'V003', 'V030', 'V036', 'V042' # American Express
189
200
 
190
201
  # Check the recurring flag to detect a normal or recurring transaction.
@@ -193,22 +204,40 @@ module Buckaruby
193
204
  else
194
205
  TransactionType::PAYMENT
195
206
  end
196
- when 'C121', # iDEAL
197
- 'C102', 'C500', # (SEPA) Direct Debit
198
- 'V110', # PayPal
199
- 'C092', 'V092', # Bancontact
200
- 'C101', # Transfer
201
- 'C080', 'C194', 'V068', 'V080', 'V102', 'V194', # Visa
202
- 'C079', 'C197', 'V067', 'V079', 'V101', 'V149', 'V197', # MasterCard
203
- 'C082', 'C252', 'V070', 'V082', 'V246', # Maestro
204
- 'V066', 'V072', 'V078', 'V103' # American Express
207
+ when 'C121', # iDEAL
208
+ 'C102', 'C500', # (SEPA) Direct Debit
209
+ 'V110', # PayPal
210
+ 'C092', 'V092', # Bancontact
211
+ 'C101', # Transfer
212
+
213
+ 'C080', 'C194', 'C281', 'C290', 'C315', 'C342',
214
+ 'C881', 'C961', 'V068', 'V074', 'V080', 'V102',
215
+ 'V194', 'V281', 'V290', 'V315', 'V342', 'V694', # Visa
216
+
217
+ 'C079', 'C197', 'C300', 'C325', 'C352', 'C371',
218
+ 'C877', 'C967', 'V067', 'V073', 'V079', 'V101',
219
+ 'V149', 'V197', 'V300', 'V325', 'V352', 'V371',
220
+ 'V700', # MasterCard
221
+
222
+ 'C082', 'C252', 'C286', 'C305', 'C330', 'C873',
223
+ 'C970', 'V070', 'V076', 'V082', 'V246', 'V286',
224
+ 'V305', 'V330', 'V703', # Maestro
225
+
226
+ 'V066', 'V072', 'V078', 'V103' # American Express
205
227
  TransactionType::REFUND
206
- when 'C501', 'C502', 'C562', # (SEPA) Direct Debit
207
- 'V111', # PayPal
208
- 'C554', 'C593', 'V132', 'V144', 'V544', 'V592', # Visa
209
- 'C553', 'C589', 'V131', 'V143', 'V543', 'V589', # MasterCard
210
- 'C546', 'C551', 'V134', 'V146', 'V545', 'V546', # Maestro
211
- 'V130', 'V136', 'V142' # American Express
228
+ when 'C501', 'C502', 'C562', # (SEPA) Direct Debit
229
+ 'V111', # PayPal
230
+
231
+ 'C554', 'C593', 'C882', 'V132', 'V138', 'V144',
232
+ 'V544', 'V592', # Visa
233
+
234
+ 'C553', 'C589', 'C878', 'V131', 'V137', 'V143',
235
+ 'V543', 'V589', # MasterCard
236
+
237
+ 'C546', 'C551', 'C874', 'V134', 'V140', 'V146',
238
+ 'V545', 'V546', # Maestro
239
+
240
+ 'V130', 'V136', 'V142' # American Express
212
241
  TransactionType::REVERSAL
213
242
  end
214
243
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Buckaruby
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
@@ -215,7 +215,7 @@ RSpec.describe Buckaruby::Gateway do
215
215
  expect(response.custom[:quux]).to eq("42")
216
216
 
217
217
  expect(WebMock).to have_requested(:post, "https://testcheckout.buckaroo.nl/nvp/?op=TransactionRequest")
218
- .with(body: "brq_websitekey=12345678&brq_payment_method=ideal&brq_culture=nl-NL&brq_currency=EUR&brq_amount=10.0&brq_invoicenumber=12345&brq_service_ideal_action=Pay&brq_service_ideal_issuer=ABNANL2A&brq_service_ideal_version=2&brq_return=http%3A%2F%2Fwww.return.url%2F&cust_foo=bar&cust_quux=42&add_buckaruby=Buckaruby+#{Buckaruby::VERSION}&brq_signature=e185c8a1bce030a3e0d001f0c09fbf6b0c8f88ab")
218
+ .with(body: "brq_websitekey=12345678&brq_payment_method=ideal&brq_culture=nl-NL&brq_currency=EUR&brq_amount=10.0&brq_invoicenumber=12345&brq_service_ideal_action=Pay&brq_service_ideal_issuer=ABNANL2A&brq_service_ideal_version=2&brq_return=http%3A%2F%2Fwww.return.url%2F&cust_foo=bar&cust_quux=42&add_buckaruby=Buckaruby+#{Buckaruby::VERSION}&brq_signature=f17162a56c850680dc99a46e31745c4ca5753711")
219
219
  end
220
220
  end
221
221
 
@@ -227,7 +227,7 @@ RSpec.describe Buckaruby::Gateway do
227
227
  expect(response.additional[:myreference]).to eq("12345")
228
228
 
229
229
  expect(WebMock).to have_requested(:post, "https://testcheckout.buckaroo.nl/nvp/?op=TransactionRequest")
230
- .with(body: "brq_websitekey=12345678&brq_payment_method=ideal&brq_culture=nl-NL&brq_currency=EUR&brq_amount=10.0&brq_invoicenumber=12345&brq_service_ideal_action=Pay&brq_service_ideal_issuer=ABNANL2A&brq_service_ideal_version=2&brq_return=http%3A%2F%2Fwww.return.url%2F&add_myreference=12345&add_buckaruby=Buckaruby+#{Buckaruby::VERSION}&brq_signature=40ee09a9b7ccac816318c9e9bc81493fcee183f7")
230
+ .with(body: "brq_websitekey=12345678&brq_payment_method=ideal&brq_culture=nl-NL&brq_currency=EUR&brq_amount=10.0&brq_invoicenumber=12345&brq_service_ideal_action=Pay&brq_service_ideal_issuer=ABNANL2A&brq_service_ideal_version=2&brq_return=http%3A%2F%2Fwww.return.url%2F&add_myreference=12345&add_buckaruby=Buckaruby+#{Buckaruby::VERSION}&brq_signature=7ec12615ca594379709e743d4f6feb1a505cf3bb")
231
231
  end
232
232
  end
233
233
  end
@@ -574,6 +574,20 @@ RSpec.describe Buckaruby::Gateway do
574
574
  expect(response.to_h).to be_an_instance_of(Hash)
575
575
  end
576
576
 
577
+ it 'sets the transaction type to payment and payment method to VISA for visa callback' do
578
+ params = File.read("spec/fixtures/responses/callback_payment_visa.txt")
579
+
580
+ response = subject.callback(params)
581
+ expect(response.transaction_status).to eq(Buckaruby::TransactionStatus::SUCCESS)
582
+ expect(response.transaction_type).to eq(Buckaruby::TransactionType::PAYMENT)
583
+ expect(response.payment_method).to eq(Buckaruby::PaymentMethod::VISA)
584
+ expect(response.transaction_id).to eq("41C48B55FA9164E123CC73B1157459E840BE5D24")
585
+ expect(response.payment_id).to eq("E86256B2787EE7FF0C33D0D4C6159CD922227B79")
586
+ expect(response.invoicenumber).to eq("12345")
587
+ expect(response.timestamp).to be_an_instance_of(Time)
588
+ expect(response.to_h).to be_an_instance_of(Hash)
589
+ end
590
+
577
591
  it 'sets the transaction type to payment and payment method to American Express for amex callback' do
578
592
  params = File.read("spec/fixtures/responses/callback_payment_amex.txt")
579
593
 
@@ -0,0 +1 @@
1
+ brq_amount=1.00&brq_currency=EUR&brq_customer_name=J.+de+Tester&brq_description=Test+VISA&brq_invoicenumber=12345&brq_issuing_country=US&brq_mutationtype=Collecting&brq_payer_hash=ec4dcf6c815f12bd75b7f5a2ef61d0307c868bd2a48a7af4ab5425c4abd475bb9c5c85f279baed6e4e4576a59b9d16311dcc1c9dd6be100386876905d909c99e&brq_payment=E86256B2787EE7FF0C33D0D4C6159CD922227B79&brq_service_visa_authentication=A&brq_service_visa_cardexpirationdate=2020-01&brq_service_visa_cardnumberending=1234&brq_service_visa_enrolled=Y&brq_service_visa_maskedcreditcardnumber=123456%2A%2A%2A%2A%2A%2A1234&brq_signature=87460dab38a5252b93b5465980d4d7f0d1b32cac&brq_statuscode=190&brq_statuscode_detail=S990&brq_statusmessage=The+request+was+successful.&brq_test=false&brq_timestamp=2019-12-01+00%3A00%3A00&brq_transaction_method=visa&brq_transaction_type=C880&brq_transactions=41C48B55FA9164E123CC73B1157459E840BE5D24&brq_websitekey=12345678
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buckaruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-08 00:00:00.000000000 Z
11
+ date: 2019-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -116,6 +116,7 @@ files:
116
116
  - spec/fixtures/responses/callback_payment_rejected.txt
117
117
  - spec/fixtures/responses/callback_payment_sepa.txt
118
118
  - spec/fixtures/responses/callback_payment_success.txt
119
+ - spec/fixtures/responses/callback_payment_visa.txt
119
120
  - spec/fixtures/responses/callback_recurrent_sepa.txt
120
121
  - spec/fixtures/responses/callback_recurrent_visa.txt
121
122
  - spec/fixtures/responses/callback_refund_amex.txt
@@ -172,6 +173,7 @@ test_files:
172
173
  - spec/fixtures/responses/callback_payment_rejected.txt
173
174
  - spec/fixtures/responses/callback_payment_sepa.txt
174
175
  - spec/fixtures/responses/callback_payment_success.txt
176
+ - spec/fixtures/responses/callback_payment_visa.txt
175
177
  - spec/fixtures/responses/callback_recurrent_sepa.txt
176
178
  - spec/fixtures/responses/callback_recurrent_visa.txt
177
179
  - spec/fixtures/responses/callback_refund_amex.txt