comgate_ruby 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7d8a030a101f774292a7f3214a1d3338238afa11fbc9c98e348db15259d6fde
4
- data.tar.gz: 6253ba9e4d7e3a1737f491b3efccbd82bd85afc1c802c97c4939e3114dcc88ed
3
+ metadata.gz: c88ee185af7a8e67a0e652866834bcff26e3f2a3e22299d8fe1acb069fec3c56
4
+ data.tar.gz: de1435c492d44847a991e73d8bbd19d64a5d94958df9d36cf1e6e4935f54f865
5
5
  SHA512:
6
- metadata.gz: 47713672ee0beed059c9e26b90bbaebded0cdc29db78f08e20c9e406678c2ffd59562a439f81c8b5a2a9d0716ab7b637af9dcc86068a9010df0e0350c4984ff9
7
- data.tar.gz: 9d2a09ac2489566918c5f131764636c34113bfb92cc57be659b72d349bbd78c7ebbec0fb7c2d5108e28261a4f728dc6ef4ca312dc684f331a12981ad7c6cf988
6
+ metadata.gz: 81682fda76ce705ed1b3b1cba13baa704b6bcfc457ffed8bd44ebb7638259debf629881a2e8e1ba6b7aec3ccfe3284d58d015af4378ee6cb9e4b117c501a1f1d
7
+ data.tar.gz: b93203aef6c290982f2c29bf3eb73f74e6da0e14c0401f80b1908dbf677ea546974444ed712e33e2ba08ba2d543112be7b8a4a11bc2b9b5dbab3ff0ee5459b16
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- comgate_ruby (0.5.0)
4
+ comgate_ruby (0.6.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -18,13 +18,13 @@ If bundler is not being used to manage dependencies, install the gem by executin
18
18
  ### 1) set gateway object
19
19
  As singleton on app init or for each transaction:
20
20
  ```ruby
21
- gateway = Commgate::Gateway.new(merchant_gateway_id: ":comgate_id",
22
- test_calls: false,
23
- secret: ":comgate_secret")
21
+ gateway = Comgate::Gateway.new(merchant_gateway_id: ":comgate_id",
22
+ test_calls: false,
23
+ client_secret: ":comgate_secret")
24
24
  ```
25
25
 
26
26
  ### 2) prepare endpoint
27
- Comgate sends POST requests to your app about transactions updates. The URL of it needs to be setup in Comgate Client portal. At endpoint, just call `gateway.process_payment_callback(params)`, which will return
27
+ Comgate sends POST requests to your app about transactions updates. The URL of it needs to be setup in Comgate Client portal. At endpoint, just call `gateway.process_callback(params)`, which will return
28
28
  `{state: :paid, transaction_id: ":transID"}` (at least). See bullets 4) and 5) in Single payment process bellow.
29
29
  ### 3) call appropriate method
30
30
  (see bellow)
@@ -25,6 +25,18 @@ module Comgate
25
25
  preauth: %i[payment preauthorization],
26
26
  verification: %i[payment verification_payment],
27
27
 
28
+ ## not used for Comgate, but for other Gateway payments they are needed
29
+ ## so here they are for evidence
30
+ # firstName: %i[payer first_name],
31
+ # lastName: %i[payer last_name],
32
+ # street: %i[payer street_line],
33
+ # city: %i[payer city],
34
+ # postalCode: %i[payer postal_code],
35
+ # payerCountryCode: %i[payer country_code],
36
+ # description: %i[payment description],
37
+ # returnUrl: %i[options shop_return_url],
38
+ # callbackUrl: %i[options callback_url],
39
+
28
40
  # responses
29
41
  transId: %i[transaction_id],
30
42
  transferId: %i[transfer_id],
@@ -53,9 +65,9 @@ module Comgate
53
65
 
54
66
  def initialize(options)
55
67
  @options = options
56
- return unless options[:merchant_gateway_id].nil? || options[:secret].nil? || options[:test_calls].nil?
68
+ return unless options[:merchant_gateway_id].nil? || options[:client_secret].nil? || options[:test_calls].nil?
57
69
 
58
- raise ArgumentError "options have to include :merchant_gateway_id, :secret and :test_calls"
70
+ raise ArgumentError, "options have to include :merchant_gateway_id, :client_secret and :test_calls"
59
71
  end
60
72
 
61
73
  def test_calls_used?
@@ -128,9 +140,10 @@ module Comgate
128
140
  test_call: false)
129
141
  end
130
142
 
131
- def process_payment_callback(comgate_params)
143
+ def process_callback(comgate_params)
132
144
  Comgate::Response.new({ response_body: comgate_params }, DATA_CONVERSION_HASH)
133
145
  end
146
+ alias process_payment_callback process_callback # backward compatibility
134
147
 
135
148
  def allowed_payment_methods(payment_data)
136
149
  ph = gateway_params.merge(convert_data_to_comgate_params(%i[curr lang country], payment_data, required: false))
@@ -189,7 +202,7 @@ module Comgate
189
202
 
190
203
  def gateway_params
191
204
  { merchant: options[:merchant_gateway_id],
192
- secret: options[:secret] }
205
+ secret: options[:client_secret] }
193
206
  end
194
207
 
195
208
  def convert_data_to_comgate_params(comgate_keys, data, required:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Comgate
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.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.5.0
4
+ version: 0.6.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-20 00:00:00.000000000 Z
11
+ date: 2023-04-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Write a longer description or delete this line.
14
14
  email: