comgate_ruby 0.7.1 → 0.8.0
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/CHANGELOG.md +9 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -2
- data/lib/comgate/gateway.rb +3 -3
- data/lib/comgate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7feda6e77063468d2577e6f865f899a9652d0e1728a8ccec608ecc311b7a433
|
4
|
+
data.tar.gz: 6610c12a6b20f234f2813b5b9448b25c1915f13dc784b4916750d7fef4301378
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 574aafb0ad4b606d9beacdf9ce13eb531efcf961f3b9b51f2157ea4d2e647be911581437d3d7ab9ce6db03a741ad8b06bee7ca18f769594b77d91b23f217c142
|
7
|
+
data.tar.gz: 8eb352360617ba623bc0487c9eaf8c24ebfd34fab06af02f1deea6ba2cfe169e81497a53a200794e1235a5e8f4480ad286cc52470bb938a42432d7fc3daf9412
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
-
## [0.
|
2
|
-
|
3
|
-
-
|
4
|
-
|
1
|
+
## [0.8] - 2023-06-06
|
2
|
+
- Update to conform universal payment interface params (see Readme)
|
3
|
+
- BREAKING: change in repeating params `{transaction_id: "xxx", ....}` is now at `{payment: {reccurrence: { init_transaction_id: "xxx" } } }`
|
5
4
|
|
6
5
|
## [0.7.1] - 2023-04-27
|
7
6
|
|
8
7
|
- better handling errors not in "error" param from Comgate
|
9
8
|
- renamed `check_state` to `check_transaction` (and keep backward compatibility)
|
10
9
|
- renamed `process_payment_callback` to `process_callback` (and keep backward compatibility)
|
10
|
+
|
11
|
+
## [0.5.0] - 2023-04-20
|
12
|
+
|
13
|
+
- Initial release
|
14
|
+
|
15
|
+
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -59,7 +59,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
59
59
|
|
60
60
|
### Recurring payments
|
61
61
|
1) Use `gateway.start_recurring_transaction(payment_data)` and store `transaction_id`.
|
62
|
-
2) Create following payments `gateway.repeat_recurring_transaction(payment_data: new_payment_data
|
62
|
+
2) Create following payments `gateway.repeat_recurring_transaction(payment_data: new_payment_data)`, where `new_payment_data` includes `{payment: {reccurrence: { init_transaction_id: transaction_id } } }`. No redirection here. Price can change in each payment.
|
63
63
|
3) Handle status change like bullets 4) and 5) in single payment
|
64
64
|
|
65
65
|
### Preauthorized payments
|
@@ -141,20 +141,34 @@ Maximal mixed version looks like:
|
|
141
141
|
apple_pay_payload: "raw apple pay payload", # input
|
142
142
|
dynamic_expiration: false, # input (see https://help.comgate.cz/v1/docs/expirace-plateb )
|
143
143
|
expiration_time: "10h", # input ( use "m" or "h" or "d", but only one of them; allowed rage "30m".."7d")
|
144
|
+
description: "Some description",
|
145
|
+
reccurrence: { init_transaction_id: "12AD-dfsA-4568",
|
146
|
+
period: 1 } },
|
144
147
|
},
|
145
148
|
payer: {
|
146
149
|
email: "payer1@gmail.com", # input/output
|
147
150
|
phone: "+420778899", # input/output
|
151
|
+
first_name: "John", # input - not used at Comgate
|
152
|
+
last_name: "Doe", # input - not used at Comgate
|
148
153
|
account_number: "account_num", # output
|
149
154
|
account_name: "payer account name" # output
|
150
155
|
},
|
151
156
|
options: {
|
152
157
|
country_code: "DE", # input (can restrict allowed payment methods)
|
153
|
-
language_code: "sk" # input
|
158
|
+
language_code: "sk", # input
|
159
|
+
shop_return_url: "https://example.com/return",
|
160
|
+
callback_url: "https://example.com/callback"
|
154
161
|
},
|
162
|
+
# items are not used at Comgate
|
163
|
+
items: [{ type: "ITEM",
|
164
|
+
name: "Je to kulatý – Měsíční (6. 6. 2023 – 6. 7. 2023)",
|
165
|
+
amount_in_cents: 9900,
|
166
|
+
count: 1,
|
167
|
+
vat_rate_percent: 21 }],
|
155
168
|
headers: {} # not actually used now
|
156
169
|
}
|
157
170
|
```
|
171
|
+
|
158
172
|
## Response
|
159
173
|
Response returned from `gateway` call is `Comgate::Response` instance.
|
160
174
|
You can check redirection `response.redirect? ? response.redirect_to : nil`.
|
data/lib/comgate/gateway.rb
CHANGED
@@ -87,9 +87,9 @@ module Comgate
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def repeat_recurring_transaction(payment_data)
|
90
|
-
|
90
|
+
init_transaction_id = payment_data[:payment][:recurrence].delete(:init_transaction_id)
|
91
91
|
make_call(url: "#{BASE_URL}/recurring",
|
92
|
-
payload: single_payment_payload(payment_data).merge(initRecurringId:
|
92
|
+
payload: single_payment_payload(payment_data).merge(initRecurringId: init_transaction_id),
|
93
93
|
test_call: test_call?(payment_data[:test]))
|
94
94
|
end
|
95
95
|
|
@@ -139,7 +139,7 @@ module Comgate
|
|
139
139
|
payload: gateway_params.merge(transId: transaction_id),
|
140
140
|
test_call: false)
|
141
141
|
end
|
142
|
-
alias check_state check_transaction
|
142
|
+
alias check_state check_transaction # backward compatibility
|
143
143
|
|
144
144
|
def process_callback(comgate_params)
|
145
145
|
Comgate::Response.new({ response_body: comgate_params }, DATA_CONVERSION_HASH)
|
data/lib/comgate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comgate_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Mlčoch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Write a longer description or delete this line.
|
14
14
|
email:
|