offsite_payments 2.7.22 → 2.7.24

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: 49a788e055321691469e48ea06db510414df18ddb513bde74dc4aff2901c6d9b
4
- data.tar.gz: e1bf2836b3a773832bb49858f1584e1dceb0a18d2503ede84ee0632c76da8a2f
3
+ metadata.gz: 3543bb9947e4536a4d25e2f6dc491ccfb5daabfcf83ce6d6bc440a6cb6576eed
4
+ data.tar.gz: c0cb5d70b1fc5d2606b4f407c668633233221880c6dc41a7b0a6e5e9c03524fa
5
5
  SHA512:
6
- metadata.gz: 9684dbe104d37f359263b0af474f62ab8e3fabe13462047a06e3939840fa09a70d6f5d5cbe3293630d961ef70d63f16b4d74d76b972c4c6e6da5fd848cf444a0
7
- data.tar.gz: bcc832909f3bf9a165088afefc476766a24adbfb52abcab9a7b003eb7bce258e2434aeba424b65c8f3a28038a3c258aed6d975b1eef0faf1c92e45bc525ceb6f
6
+ metadata.gz: 8225e42304353ea2a761e7fd2f7d851cb15090e0ec3b48cb6b3fd6bdc063f583596f55c80302594748ac9c4134e1c3dd9b16a196881d27b01a628a172510cfa5
7
+ data.tar.gz: f967016da8bb203b6f7f8f22b87fc346a45800bc3791c9839e5bc9bcdf39cfa84b53d59448c0770827df4d6588037b4ea54e7096f7378908079fc1957a2d55d1
@@ -93,14 +93,6 @@ module OffsitePayments #:nodoc:
93
93
  params['type']
94
94
  end
95
95
 
96
- def partner_income
97
- params['partner_income']
98
- end
99
-
100
- def system_income
101
- params['system_income']
102
- end
103
-
104
96
  # Additional notification request params:
105
97
  # tid
106
98
  # name
@@ -41,7 +41,7 @@ module OffsitePayments #:nodoc:
41
41
  add_field('fullNotifications', true)
42
42
  add_field('transactionSpeed', 'high')
43
43
  add_field('token', account)
44
- end
44
+ end
45
45
 
46
46
  mapping :amount, 'price'
47
47
  mapping :order, 'orderID'
@@ -119,7 +119,7 @@ module OffsitePayments
119
119
  end
120
120
 
121
121
  def amount
122
- Money.from_amount(BigDecimal.new(gross), currency)
122
+ Money.from_amount(BigDecimal(gross), currency)
123
123
  end
124
124
 
125
125
  def transaction_id
@@ -202,7 +202,7 @@ module OffsitePayments
202
202
  end
203
203
 
204
204
  def status( order_id, order_amount )
205
- if @notification.invoice_ok?( order_id ) && @notification.amount_ok?( BigDecimal.new(order_amount) )
205
+ if @notification.invoice_ok?( order_id ) && @notification.amount_ok?(BigDecimal(order_amount))
206
206
  @notification.status
207
207
  else
208
208
  'Mismatch'
@@ -320,7 +320,7 @@ module OffsitePayments #:nodoc:
320
320
  data = ActiveUtils::PostData.new
321
321
  data[:requestparams] = parameters.join('|')
322
322
 
323
- response = ssl_get("#{url}?#{data.to_post_data}")
323
+ ssl_get("#{url}?#{data.to_post_data}")
324
324
  end
325
325
 
326
326
  def test?
@@ -101,7 +101,7 @@ module OffsitePayments #:nodoc:
101
101
  end
102
102
 
103
103
  def amount
104
- Money.from_amount(BigDecimal.new(gross), currency)
104
+ Money.from_amount(BigDecimal(gross), currency)
105
105
  end
106
106
 
107
107
  def item_id
@@ -125,7 +125,7 @@ module OffsitePayments #:nodoc:
125
125
  return false
126
126
  end
127
127
 
128
- %w(txnid orderid currency date time hash fraud payercountry issuercountry txnfee subscriptionid paymenttype cardno).each do |attr|
128
+ %w(txnid orderid date time hash fraud payercountry issuercountry txnfee subscriptionid paymenttype cardno).each do |attr|
129
129
  define_method(attr) do
