ruby-gpwebpay 0.0.3 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gp_webpay/payment.rb +2 -2
- data/lib/gp_webpay/payment_attributes.rb +2 -1
- data/lib/gp_webpay/verification.rb +2 -0
- data/lib/gp_webpay/version.rb +1 -1
- data/lib/gp_webpay/web_services.rb +33 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13d30736b1da36214ee47ca3f39d7a476cf498e94dfd3f41c8f9372666d90bb6
|
4
|
+
data.tar.gz: 92eb7b041e5b4e54842d04258356c33248e727d84611e03fed1660e0214979f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45033725319c4b31883e93290c9066e7e599e484d9a0b7014e9c9806ab752fc486bd590d401d08000c4000bd9c49d95a71976ef5d619a41569138ce4b2dc1bdc
|
7
|
+
data.tar.gz: 822bf9de1d32673050689467a797e34c3568e929a8dd264c076fb34cd70058b1a0de723fd12732197e4a7a995af01fb9a9e778c1797f26eff5adb472e4b7e945
|
data/lib/gp_webpay/payment.rb
CHANGED
@@ -29,8 +29,8 @@ module GpWebpay
|
|
29
29
|
def pay_url(options = {})
|
30
30
|
self.redirect_url ||= options[:redirect_url]
|
31
31
|
|
32
|
-
generated_url = "#{config.pay_url}?#{pay_verification.payment_attributes_with_digest.to_param}"
|
33
32
|
GpWebpay.logger.info "Attributes user for URL generation: #{pay_verification.payment_attributes_with_digest}"
|
33
|
+
generated_url = "#{config.pay_url}?#{pay_verification.payment_attributes_with_digest.to_param}"
|
34
34
|
GpWebpay.logger.info "Produced URL: #{generated_url}"
|
35
35
|
generated_url
|
36
36
|
end
|
@@ -43,7 +43,7 @@ module GpWebpay
|
|
43
43
|
private
|
44
44
|
|
45
45
|
def pay_verification_attrs
|
46
|
-
%i(
|
46
|
+
%i(OPERATION ORDERNUMBER PRCODE SRCODE RESULTTEXT)
|
47
47
|
end
|
48
48
|
|
49
49
|
def pay_attributes
|
@@ -4,7 +4,9 @@ module GpWebpay
|
|
4
4
|
class Verification
|
5
5
|
def initialize(payment_attributes, verification_attrs = nil)
|
6
6
|
@payment_attributes = payment_attributes
|
7
|
+
GpWebpay.logger.info "Payment Attrs: #{@payment_attributes}"
|
7
8
|
@verification_attrs = verification_attrs
|
9
|
+
GpWebpay.logger.info "Verification Attrs: #{@verification_attrs}"
|
8
10
|
end
|
9
11
|
|
10
12
|
def verified_response?(params)
|
data/lib/gp_webpay/version.rb
CHANGED
@@ -75,35 +75,44 @@ module GpWebpay
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def request_attributes(type = "")
|
78
|
-
{
|
78
|
+
base_attributes = {
|
79
79
|
message_id: message_id(type),
|
80
80
|
merchant_number: config.merchant_number,
|
81
81
|
order_number: order_number,
|
82
|
-
merchant_order_number: merchant_order_number,
|
83
|
-
master_order_number: master_order_number,
|
84
|
-
amount: amount_in_cents,
|
85
|
-
capture_flag: capture_flag,
|
86
|
-
card_holder_name: card_holder.name,
|
87
|
-
card_holder_email: card_holder.email,
|
88
|
-
card_holder_phone_country: card_holder.phone_country,
|
89
|
-
card_holder_phone: card_holder.phone,
|
90
|
-
card_holder_mobile_phone_country: card_holder.mobile_phone_country,
|
91
|
-
card_holder_mobile_phone: card_holder.mobile_phone,
|
92
|
-
address_match: address_match,
|
93
|
-
billing_name: billing.name,
|
94
|
-
billing_address1: billing.address1,
|
95
|
-
billing_city: billing.city,
|
96
|
-
billing_postal_code: billing.postal_code,
|
97
|
-
billing_country: billing.country,
|
98
|
-
shipping_name: shipping.name,
|
99
|
-
shipping_address1: shipping.address1,
|
100
|
-
shipping_city: shipping.city,
|
101
|
-
shipping_postal_code: shipping.postal_code,
|
102
|
-
shipping_country: shipping.country,
|
103
82
|
digest: ws_verification(type).digest,
|
104
|
-
# Deprecated Attrs, will remove
|
105
|
-
currency: currency,
|
106
83
|
}
|
84
|
+
|
85
|
+
case type
|
86
|
+
when "processRegularSubscriptionPayment"
|
87
|
+
payment_attributes = {
|
88
|
+
merchant_order_number: merchant_order_number,
|
89
|
+
master_order_number: master_order_number,
|
90
|
+
amount: amount_in_cents,
|
91
|
+
capture_flag: capture_flag,
|
92
|
+
card_holder_name: card_holder.name,
|
93
|
+
card_holder_email: card_holder.email,
|
94
|
+
card_holder_phone_country: card_holder.phone_country,
|
95
|
+
card_holder_phone: card_holder.phone,
|
96
|
+
card_holder_mobile_phone_country: card_holder.mobile_phone_country,
|
97
|
+
card_holder_mobile_phone: card_holder.mobile_phone,
|
98
|
+
address_match: address_match,
|
99
|
+
billing_name: billing.name,
|
100
|
+
billing_address1: billing.address1,
|
101
|
+
billing_city: billing.city,
|
102
|
+
billing_postal_code: billing.postal_code,
|
103
|
+
billing_country: billing.country,
|
104
|
+
shipping_name: shipping.name,
|
105
|
+
shipping_address1: shipping.address1,
|
106
|
+
shipping_city: shipping.city,
|
107
|
+
shipping_postal_code: shipping.postal_code,
|
108
|
+
shipping_country: shipping.country,
|
109
|
+
# Deprecated Attrs, will remove
|
110
|
+
currency: currency,
|
111
|
+
}
|
112
|
+
base_attributes.merge(payment_attributes)
|
113
|
+
else
|
114
|
+
base_attributes
|
115
|
+
end
|
107
116
|
end
|
108
117
|
|
109
118
|
def config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-gpwebpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrej Antas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|