ruby-gpwebpay 0.0.4 → 0.1.4

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: e02f9ec406203476768f544dbaae57da41d97cd4a32e3be4196af98d69fefa06
4
- data.tar.gz: f672fad5ae02cd02ea5d969e725695bd9334f4eb40a55720362cad1340a310c8
3
+ metadata.gz: 493b0cc82ddb5121dbc99cf6bed9a551353b05afd152170dfe17d5d01a62af82
4
+ data.tar.gz: 5e038735011db9cb45948a95abe68ecf4696ae6252ca25f4ab4182f0be030d6a
5
5
  SHA512:
6
- metadata.gz: 87c83d74dff2f30e5dc59012f92d46c0404fdeee9616b366d505862ced6b1b3390bb37a8f254f137fd6271879093a11599fb118940e9aa7176f531f99e99d475
7
- data.tar.gz: 2a0e7ee6365da766248626cec960140c4eaf472b668d900fcd1a0d71687b72bf40ad65b6758f40b4f1ad208c46cc5f170efff2f02bd64bc13aa806ec33aed985
6
+ metadata.gz: 0b68c379ce06ba515c548602dd8fb7073882ecd277b80ca4fd080749cdb4c16fe220e8523d39162b99f9f217c153d4615a6792454f500d1955cdb74ea55fab57
7
+ data.tar.gz: ffa53f96c7b4ec84041311b3fc59b7869063013188320cb233343dc3ef9c399e5ef40524da1a73907998d82aedcf4e9e0b0c54c3ff2662f1cfc45e92c186fc7e
@@ -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 = "")
@@ -6,7 +6,7 @@ module GpWebpay
6
6
  @payment_attributes = payment_attributes
7
7
  GpWebpay.logger.info "Payment Attrs: #{@payment_attributes}"
8
8
  @verification_attrs = verification_attrs
9
- GpWebpay.logger.info "Verification Attrs: #{@verification_attrs}"
9
+ GpWebpay.logger.info "Verification Attrs: #{@verification_attrs}" if @verification_attrs
10
10
  end
11
11
 
12
12
  def verified_response?(params)
@@ -1,3 +1,3 @@
1
1
  module GpWebpay
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -71,39 +71,49 @@ module GpWebpay
71
71
  hash_response = hash_response["#{first_lvl_key}"]
72
72
  second_lvl_key = hash_response.keys.last
73
73
  hash_response = hash_response["#{second_lvl_key}"]
74
+ GpWebpay.logger.info "Response: #{hash_response}"
74
75
  GpWebpay::WebServices::Response.new(hash_response)
75
76
  end
76
77
 
77
78
  def request_attributes(type = "")
78
- {
79
+ base_attributes = {
79
80
  message_id: message_id(type),
80
81
  merchant_number: config.merchant_number,
81
82
  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
83
  digest: ws_verification(type).digest,
104
- # Deprecated Attrs, will remove
105
- currency: currency,
106
84
  }
85
+
86
+ case type
87
+ when "processRegularSubscriptionPayment"
88
+ payment_attributes = {
89
+ merchant_order_number: merchant_order_number,
90
+ master_order_number: master_order_number,
91
+ amount: amount_in_cents,
92
+ capture_flag: capture_flag,
93
+ card_holder_name: card_holder.name,
94
+ card_holder_email: card_holder.email,
95
+ card_holder_phone_country: card_holder.phone_country,
96
+ card_holder_phone: card_holder.phone,
97
+ card_holder_mobile_phone_country: card_holder.mobile_phone_country,
98
+ card_holder_mobile_phone: card_holder.mobile_phone,
99
+ address_match: address_match,
100
+ billing_name: billing.name,
101
+ billing_address1: billing.address1,
102
+ billing_city: billing.city,
103
+ billing_postal_code: billing.postal_code,
104
+ billing_country: billing.country,
105
+ shipping_name: shipping.name,
106
+ shipping_address1: shipping.address1,
107
+ shipping_city: shipping.city,
108
+ shipping_postal_code: shipping.postal_code,
109
+ shipping_country: shipping.country,
110
+ # Deprecated Attrs, will remove
111
+ currency: currency,
112
+ }
113
+ base_attributes.merge(payment_attributes)
114
+ else
115
+ base_attributes
116
+ end
107
117
  end
108
118
 
109
119
  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.4
4
+ version: 0.1.4
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-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport