vtweb 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -39
- data/lib/vtweb/post_params.rb +1 -0
- data/lib/vtweb/version.rb +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: 72f7a529370d37292f2965846e5e807e48440e57
|
4
|
+
data.tar.gz: f3fb79c68b7cecd8b7c5f61c1f03411f0dec27a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f856294ede43a3a22340dd70df4f313afd7887507150b9efa1af765c5cf2f9bb793b2426b3e0916c428c0293a78178f9e82e9c0eb23c77cb69a1937488c6bcd
|
7
|
+
data.tar.gz: 74f0c8ba62dd8bec8a1c10f79abbb8d0386306c4718f9fe8761c7cc35d5afcf05d57b12dc8e5a97bedd7df8155a49d12394d95e76cafd45aed5c32ac9573f369
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Veritrans VT-Web Ruby
|
1
|
+
# Veritrans VT-Web Ruby wrapper
|
2
2
|
|
3
|
-
Ruby Wrapper for Veritrans VT-Web. Visit https://www.veritrans.co.id for more information about the product and see documentation at http://veritrans.
|
3
|
+
Ruby Wrapper for Veritrans VT-Web. Visit https://www.veritrans.co.id for more information about the product and see documentation at http://docs.veritrans.co.id/vtweb/index.html for more technical details.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -31,7 +31,7 @@ In your Rails app, create 'vtweb.yml' at config directory (config/vtweb.yml) wit
|
|
31
31
|
production:
|
32
32
|
merchant_id: "A100000000000001XXXXXX"
|
33
33
|
merchant_hash_key: "yourmerchanthashkey"
|
34
|
-
unfinish_payment_return_url: "http://yourweb.com/"
|
34
|
+
unfinish_payment_return_url: "http://yourweb.com/canceled"
|
35
35
|
finish_payment_return_url: "http://yourweb.com/thank_you"
|
36
36
|
error_payment_return_url: "http://yourweb.com/shop_again"
|
37
37
|
|
@@ -59,47 +59,44 @@ In your controller, create a method to use the gem. I took the code from https:/
|
|
59
59
|
"item_name1" => item.product.name, "item_name2" => item.product.name }
|
60
60
|
end
|
61
61
|
|
62
|
-
|
63
|
-
client.item
|
64
|
-
|
65
|
-
client.
|
66
|
-
client.
|
67
|
-
|
68
|
-
client.
|
69
|
-
client.
|
70
|
-
client.
|
71
|
-
client.
|
72
|
-
client.
|
73
|
-
client.
|
74
|
-
client.
|
75
|
-
client.
|
76
|
-
|
77
|
-
client.
|
78
|
-
client.
|
79
|
-
client.
|
80
|
-
client.
|
81
|
-
client.
|
82
|
-
client.
|
83
|
-
client.shipping_postal_code = params[:shipping_postal_code]
|
84
|
-
client.shipping_phone = params[:shipping_phone]
|
62
|
+
client.gross_amount = Cart.select(:sub_total).sum(:sub_total).to_s
|
63
|
+
client.item = params["item"]
|
64
|
+
client.billing_different_with_shipping = 1
|
65
|
+
client.required_shipping_address = 1
|
66
|
+
client.first_name = params[:shipping_first_name]
|
67
|
+
client.last_name = params[:shipping_last_name]
|
68
|
+
client.address1 = params[:shipping_address1]
|
69
|
+
client.address2 = params[:shipping_address2]
|
70
|
+
client.city = params[:shipping_city]
|
71
|
+
client.country_code = "IDN"
|
72
|
+
client.postal_code = params[:shipping_postal_code]
|
73
|
+
client.phone = params[:shipping_phone]
|
74
|
+
client.shipping_first_name = params[:shipping_first_name]
|
75
|
+
client.shipping_last_name = params[:shipping_last_name]
|
76
|
+
client.shipping_address1 = params[:shipping_address1]
|
77
|
+
client.shipping_address2 = params[:shipping_address2]
|
78
|
+
client.shipping_city = params[:shipping_city]
|
79
|
+
client.shipping_country_code = "IDN"
|
80
|
+
client.shipping_postal_code = params[:shipping_postal_code]
|
81
|
+
client.shipping_phone = params[:shipping_phone]
|
82
|
+
client.email = params[:email]
|
85
83
|
|
86
|
-
|
87
|
-
|
88
|
-
client.
|
89
|
-
client.
|
90
|
-
client.
|
91
|
-
client.
|
92
|
-
client.
|
93
|
-
client.
|
94
|
-
client.
|
95
|
-
client.payment_methods = ["credit_card","mandiri_clickpay"]
|
84
|
+
# Payment Options
|
85
|
+
client.promo_bins = ['411111', '510510']
|
86
|
+
client.payment_type = '01' #deprecated
|
87
|
+
client.enable_3d_secure = 1
|
88
|
+
client.installment_banks = ['bni', 'cimb', 'mandiri']
|
89
|
+
client.installment_terms = { bni: ['3','12','2'], cimb: ['3', '6', '12'] }
|
90
|
+
client.point_banks = ['cimb', 'bni']
|
91
|
+
client.bank = 'bni'
|
92
|
+
client.payment_methods = ['credit_card', 'mandiri_clickpay']
|
96
93
|
|
97
94
|
client.get_keys
|
98
95
|
@client = client
|
99
96
|
render :layout => 'application'
|
100
97
|
end
|
101
98
|
|
102
|
-
After you get TOKEN_BROWSER and TOKEN_MERCHANT, post merchant_id, order_id and TOKEN_BROWSER to redirection url of vtweb. This code
|
99
|
+
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 :
|
103
100
|
|
104
101
|
<h1 align="center">Confirm Purchase Items</h1>
|
105
102
|
|
@@ -108,7 +105,7 @@ After you get TOKEN_BROWSER and TOKEN_MERCHANT, post merchant_id, order_id and T
|
|
108
105
|
<input type="hidden" name="order_id" value="<%= @client.order_id %>">
|
109
106
|
<input type="hidden" name="token_browser" value="<%= @client.token["TOKEN_BROWSER"] %>">
|
110
107
|
<table border="1" align="center" width="80%" cellpadding="10" bgcolor="#FFFFCC">
|
111
|
-
|
108
|
+
<tr>
|
112
109
|
<th>Name</th>
|
113
110
|
<th>Price</th>
|
114
111
|
<th>Quantity</th>
|
@@ -117,7 +114,7 @@ After you get TOKEN_BROWSER and TOKEN_MERCHANT, post merchant_id, order_id and T
|
|
117
114
|
|
118
115
|
<% for cart in @carts %>
|
119
116
|
<tr>
|
120
|
-
|
117
|
+
<td><%= cart.product.name %></td>
|
121
118
|
<td><%= cart.product.price %></td>
|
122
119
|
<td><%= cart.quantity %></td>
|
123
120
|
<td><%= cart.sub_total %></td>
|
data/lib/vtweb/post_params.rb
CHANGED
data/lib/vtweb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vtweb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Panggi Libersa Jasri Akadol
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|