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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e66de4bf40938c927cad3f852b531ce3594dd7b
4
- data.tar.gz: be7ecf7bec78f0ca37a2a2a58ad40d9058065608
3
+ metadata.gz: 92dbeec3f0d230f305557b9e45555ffdd7134842
4
+ data.tar.gz: 82389fbde67ca04815e945c0a829378aaa1283e5
5
5
  SHA512:
6
- metadata.gz: a81320f9328f1913a3a3af8149ebe1f62b7f4c8337b64226266a42820e82433eb2344b435432cb3eb42b278b889145df4623f993adb7ec638de68764b52e550d
7
- data.tar.gz: 6b7af6f5761f974d99547d9bd961b6e4084b662828a313d583e492dc630a0c2536f97ea0830062f2c172f4c8769d4cca3340f0d0f77e9514bdab39c866bd713a
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.item = params["item"]
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[:shipping_first_name]
65
- client.last_name = params[:shipping_last_name]
66
- client.address1 = params[:shipping_address1]
67
- client.address2 = params[:shipping_address2]
68
- client.city = params[:shipping_city]
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[:shipping_postal_code]
71
- client.phone = params[:shipping_phone]
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 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 :
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.merchant_id %>">
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, :item
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
- self.item.each do |item|
79
- json.item_id [item['item_id']]
80
- json.item_name1 [item['item_name1']]
81
- json.item_name2 [item['item_name2']]
82
- json.price [item['price']]
83
- json.quantity [item['quantity']]
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
@@ -1,3 +1,3 @@
1
1
  module VtwebJson
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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/vtweb-json"
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.2
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/vtweb-json
104
+ homepage: https://github.com/panggi/vtweb_json
105
105
  licenses:
106
106
  - MIT
107
107
  metadata: {}