ruby-gpwebpay 0.0.2 → 0.1.2
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 +4 -4
- data/lib/gp_webpay.rb +9 -0
- data/lib/gp_webpay/payment.rb +5 -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 +11 -2
- 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: e6bbbf7e5953de3462e71079455cd181b675b01ddb63e2c59f22f28e51afbd23
|
4
|
+
data.tar.gz: ed0f1389c4e4113f64c72edb2d42671ade68db9045e117cc904fdc221c9f340a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52049cba9cc3ef1cd7ff6a95fa02e16648bfd8aa2b534d25ce1017431e95aea215e64c947398fb78d9fb415988dec07c64c626ccd9c80463f3dc9afef6501837
|
7
|
+
data.tar.gz: 8e3f76458acebae7b8ebf2270103047663db8aa907cd4a75b40e5ffb6de8eefe6a346e9a5ec6fcb0ad2dee57426a7a3bce5b1b10603453a6e52766dcaf8e96c1
|
data/lib/gp_webpay.rb
CHANGED
data/lib/gp_webpay/payment.rb
CHANGED
@@ -29,7 +29,10 @@ module GpWebpay
|
|
29
29
|
def pay_url(options = {})
|
30
30
|
self.redirect_url ||= options[:redirect_url]
|
31
31
|
|
32
|
-
"#{
|
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
|
+
GpWebpay.logger.info "Produced URL: #{generated_url}"
|
35
|
+
generated_url
|
33
36
|
end
|
34
37
|
|
35
38
|
def success?(params)
|
@@ -40,7 +43,7 @@ module GpWebpay
|
|
40
43
|
private
|
41
44
|
|
42
45
|
def pay_verification_attrs
|
43
|
-
%i(
|
46
|
+
%i(OPERATION ORDERNUMBER PRCODE SRCODE RESULTTEXT)
|
44
47
|
end
|
45
48
|
|
46
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,10 +75,13 @@ 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
|
+
digest: ws_verification(type).digest,
|
83
|
+
}
|
84
|
+
payment_attributes = {
|
82
85
|
merchant_order_number: merchant_order_number,
|
83
86
|
master_order_number: master_order_number,
|
84
87
|
amount: amount_in_cents,
|
@@ -100,10 +103,16 @@ module GpWebpay
|
|
100
103
|
shipping_city: shipping.city,
|
101
104
|
shipping_postal_code: shipping.postal_code,
|
102
105
|
shipping_country: shipping.country,
|
103
|
-
digest: ws_verification(type).digest,
|
104
106
|
# Deprecated Attrs, will remove
|
105
107
|
currency: currency,
|
106
108
|
}
|
109
|
+
|
110
|
+
case type
|
111
|
+
when "processRegularSubscriptionPayment"
|
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.2
|
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
|