130
130
  params[attr]
131
131
  end
@@ -138,7 +138,7 @@ module OffsitePayments #:nodoc:
138
138
  def generate_md5string
139
139
  md5string = String.new
140
140
  for line in @raw.split('&')
141
- key, value = *line.scan( %r{^([A-Za-z0-9_.]+)\=(.*)$} ).flatten
141
+ key, _ = *line.scan( %r{^([A-Za-z0-9_.]+)\=(.*)$} ).flatten
142
142
  md5string += params[key] if key != 'hash'
143
143
  end
144
144
  return md5string + @options[:credential3]
@@ -189,7 +189,7 @@ module OffsitePayments #:nodoc:
189
189
  response = ssl_get(Gestpay.service_url, decryption_query_string(shop_login, encrypted_string))
190
190
  encoded_response = parse_response(response)
191
191
  parse_delimited_string(encoded_response, DELIMITER, true)
192
- rescue GestpayEncryptionResponseError => e
192
+ rescue GestpayEncryptionResponseError
193
193
  { 'PAY1_TRANSACTIONRESULT' => 'Error' }
194
194
  end
195
195
 
@@ -80,7 +80,7 @@ module OffsitePayments #:nodoc:
80
80
  end
81
81
 
82
82
  def amount
83
- Money.from_amount(BigDecimal.new(gross), currency)
83
+ Money.from_amount(BigDecimal(gross), currency)
84
84
  end
85
85
 
86
86
  def item_id
@@ -156,7 +156,7 @@ module OffsitePayments #:nodoc:
156
156
  end
157
157
 
158
158
  def amount
159
- BigDecimal.new(gross)
159
+ BigDecimal(gross)
160
160
  end
161
161
 
162
162
  def item_id
@@ -133,7 +133,7 @@ module OffsitePayments #:nodoc:
133
133
  end
134
134
 
135
135
  def gross_cents
136
- (BigDecimal.new(@params['amount'], 2) * 100).to_i
136
+ (BigDecimal(@params['amount'], 2) * 100).to_i
137
137
  end
138
138
 
139
139
  def status
@@ -100,7 +100,7 @@ module OffsitePayments #:nodoc:
100
100
  end
101
101
 
102
102
  def gross_cents
103
- (BigDecimal.new(@params['amount'], 2) * 100).to_i
103
+ (BigDecimal(@params['amount'], 2) * 100).to_i
104
104
  end
105
105
 
106
106
  def status
@@ -111,7 +111,7 @@ module OffsitePayments #:nodoc:
111
111
  check_for_errors(response, xml)
112
112
 
113
113
  extract_token(xml)
114
- rescue Timeout::Error, Errno::ECONNRESET, Errno::ETIMEDOUT => e
114
+ rescue Timeout::Error, Errno::ECONNRESET, Errno::ETIMEDOUT
115
115
  raise ActionViewHelperError, "Erro ao conectar-se ao PagSeguro. Por favor, tente novamente."
116
116
  end
117
117
 
@@ -212,7 +212,7 @@ module OffsitePayments #:nodoc:
212
212
 
213
213
  # The net amount credited to the receiver's account.
214
214
  def amount
215
- Money.from_amount(BigDecimal.new(params['amount_net']), currency)
215
+ Money.from_amount(BigDecimal(params['amount_net']), currency)
216
216
  end
217
217
 
218
218
  # The name of the item being charged for.
@@ -138,10 +138,6 @@ module OffsitePayments #:nodoc:
138
138
  nil
139
139
  end
140
140
 
141
- def status
142
- params['RESPMSG']
143
- end
144
-
145
141
  # Id of this transaction (paypal number)
146
142
  def transaction_id
147
143
  params['PNREF']
@@ -136,7 +136,7 @@ module OffsitePayments #:nodoc:
136
136
 
137
137
  # Order amount should be equal to gross
138
138
  def amount_ok?(order_amount)
139
- BigDecimal.new(original_gross) == order_amount
139
+ BigDecimal(original_gross) == order_amount
140
140
  end
141
141
 
142
142
  # Status of transaction return from the Paytm. List of possible values:
