vtweb_json 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -10
- data/lib/vtweb_json.rb +21 -7
- data/lib/vtweb_json/version.rb +1 -1
- data/vtweb_json.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92dbeec3f0d230f305557b9e45555ffdd7134842
|
4
|
+
data.tar.gz: 82389fbde67ca04815e945c0a829378aaa1283e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e5b737be502a6f482ab0382f5d9cb3d83dbef1af48d74012ddeb599a8ce2b952fa46af85be72dace291b9e265269e516f4b7754d22406090d551ed024e0c55
|
7
|
+
data.tar.gz: 47a0e0ffa745e4f68a59e70bf6c15601989e92a1dba62c58cfdb4fb2f852b75cdaf19d242585bb913d985f7ca83095b41ed6763dcbb9e96f142d2dbdec5b8a3d
|
data/README.md
CHANGED
@@ -58,17 +58,17 @@ In your controller, create a method to use the gem. I took the code from https:/
|
|
58
58
|
"item_name1" => item.product.name, "item_name2" => item.product.name }
|
59
59
|
end
|
60
60
|
|
61
|
-
client.
|
61
|
+
client.items = params["item"]
|
62
62
|
client.billing_different_with_shipping = 1
|
63
63
|
client.required_shipping_address = 1
|
64
|
-
client.first_name = params[:
|
65
|
-
client.last_name = params[:
|
66
|
-
client.address1 = params[:
|
67
|
-
client.address2 = params[:
|
68
|
-
client.city = params[:
|
64
|
+
client.first_name = params[:first_name]
|
65
|
+
client.last_name = params[:last_name]
|
66
|
+
client.address1 = params[:address1]
|
67
|
+
client.address2 = params[:address2]
|
68
|
+
client.city = params[:scity]
|
69
69
|
client.country_code = "IDN"
|
70
|
-
client.postal_code = params[:
|
71
|
-
client.phone = params[:
|
70
|
+
client.postal_code = params[:postal_code]
|
71
|
+
client.phone = params[:phone]
|
72
72
|
client.shipping_first_name = params[:shipping_first_name]
|
73
73
|
client.shipping_last_name = params[:shipping_last_name]
|
74
74
|
client.shipping_address1 = params[:shipping_address1]
|
@@ -94,11 +94,11 @@ In your controller, create a method to use the gem. I took the code from https:/
|
|
94
94
|
render :layout => 'application'
|
95
95
|
end
|
96
96
|
|
97
|
-
After you get
|
97
|
+
After you get token_browser and token_merchant, you have to send a http post request merchant_id, order_id and token_browser to redirection url of vtweb. This code was also taken from https://github.com/veritrans/veritrans-rails-sample-cart :
|
98
98
|
|
99
99
|
<h1 align="center">Confirm Purchase Items</h1>
|
100
100
|
<%= form_tag(@client.redirection_url, :name => "form_auto_post") do -%>
|
101
|
-
<input type="hidden" name="merchant_id" value="<%= @client.
|
101
|
+
<input type="hidden" name="merchant_id" value="<%= @client._merchant_id %>">
|
102
102
|
<input type="hidden" name="order_id" value="<%= @client.order_id %>">
|
103
103
|
<input type="hidden" name="token_browser" value="<%= @tokens["token_browser"] %>">
|
104
104
|
<table border="1" align="center" width="80%" cellpadding="10" bgcolor="#FFFFCC">
|
data/lib/vtweb_json.rb
CHANGED
@@ -22,7 +22,7 @@ module VtwebJson
|
|
22
22
|
:shipping_country_code, :shipping_first_name, :shipping_last_name, :shipping_phone, :shipping_postal_code, :email,
|
23
23
|
:payment_methods, :enable_3d_secure, :address1, :address2, :city, :country_code, :first_name, :last_name, :phone, :postal_code,
|
24
24
|
:finish_payment_return_url, :error_payment_return_url, :unfinish_payment_return_url, :bank, :installment_banks, :installment_terms,
|
25
|
-
:point_banks, :promo_bins, :
|
25
|
+
:point_banks, :promo_bins, :items
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -75,12 +75,26 @@ module VtwebJson
|
|
75
75
|
json.billing_different_with_shipping self.billing_different_with_shipping
|
76
76
|
json.required_shipping_address self.required_shipping_address
|
77
77
|
json.repeat_line self.item.length
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
78
|
+
item_id = []
|
79
|
+
item_name1 = []
|
80
|
+
item_name2 = []
|
81
|
+
price = []
|
82
|
+
quantity = []
|
83
|
+
self.items.each do |item|
|
84
|
+
item_id << item['item_id']
|
85
|
+
json.item_id item_id
|
86
|
+
|
87
|
+
item_name1 << item['item_name1']
|
88
|
+
json.item_name1 item_name1
|
89
|
+
|
90
|
+
item_name2 << item['item_name2']
|
91
|
+
json.item_name2 item_name2
|
92
|
+
|
93
|
+
price << item['price']
|
94
|
+
json.price price
|
95
|
+
|
96
|
+
quantity << item['quantity']
|
97
|
+
json.quantity quantity
|
84
98
|
end
|
85
99
|
|
86
100
|
# Required if required_shipping_address = 1
|
data/lib/vtweb_json/version.rb
CHANGED
data/vtweb_json.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["panggi@me.com"]
|
11
11
|
spec.summary = %q{Ruby wrapper for Veritrans VT-Web using JSON Request.}
|
12
12
|
spec.description = %q{VT-Web makes accepting online payments simple because the whole payment process is handled by Veritrans, and we take care most of the information security compliance requirements from the bank (Veritrans is certified as a PCI-DSS Level 1 Service Provider). Merchants focus on their core business, while we take care of the rest.}
|
13
|
-
spec.homepage = "https://github.com/panggi/
|
13
|
+
spec.homepage = "https://github.com/panggi/vtweb_json"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vtweb_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Panggi Libersa Jasri Akadol
|
@@ -101,7 +101,7 @@ files:
|
|
101
101
|
- lib/vtweb_json/merchant_hash_generator.rb
|
102
102
|
- lib/vtweb_json/version.rb
|
103
103
|
- vtweb_json.gemspec
|
104
|
-
homepage: https://github.com/panggi/
|
104
|
+
homepage: https://github.com/panggi/vtweb_json
|
105
105
|
licenses:
|
106
106
|
- MIT
|
107
107
|
metadata: {}
|