workarea-usaepay 1.0.40 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/workarea/payment/authorize/credit_card.decorator +3 -2
- data/lib/usaepay/bogus_usaepay.rb +16 -0
- data/lib/usaepay/gateway.rb +2 -1
- data/lib/workarea/usaepay.rb +3 -2
- data/lib/workarea/usaepay/version.rb +1 -1
- data/test/system/workarea/storefront/accounts/credit_cards_system_test.decorator +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 362ae18802b8383763ffd2514f3eb395c8abaf00cdc12b4c8b59e498eff987e9
|
4
|
+
data.tar.gz: 0fdb74dff14dbf0db798dde94870ccbb45c7d47d71c0535c0ec081a5c74ebeee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735f2a2f222462aadddfdab7d9f2386a5a2c0256bee2d2c42dd848e8c8dd36174f2adbf71b183fe30ab32f4fac4609dccf5f43d6f89985fc460bea41cce54ad0
|
7
|
+
data.tar.gz: ac904741ff5812ffa76f143c140e0e2809e3353136e620a3f00d69e1db41d6646a1ccd27173ddb27f19b38997c87961040fefab9c59af8bae444a5b3c0409e11
|
@@ -7,13 +7,14 @@ module Workarea
|
|
7
7
|
|
8
8
|
def complete! #[3]
|
9
9
|
return unless Payment::StoreCreditCard.new(tender, options).save! #[4]
|
10
|
-
|
10
|
+
ip_address = options[:checkout]&.order&.ip_address
|
11
11
|
transaction.response = #[5][6]
|
12
12
|
handle_active_merchant_errors do #[7]
|
13
13
|
gateway.authorize( #[8]
|
14
14
|
transaction.amount.cents, #[9]
|
15
15
|
payment_source,
|
16
|
-
transaction_args
|
16
|
+
transaction_args,
|
17
|
+
ip_address
|
17
18
|
)
|
18
19
|
end
|
19
20
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ActiveMerchant
|
2
|
+
module Billing
|
3
|
+
class BogusUsaEpayGateway < BogusGateway
|
4
|
+
def verify(paysource, options)
|
5
|
+
case normalize(paysource)
|
6
|
+
when /1$/
|
7
|
+
Response.new(true, SUCCESS_MESSAGE, {:billingid => '1', :token => '1'}, :test => true, :authorization => AUTHORIZATION)
|
8
|
+
when /2$/
|
9
|
+
Response.new(false, FAILURE_MESSAGE, {:billingid => nil, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
10
|
+
else
|
11
|
+
raise Error, error_message(paysource)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/usaepay/gateway.rb
CHANGED
@@ -6,8 +6,9 @@ module ActiveMerchant
|
|
6
6
|
class_attribute :test_rest_endpoint, :production_rest_endpoint
|
7
7
|
|
8
8
|
|
9
|
-
def authorize(money, credit_card, options = {})
|
9
|
+
def authorize(money, credit_card, options = {}, ip_address)
|
10
10
|
post = {}
|
11
|
+
post[:ip] = ip_address if ip_address.present?
|
11
12
|
add_amount(post, money)
|
12
13
|
add_invoice(post, options)
|
13
14
|
|
data/lib/workarea/usaepay.rb
CHANGED
@@ -4,6 +4,7 @@ require 'workarea/admin'
|
|
4
4
|
require 'workarea/usaepay/engine'
|
5
5
|
require 'workarea/usaepay/version'
|
6
6
|
require 'usaepay/gateway'
|
7
|
+
require 'usaepay/bogus_usaepay'
|
7
8
|
|
8
9
|
module Workarea
|
9
10
|
module Usaepay
|
@@ -30,12 +31,12 @@ module Workarea
|
|
30
31
|
def self.auto_initialize_gateway
|
31
32
|
if credentials.present?
|
32
33
|
if Rails.env.test?
|
33
|
-
self.gateway = ActiveMerchant::Billing::
|
34
|
+
self.gateway = ActiveMerchant::Billing::BogusUsaEpayGateway.new credentials
|
34
35
|
else
|
35
36
|
self.gateway = ActiveMerchant::Billing::UsaEpayCustom.new credentials
|
36
37
|
end
|
37
38
|
else
|
38
|
-
self.gateway = ActiveMerchant::Billing::
|
39
|
+
self.gateway = ActiveMerchant::Billing::BogusUsaEpayGateway.new
|
39
40
|
end
|
40
41
|
end
|
41
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-usaepay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gunasekaran.Raja
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: workarea
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- bin/rails
|
54
54
|
- config/initializers/workarea.rb
|
55
55
|
- config/routes.rb
|
56
|
+
- lib/usaepay/bogus_usaepay.rb
|
56
57
|
- lib/usaepay/gateway.rb
|
57
58
|
- lib/workarea/storefront/system_test.rb
|
58
59
|
- lib/workarea/usaepay.rb
|