comgate_ruby 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb8b49037f86f4e45b7ca18fbfcd471584b641814aa71deaa96c29da856fd3e0
4
- data.tar.gz: 16ec6d6597626b9305820145494bfc39d1ef9ec5a3fd447cc0ff089c0cc15344
3
+ metadata.gz: c7feda6e77063468d2577e6f865f899a9652d0e1728a8ccec608ecc311b7a433
4
+ data.tar.gz: 6610c12a6b20f234f2813b5b9448b25c1915f13dc784b4916750d7fef4301378
5
5
  SHA512:
6
- metadata.gz: ea107102d24f78e0f774514cf69559af8ea648b4e1c5c918d2bb88d6bdeb5418b83c94b114b8ff178cb6a1c2cbfd7cdb5df9ab164e0bb7f79b82bb207f995476
7
- data.tar.gz: d24f960bb8c18e6b96391d90c545f2805578576cd2914f4782830cbd2118d1565963c57f88caa5934e079db9d1c7eeee7b25ecc74640eae8c9ee183013d3b1e2
6
+ metadata.gz: 574aafb0ad4b606d9beacdf9ce13eb531efcf961f3b9b51f2157ea4d2e647be911581437d3d7ab9ce6db03a741ad8b06bee7ca18f769594b77d91b23f217c142
7
+ data.tar.gz: 8eb352360617ba623bc0487c9eaf8c24ebfd34fab06af02f1deea6ba2cfe169e81497a53a200794e1235a5e8f4480ad286cc52470bb938a42432d7fc3daf9412
data/CHANGELOG.md CHANGED
@@ -1,10 +1,15 @@
1
- ## [0.5.0] - 2023-04-20
2
-
3
- - Initial release
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- comgate_ruby (0.6.0)
4
+ comgate_ruby (0.8.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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.merge({transaction_id: ":transID"}) }})`. No redirection here. Price can change in each payment.
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`.
@@ -87,9 +87,9 @@ module Comgate
87
87
  end
88
88
 
89
89
  def repeat_recurring_transaction(payment_data)
90
- transaction_id = payment_data.delete(:transaction_id)
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: transaction_id),
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 # backward compatibility
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Comgate
4
- VERSION = "0.7.1"
4
+ VERSION = "0.8.0"
5
5
  end
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.7.1
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-04-27 00:00:00.000000000 Z
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: