payu-latam 1.0.1 → 1.0.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/pay_u/confirmation.rb +3 -0
- data/lib/pay_u/form.rb +3 -0
- data/lib/pay_u/order.rb +3 -0
- data/lib/pay_u/response.rb +3 -0
- data/lib/pay_u/version.rb +1 -1
- data/spec/fixtures/confirmation.rb +3 -3
- data/spec/fixtures/response.rb +3 -3
- data/spec/pay_u/confirmation_spec.rb +4 -0
- data/spec/pay_u/form_spec.rb +9 -0
- data/spec/pay_u/response_spec.rb +4 -0
- 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: d906bd855673cde101ab9fbddca1a87584f3da1b3cef342bbae16d8b150e36ff
|
4
|
+
data.tar.gz: 583c4402c4171a522cc4d72cf8492d8f74dbe6b42c87b3e9638dbc4162d8c483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e695a48cb4460e6d14b6a25bbbe4f780845e7140b68da019f71a9b771e9666f7edcd52948161846d07ad38209d3ab74eb7d28deec2901406d0b62ab1135a6683
|
7
|
+
data.tar.gz: 2ae5872b640360730f70f2e6736af228c0e8f7958127e47cd1fe5de1b44c6b1f5a21b271706c8e8507e9bd0cb950fee5d1356a325a89e418a399a9eb6c69aa00
|
data/lib/pay_u/confirmation.rb
CHANGED
@@ -19,6 +19,9 @@ class PayU::Confirmation
|
|
19
19
|
payment_method_code: params[:payment_method_type].to_i,
|
20
20
|
email: params[:email_buyer],
|
21
21
|
transaction_id: params[:transaction_id],
|
22
|
+
extra_1: params[:extra1],
|
23
|
+
extra_2: params[:extra2],
|
24
|
+
extra_3: params[:extra3],
|
22
25
|
)
|
23
26
|
@signer = PayU::Signer::Confirmation.new(@order.attributes)
|
24
27
|
end
|
data/lib/pay_u/form.rb
CHANGED
@@ -30,6 +30,9 @@ class PayU::Form
|
|
30
30
|
currency: order.currency,
|
31
31
|
signature: signature,
|
32
32
|
test: order.test? ? "1" : "0",
|
33
|
+
extra1: order.extra_1,
|
34
|
+
extra2: order.extra_2,
|
35
|
+
extra3: order.extra_3,
|
33
36
|
responseUrl: order.response_url,
|
34
37
|
confirmationUrl: order.confirmation_url,
|
35
38
|
},
|
data/lib/pay_u/order.rb
CHANGED
@@ -19,6 +19,9 @@ class PayU::Order
|
|
19
19
|
attribute :payment_method_code, Integer
|
20
20
|
attribute :email, String
|
21
21
|
attribute :transaction_id, String
|
22
|
+
attribute :extra_1, String
|
23
|
+
attribute :extra_2, String
|
24
|
+
attribute :extra_3, String
|
22
25
|
|
23
26
|
def initialize(params)
|
24
27
|
super(params)
|
data/lib/pay_u/response.rb
CHANGED
@@ -19,6 +19,9 @@ class PayU::Response
|
|
19
19
|
payment_method_code: params[:polPaymentMethodType].to_i,
|
20
20
|
email: params[:buyerEmail],
|
21
21
|
transaction_id: params[:transactionId],
|
22
|
+
extra_1: params[:extra1],
|
23
|
+
extra_2: params[:extra2],
|
24
|
+
extra_3: params[:extra3],
|
22
25
|
)
|
23
26
|
@signer = PayU::Signer::Response.new(@order.attributes)
|
24
27
|
end
|
data/lib/pay_u/version.rb
CHANGED
@@ -19,14 +19,15 @@ module Fixtures
|
|
19
19
|
cc_holder: "Approved",
|
20
20
|
transaction_date: "2018-12-27 15:38:01",
|
21
21
|
pse_bank: "",
|
22
|
-
extra2: "",
|
23
22
|
shipping_city: "",
|
24
23
|
billing_address: "",
|
25
24
|
billing_country: "CO",
|
26
25
|
payment_request_state: "A",
|
27
26
|
date: "2018.12.27 03:38:01",
|
28
27
|
transaction_bank_id: "608150",
|
29
|
-
extra1: "",
|
28
|
+
extra1: "extra 1",
|
29
|
+
extra2: "extra 2",
|
30
|
+
extra3: "extra 3",
|
30
31
|
phone: "",
|
31
32
|
shipping_country: "CO",
|
32
33
|
cc_number: "************0086",
|
@@ -43,7 +44,6 @@ module Fixtures
|
|
43
44
|
reference_sale: "2205229",
|
44
45
|
reference_pol: "845122533",
|
45
46
|
error_message_bank: "",
|
46
|
-
extra3: "",
|
47
47
|
pse_reference1: "",
|
48
48
|
pse_reference2: "",
|
49
49
|
pse_reference3: "",
|
data/spec/fixtures/response.rb
CHANGED
@@ -29,9 +29,9 @@ module Fixtures
|
|
29
29
|
lapPaymentMethodType: "CREDIT_CARD",
|
30
30
|
lapTransactionState: "APPROVED",
|
31
31
|
message: "APPROVED",
|
32
|
-
extra1: "",
|
33
|
-
extra2: "",
|
34
|
-
extra3: "",
|
32
|
+
extra1: "extra 1",
|
33
|
+
extra2: "extra 2",
|
34
|
+
extra3: "extra 3",
|
35
35
|
authorizationCode: "608150",
|
36
36
|
merchant_address: "Av 123 Calle 12",
|
37
37
|
merchant_name: "Test PayU Test comercio",
|
@@ -5,8 +5,12 @@ RSpec.describe PayU::Confirmation do
|
|
5
5
|
it "creates object from callback" do
|
6
6
|
confirmation = PayU::Confirmation.new(Fixtures.confirmation)
|
7
7
|
|
8
|
+
expect(confirmation.order.amount).to eq(Fixtures.confirmation[:value].to_f)
|
8
9
|
expect(confirmation.order.reference_code).to eq(Fixtures.confirmation[:reference_sale])
|
9
10
|
expect(confirmation.order.transaction_id).to eq(Fixtures.confirmation[:transaction_id])
|
11
|
+
expect(confirmation.order.extra_1).to eq(Fixtures.confirmation[:extra1])
|
12
|
+
expect(confirmation.order.extra_2).to eq(Fixtures.confirmation[:extra2])
|
13
|
+
expect(confirmation.order.extra_3).to eq(Fixtures.confirmation[:extra3])
|
10
14
|
expect(confirmation.valid?).to be_truthy
|
11
15
|
end
|
12
16
|
|
data/spec/pay_u/form_spec.rb
CHANGED
@@ -24,6 +24,9 @@ RSpec.describe PayU::Form do
|
|
24
24
|
description = "Test PAYU"
|
25
25
|
amount = 20_000
|
26
26
|
currency = :COP
|
27
|
+
extra1 = "extra1"
|
28
|
+
extra2 = "extra2"
|
29
|
+
extra3 = "extra3"
|
27
30
|
PayU.configure do |config|
|
28
31
|
config.response_url = response_url
|
29
32
|
config.confirmation_url = confirmation_url
|
@@ -36,6 +39,9 @@ RSpec.describe PayU::Form do
|
|
36
39
|
currency: currency,
|
37
40
|
tax: 3_193,
|
38
41
|
tax_return_base: 16_806,
|
42
|
+
extra_1: extra1,
|
43
|
+
extra_2: extra2,
|
44
|
+
extra_3: extra3,
|
39
45
|
).form
|
40
46
|
|
41
47
|
expect(form.params).to be_a(Hash)
|
@@ -51,5 +57,8 @@ RSpec.describe PayU::Form do
|
|
51
57
|
expect(form.params[:fields][:test]).to eq("1")
|
52
58
|
expect(form.params[:fields][:responseUrl]).to eq(response_url)
|
53
59
|
expect(form.params[:fields][:confirmationUrl]).to eq(confirmation_url)
|
60
|
+
expect(form.params[:fields][:extra1]).to eq(extra1)
|
61
|
+
expect(form.params[:fields][:extra2]).to eq(extra2)
|
62
|
+
expect(form.params[:fields][:extra3]).to eq(extra3)
|
54
63
|
end
|
55
64
|
end
|
data/spec/pay_u/response_spec.rb
CHANGED
@@ -5,8 +5,12 @@ RSpec.describe PayU::Response do
|
|
5
5
|
it "creates object from callback" do
|
6
6
|
response = PayU::Response.new(Fixtures.response)
|
7
7
|
|
8
|
+
expect(response.order.amount).to eq(Fixtures.response[:TX_VALUE].to_f)
|
8
9
|
expect(response.order.reference_code).to eq(Fixtures.response[:referenceCode])
|
9
10
|
expect(response.order.transaction_id).to eq(Fixtures.response[:transactionId])
|
11
|
+
expect(response.order.extra_1).to eq(Fixtures.response[:extra1])
|
12
|
+
expect(response.order.extra_2).to eq(Fixtures.response[:extra2])
|
13
|
+
expect(response.order.extra_3).to eq(Fixtures.response[:extra3])
|
10
14
|
expect(response.valid?).to be_truthy
|
11
15
|
end
|
12
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payu-latam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Slang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|