buckaruby 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +23 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +4 -4
- data/README.md +1 -1
- data/lib/buckaruby/gateway.rb +1 -1
- data/lib/buckaruby/payment_method.rb +1 -0
- data/lib/buckaruby/transaction_type.rb +4 -2
- data/lib/buckaruby/version.rb +1 -1
- data/spec/buckaruby/gateway_spec.rb +25 -2
- data/spec/fixtures/responses/callback_payment_giropay.txt +1 -0
- metadata +6 -4
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc9889fbec21efa16afde817a492b839b2c69ae3c2d442ed5a4d0f8631d27ca
|
4
|
+
data.tar.gz: 3e09c5226383463a8364a16dcd21f70ace68632cede58ba48bc6c9d00e67470f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f89515b95016c1f954b9862de10c98c8a9d82027a6276307c60ae73a68075c880d36ceb560a5858acc9eafc404737cabc096c16572f09f645f8324b95194d74
|
7
|
+
data.tar.gz: 38a8749448b840d033f60c2698f050594f4feef63ace780122801c6fe5a2739cc3ab4a67c364358a66132b59a1233c177fa89fb28ae206c8f98b180b1fa45eae
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- 1.x
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0']
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
- uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby-version }}
|
21
|
+
bundler-cache: true
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
buckaruby (1.
|
4
|
+
buckaruby (1.7.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
addressable (2.
|
10
|
-
public_suffix (>= 2.0.2, <
|
9
|
+
addressable (2.8.0)
|
10
|
+
public_suffix (>= 2.0.2, < 5.0)
|
11
11
|
ast (2.4.0)
|
12
12
|
crack (0.4.3)
|
13
13
|
safe_yaml (~> 1.0.0)
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
parallel (1.19.1)
|
18
18
|
parser (2.7.0.5)
|
19
19
|
ast (~> 2.4.0)
|
20
|
-
public_suffix (
|
20
|
+
public_suffix (4.0.6)
|
21
21
|
rainbow (3.0.0)
|
22
22
|
rake (12.3.3)
|
23
23
|
rexml (3.2.4)
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Buckaruby
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/buckaruby.svg)](https://badge.fury.io/rb/buckaruby)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/KentaaNL/buckaruby/actions/workflows/test.yml/badge.svg)](https://github.com/KentaaNL/buckaruby/actions)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/KentaaNL/buckaruby/badges/gpa.svg)](https://codeclimate.com/github/KentaaNL/buckaruby)
|
6
6
|
|
7
7
|
The Buckaruby gem provides a Ruby library for communicating with the Buckaroo Payment Engine 3.0.
|
data/lib/buckaruby/gateway.rb
CHANGED
@@ -173,7 +173,7 @@ module Buckaruby
|
|
173
173
|
valid_payment_methods = [
|
174
174
|
PaymentMethod::IDEAL, PaymentMethod::IDEAL_PROCESSING, PaymentMethod::VISA, PaymentMethod::MASTER_CARD,
|
175
175
|
PaymentMethod::MAESTRO, PaymentMethod::AMERICAN_EXPRESS, PaymentMethod::SEPA_DIRECT_DEBIT,
|
176
|
-
PaymentMethod::PAYPAL, PaymentMethod::BANCONTACT_MISTER_CASH, PaymentMethod::SOFORT
|
176
|
+
PaymentMethod::PAYPAL, PaymentMethod::BANCONTACT_MISTER_CASH, PaymentMethod::SOFORT, PaymentMethod::GIROPAY
|
177
177
|
]
|
178
178
|
validate_payment_method!(options, valid_payment_methods)
|
179
179
|
|
@@ -18,7 +18,8 @@ module Buckaruby
|
|
18
18
|
'C002', 'C004', 'C005', # (SEPA) Direct Debit
|
19
19
|
'V010', 'V014', # PayPal
|
20
20
|
'C090', 'V090', # Bancontact
|
21
|
-
'
|
21
|
+
'C075', 'N074', # Sofort
|
22
|
+
'C241', 'N031', # Giropay
|
22
23
|
'C001', # Transfer
|
23
24
|
|
24
25
|
'C044', 'C192', 'C283', 'C293', 'C318', 'C345',
|
@@ -46,7 +47,8 @@ module Buckaruby
|
|
46
47
|
'C102', 'C500', # (SEPA) Direct Debit
|
47
48
|
'V110', # PayPal
|
48
49
|
'C092', 'V092', # Bancontact
|
49
|
-
'
|
50
|
+
'C543', 'N540', # Sofort
|
51
|
+
'C242', 'N541', # Giropay
|
50
52
|
'C101', # Transfer
|
51
53
|
|
52
54
|
'C080', 'C194', 'C281', 'C290', 'C315', 'C342',
|
data/lib/buckaruby/version.rb
CHANGED
@@ -228,6 +228,16 @@ RSpec.describe Buckaruby::Gateway do
|
|
228
228
|
expect(response.to_h).to be_an_instance_of(Hash)
|
229
229
|
end
|
230
230
|
|
231
|
+
it 'initiates a transaction for payment method giropay' do
|
232
|
+
response = subject.setup_transaction(amount: 10, payment_method: Buckaruby::PaymentMethod::GIROPAY, invoicenumber: "12345", return_url: "http://www.return.url/")
|
233
|
+
expect(response).to be_an_instance_of(Buckaruby::SetupTransactionResponse)
|
234
|
+
expect(response.transaction_id).to eq("41C48B55FA9164E123CC73B1157459E840BE5D24")
|
235
|
+
expect(response.transaction_status).to eq(Buckaruby::TransactionStatus::PENDING)
|
236
|
+
expect(response.transaction_type).to eq(Buckaruby::TransactionType::PAYMENT)
|
237
|
+
expect(response.redirect_url).not_to be nil
|
238
|
+
expect(response.timestamp).to be_an_instance_of(Time)
|
239
|
+
end
|
240
|
+
|
231
241
|
context 'with custom variables' do
|
232
242
|
it 'sends the custom variables with the request' do
|
233
243
|
response = subject.setup_transaction(amount: 10, payment_method: Buckaruby::PaymentMethod::IDEAL, payment_issuer: "ABNANL2A", invoicenumber: "12345", return_url: "http://www.return.url/", custom: { foo: :bar, quux: "42" })
|
@@ -236,7 +246,7 @@ RSpec.describe Buckaruby::Gateway do
|
|
236
246
|
expect(response.custom[:quux]).to eq("42")
|
237
247
|
|
238
248
|
expect(WebMock).to have_requested(:post, "https://testcheckout.buckaroo.nl/nvp/?op=TransactionRequest")
|
239
|
-
.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=
|
249
|
+
.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=979f64bc651c9e780844c0866380fa2554897131")
|
240
250
|
end
|
241
251
|
end
|
242
252
|
|
@@ -248,7 +258,7 @@ RSpec.describe Buckaruby::Gateway do
|
|
248
258
|
expect(response.additional[:myreference]).to eq("12345")
|
249
259
|
|
250
260
|
expect(WebMock).to have_requested(:post, "https://testcheckout.buckaroo.nl/nvp/?op=TransactionRequest")
|
251
|
-
.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=
|
261
|
+
.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=b3b7db8c80ea3260f86aa916de1a057ffce3db78")
|
252
262
|
end
|
253
263
|
end
|
254
264
|
end
|
@@ -666,6 +676,19 @@ RSpec.describe Buckaruby::Gateway do
|
|
666
676
|
expect(response.timestamp).to be_an_instance_of(Time)
|
667
677
|
expect(response.to_h).to be_an_instance_of(Hash)
|
668
678
|
end
|
679
|
+
|
680
|
+
it 'sets the transaction type to payment and payment method to Giropay for giropay callback' do
|
681
|
+
params = File.read("spec/fixtures/responses/callback_payment_giropay.txt")
|
682
|
+
|
683
|
+
response = subject.callback(params)
|
684
|
+
expect(response.transaction_status).to eq(Buckaruby::TransactionStatus::SUCCESS)
|
685
|
+
expect(response.transaction_type).to eq(Buckaruby::TransactionType::PAYMENT)
|
686
|
+
expect(response.payment_method).to eq(Buckaruby::PaymentMethod::GIROPAY)
|
687
|
+
expect(response.transaction_id).to eq("41C48B55FA9164E123CC73B1157459E840BE5D24")
|
688
|
+
expect(response.payment_id).to eq("E86256B2787EE7FF0C33D0D4C6159CD922227B79")
|
689
|
+
expect(response.invoicenumber).to eq("12345")
|
690
|
+
expect(response.timestamp).to be_an_instance_of(Time)
|
691
|
+
end
|
669
692
|
end
|
670
693
|
|
671
694
|
context 'when callback is a payment recurrent response' do
|
@@ -0,0 +1 @@
|
|
1
|
+
brq_amount=10.00&brq_currency=EUR&brq_description=test&brq_invoicenumber=12345&brq_mutationtype=Collecting&brq_payment=E86256B2787EE7FF0C33D0D4C6159CD922227B79&brq_service_giropay_bankstatementid=2EGGF1P&brq_statuscode=190&brq_statuscode_detail=S990&brq_statusmessage=The+request+was+successful.&brq_test=true&brq_timestamp=2021-07-13+15%3A43%3A13&brq_transaction_method=giropay&brq_transaction_type=C241&brq_transactions=41C48B55FA9164E123CC73B1157459E840BE5D24&brq_websitekey=12345678&brq_signature=c741889fd17e7a567930ccddf1c12e6822bbfb6e
|
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.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,9 +74,9 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".github/workflows/test.yml"
|
77
78
|
- ".gitignore"
|
78
79
|
- ".rubocop.yml"
|
79
|
-
- ".travis.yml"
|
80
80
|
- CHANGELOG.md
|
81
81
|
- Gemfile
|
82
82
|
- Gemfile.lock
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- spec/fixtures/responses/callback_payment_cancelled.txt
|
115
115
|
- spec/fixtures/responses/callback_payment_empty_transaction_type.txt
|
116
116
|
- spec/fixtures/responses/callback_payment_failed.txt
|
117
|
+
- spec/fixtures/responses/callback_payment_giropay.txt
|
117
118
|
- spec/fixtures/responses/callback_payment_pending.txt
|
118
119
|
- spec/fixtures/responses/callback_payment_rejected.txt
|
119
120
|
- spec/fixtures/responses/callback_payment_sepa.txt
|
@@ -158,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
159
|
- !ruby/object:Gem::Version
|
159
160
|
version: '0'
|
160
161
|
requirements: []
|
161
|
-
rubygems_version: 3.0.
|
162
|
+
rubygems_version: 3.0.8
|
162
163
|
signing_key:
|
163
164
|
specification_version: 4
|
164
165
|
summary: Ruby library for communicating with the Buckaroo Payment Engine 3.0.
|
@@ -174,6 +175,7 @@ test_files:
|
|
174
175
|
- spec/fixtures/responses/callback_payment_cancelled.txt
|
175
176
|
- spec/fixtures/responses/callback_payment_empty_transaction_type.txt
|
176
177
|
- spec/fixtures/responses/callback_payment_failed.txt
|
178
|
+
- spec/fixtures/responses/callback_payment_giropay.txt
|
177
179
|
- spec/fixtures/responses/callback_payment_pending.txt
|
178
180
|
- spec/fixtures/responses/callback_payment_rejected.txt
|
179
181
|
- spec/fixtures/responses/callback_payment_sepa.txt
|