@@ -245,7 +245,7 @@ module OffsitePayments #:nodoc:
245
245
  end
246
246
 
247
247
  def status(order_id, order_amount)
248
- if @notification.invoice_ok?(order_id) && @notification.amount_ok?(BigDecimal.new(order_amount))
248
+ if @notification.invoice_ok?(order_id) && @notification.amount_ok?(BigDecimal(order_amount))
249
249
  @notification.status
250
250
  else
251
251
  'Mismatch'
@@ -116,9 +116,9 @@ module OffsitePayments #:nodoc:
116
116
  end
117
117
 
118
118
  # Order amount should be equal to gross - discount
119
- def amount_ok?( order_amount, order_discount = BigDecimal.new( '0.0' ) )
119
+ def amount_ok?( order_amount, order_discount = BigDecimal( '0.0' ) )
120
120
  parsed_discount = discount.nil? ? 0.to_d : discount.to_d
121
- BigDecimal.new( original_gross ) == order_amount && parsed_discount == order_discount
121
+ BigDecimal( original_gross ) == order_amount && parsed_discount == order_discount
122
122
  end
123
123
 
124
124
  # Status of transaction return from the PayU. List of possible values:
@@ -258,7 +258,7 @@ module OffsitePayments #:nodoc:
258
258
  end
259
259
 
260
260
  def status( order_id, order_amount )
261
- if @notification.invoice_ok?( order_id ) && @notification.amount_ok?( BigDecimal.new(order_amount) )
261
+ if @notification.invoice_ok?( order_id ) && @notification.amount_ok?( BigDecimal(order_amount) )
262
262
  @notification.status
263
263
  else
264
264
  'Mismatch'
@@ -120,7 +120,7 @@ module OffsitePayments #:nodoc:
120
120
  end
121
121
 
122
122
  def amount
123
- Money.from_amount(BigDecimal.new(params['pg_amount']), currency)
123
+ Money.from_amount(BigDecimal(params['pg_amount']), currency)
124
124
  end
125
125
 
126
126
  def secret
@@ -424,10 +424,6 @@ module OffsitePayments #:nodoc:
424
424
  params['MESSAGE']
425
425
  end
426
426
 
427
- def pasref
428
- params['PASREF']
429
- end
430
-
431
427
  def authcode
432
428
  params['AUTHCODE']
433
429
  end
@@ -72,6 +72,7 @@ module OffsitePayments #:nodoc:
72
72
  attr_reader :identifier
73
73
 
74
74
  def initialize(order, account, options={})
75
+ @shipping_address_set = nil
75
76
  super
76
77
  @identifier = rand(0..99999).to_s.rjust(5, '0')
77
78
  add_field 'VendorTxCode', "#{order}-#{@identifier}"
@@ -150,7 +150,7 @@ module OffsitePayments #:nodoc:
150
150
  end
151
151
 
152
152
  def amount
153
- Money.from_amount(BigDecimal.new(gross), currency)
153
+ Money.from_amount(BigDecimal(gross), currency)
154
154
  end
155
155
 
156
156
  def item_id
@@ -83,7 +83,7 @@ module OffsitePayments #:nodoc:
83
83
  end
84
84
 
85
85
  def amount
86
- Money.from_amount(BigDecimal.new(gross), currency)
86
+ Money.from_amount(BigDecimal(gross), currency)
87
87
  end
88
88
 
89
89
  def key_present?
@@ -1,3 +1,3 @@
1
1
  module OffsitePayments
2
- VERSION = "2.7.22"
2
+ VERSION = "2.7.24"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: offsite_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.22
4
+ version: 2.7.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-10 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -276,7 +276,8 @@ files:
276
276
  homepage: https://github.com/activemerchant/offsite_payments
277
277
  licenses:
278
278
  - MIT
279
- metadata: {}
279
+ metadata:
280
+ allowed_push_host: https://rubygems.org
280
281
  post_install_message: "\n In order to use `offsite_payments` gem, you need to either
281
282
  install or add to your Gemfile\n one of the two options for Money gem:\n -
282
283
  `gem 'money'`\n - `gem 'shopify-money', require: 'money'`\n\n Regardless