offsite_payments 2.4.0 → 2.5.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
  SHA1:
3
- metadata.gz: 9f3751c70ad135fce78fe690b43bd5f14cbabd90
4
- data.tar.gz: 6f1a39ec1021b73443533901f56110e91b943ad9
3
+ metadata.gz: 6dbb49e3c6e9875cd51b4b6c3083adacfb7f52ca
4
+ data.tar.gz: 3c221668d16554ddd7a6382a863d4e11df4681a7
5
5
  SHA512:
6
- metadata.gz: 63a6d6d932073822f7ac36ea377991e0f9af6ffd33cf3a0ae9662ffedd606af5625e5bb11052544d6d50c75e061c5e44243801ceb610e873398de7aee7e5aa69
7
- data.tar.gz: 1197aa56f07ce913018dbde66b41186040a8c892657c1739079fe6cc194d990e753d6ef336a65bcb9fdded91367b4368e50fe6e20ce0124cfc2b037f7ee24efb
6
+ metadata.gz: 42de1a61d962eebcc882dde55931b8510a962d05dc68b1e9655cf2c0ef56c612c15d79fdb8620ef7a4676cde336702d9b02b9a6bed10c0b61729a5b6b859bc6a
7
+ data.tar.gz: 569f2135cc94d0edb84aeab8f8a87fc391a59df2035d70de26fd63b6258092a62201fd3cc0f637f81d8128174bfd4622de7d873dc788411829cdc979d186ec1b
@@ -96,8 +96,8 @@ module OffsitePayments
96
96
  order_id.to_s == invoice.to_s
97
97
  end
98
98
 
99
- def amount_ok?( order_amount )
100
- amount.to_d == order_amount
99
+ def amount_ok?(order_amount)
100
+ amount == Money.from_amount(order_amount, currency)
101
101
  end
102
102
 
103
103
  def item_id
@@ -53,13 +53,13 @@ module OffsitePayments #:nodoc:
53
53
  'LKR' => '144',
54
54
  'KWD' => '414',
55
55
  }
56
-
56
+ # change url
57
57
  def self.service_url
58
58
  case OffsitePayments.mode
59
59
  when :production
60
- 'https://www.paydollar.com/b2c2/eng/payment/payForm.jsp'
60
+ 'https://www.paydollar.com/b2c2/eng/payment/payShopify.jsp'
61
61
  when :test
62
- 'https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp'
62
+ 'https://test.paydollar.com/b2cDemo/eng/payment/payShopify.jsp'
63
63
  else
64
64
  raise StandardError, "Integration mode set to an invalid value: #{mode}"
65
65
  end
@@ -42,7 +42,7 @@ module OffsitePayments #:nodoc:
42
42
  :address1 => 'address1',
43
43
  :address2 => 'address2',
44
44
  :state => 'state',
45
- :zip => 'zip',
45
+ :zip => 'zipcode',
46
46
  :country => 'country'
47
47
 
48
48
  # Which tab you want to be open default on PayU
@@ -88,6 +88,7 @@ module OffsitePayments #:nodoc:
88
88
  end
89
89
 
90
90
  def extract_digits(value)
91
+ return unless value
91
92
  value.scan(/\d+/).join('')
92
93
  end
93
94
 
@@ -78,7 +78,8 @@ module OffsitePayments #:nodoc:
78
78
  end
79
79
 
80
80
  def generate_signature
81
- Universal.sign(@fields, @key)
81
+ fields_to_sign = @fields.select { |key, _| key.start_with?('x_') && key != 'x_signature' }
82
+ Universal.sign(fields_to_sign, @key)
82
83
  end
83
84
 
84
85
  mapping :account, 'x_account_id'
@@ -1,3 +1,3 @@
1
1
  module OffsitePayments
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: offsite_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.2.14
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.1'
22
+ version: 6.x
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 3.2.14
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.1'
32
+ version: 6.x
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: i18n
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -84,14 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 3.2.0
87
+ version: 3.3.0
88
88
  type: :runtime
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: 3.2.0
94
+ version: 3.3.0
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: nokogiri
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -115,7 +115,7 @@ dependencies:
115
115
  version: 3.2.20
116
116
  - - "<"
117
117
  - !ruby/object:Gem::Version
118
- version: '5.1'
118
+ version: 6.x
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
@@ -125,7 +125,7 @@ dependencies:
125
125
  version: 3.2.20
126
126
  - - "<"
127
127
  - !ruby/object:Gem::Version
128
- version: '5.1'
128
+ version: 6.x
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: rake
131
131
  requirement: !ruby/object:Gem::Requirement