ruby-gpwebpay 0.0.3 → 0.1.3

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: 5f6c2c9d8a6a86478203414e6e6a5da3c0cb740518cabd80fa1899e8af99bc20
4
- data.tar.gz: beed7d948bfa831b7ec7b3f9450c92f83001678b9f0a15c51905ec1d4437f6ef
3
+ metadata.gz: 13d30736b1da36214ee47ca3f39d7a476cf498e94dfd3f41c8f9372666d90bb6
4
+ data.tar.gz: 92eb7b041e5b4e54842d04258356c33248e727d84611e03fed1660e0214979f5
5
5
  SHA512:
6
- metadata.gz: 8054c50b03e60d8e659793a9e2e6b3de8f796679f595265620561ebc076fa5e9e4752d696aca919c40810fff74eab8bd2e0267b5f201b4f1f28a33e176fba0bc
7
- data.tar.gz: bfd11dc8894f4e5934c9a0caa3849b4c8e2eb2954e16ed2d19031003540d3221222a87125de193573e9e087946af9e7013b2f123b3f98d5d70c63b49df83e47e
6
+ metadata.gz: 45033725319c4b31883e93290c9066e7e599e484d9a0b7014e9c9806ab752fc486bd590d401d08000c4000bd9c49d95a71976ef5d619a41569138ce4b2dc1bdc
7
+ data.tar.gz: 822bf9de1d32673050689467a797e34c3568e929a8dd264c076fb34cd70058b1a0de723fd12732197e4a7a995af01fb9a9e778c1797f26eff5adb472e4b7e945
@@ -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(operation order_number prcode srcode resulttext)
46
+ %i(OPERATION ORDERNUMBER PRCODE SRCODE RESULTTEXT)
47
47
  end
48
48
 
49
49
  def pay_attributes
@@ -28,7 +28,8 @@ module GpWebpay
28
28
  :message_id => 'MESSAGEID',
29
29
  :bank_id => 'BANKID',
30
30
  :currency => 'CURRENCY',
31
- :operation => 'OPERATION'
31
+ :operation => 'OPERATION',
32
+ :user_param => 'USERPARAM1',
32
33
  }
33
34
 
34
35
  def initialize(payment, ws_flag = false, type = "")
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module GpWebpay
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -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.0.3
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-07 00:00:00.000000000 Z
11
+ date: 2021-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport