veritrans 2.1.2 → 2.1.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: 8b3d6c35a692b27c7bf8e73cdc3842462ff4f2e4
4
- data.tar.gz: eba6c6db6e039e048df4e77c288c371c7add0d0b
3
+ metadata.gz: c610e190c04bc6be296adf2fe3d4b5ad00009872
4
+ data.tar.gz: 19375928d04af1fef395e20df335910f621ec9a9
5
5
  SHA512:
6
- metadata.gz: db7c2b13c948249ca67d09201dc28024dbc62e07217e3808ccb8abd64017b074eeddf0c0a53895911f10e1a7c4d26355383f35ea00b11f169fddda95c0e953f2
7
- data.tar.gz: 59170815eb3b50e4532fd74943cb55a4b8be14a64f6db49cc4785d972d6119b52dbda5dfae8ea944f1a2120b7a43f3624cb22b429fdd4a317193e7c4740df387
6
+ metadata.gz: 9e83f571dc75053a9cd0d254202cbef175c045ad9477af7ea94480e77c31f317631cf377b512ac9a4e2d9f88d15270958fb24294f7195c8265899a3536a68d67
7
+ data.tar.gz: 8593be4707141266a9d55dbd8599242d5e8153b04d8ad7b985a71aa7358a620cb61c04c63c32b8765513eb86c1aad2e2f9208af5cfc23c1db713d743475ca831
data/example/sinatra.rb CHANGED
@@ -55,7 +55,7 @@ get "/widget" do
55
55
  gross_amount: 30_000
56
56
  }
57
57
  )
58
- @token_id = response.data[:token_id]
58
+ @token = response.data[:token]
59
59
  erb :widget
60
60
  end
61
61
 
data/example/widget.erb CHANGED
@@ -18,20 +18,20 @@
18
18
 
19
19
  <section>
20
20
  <p>
21
- <label>Token ID</label>
22
- <input type="text" id="token_id" value="<%= @token_id %>" readonly>
21
+ <label>Snap Token</label>
22
+ <input type="text" id="token" value="<%= @token %>" readonly>
23
23
  </p>
24
24
  <button id="snap_pay">Pay Now</button>
25
25
  </section>
26
26
  </section>
27
27
 
28
- <script src="https://app.sandbox.veritrans.co.id/snap/snap.js"></script>
28
+ <script src="https://app.sandbox.midtrans.com/snap/snap.js"></script>
29
29
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
30
30
 
31
31
  <script type="text/javascript">
32
32
  $('#snap_pay').on('click', function (e) {
33
33
  e.preventDefault();
34
- snap.pay($('#token_id').val() + "?locale=en", {
34
+ snap.pay($('#token').val() + "?locale=en", {
35
35
  onSuccess: function (res) {
36
36
  console.log('onSuccess', res);
37
37
  alert(res.status_message + "\nRedirecting to confirm page...");
data/lib/veritrans/api.rb CHANGED
@@ -46,9 +46,9 @@ class Veritrans
46
46
  request_with_logging(:post, config.api_host + "/v2/charge", data)
47
47
  end
48
48
 
49
- # POST https://app.sandbox.veritrans.co.id/snap/v1/charge
49
+ # POST https://app.sandbox.veritrans.co.id/snap/v1/transactions
50
50
  def create_snap_token(options = {})
51
- result = request_with_logging(:post, config.api_host.sub('//api.', '//app.') + "/snap/v1/charge", options)
51
+ result = request_with_logging(:post, config.api_host.sub('//api.', '//app.') + "/snap/v1/transactions", options)
52
52
  Veritrans::SnapResult.new(result.response, result.url, result.request_options, result.time)
53
53
  end
54
54
 
@@ -126,4 +126,4 @@ class Veritrans
126
126
  alias_method :point_inquiry, :inquiry_points
127
127
 
128
128
  end
129
- end
129
+ end
@@ -92,11 +92,11 @@ class Veritrans
92
92
  end
93
93
 
94
94
  def token_id
95
- @data[:token_id]
95
+ @data[:token]
96
96
  end
97
97
 
98
98
  def success?
99
- status_code == 200
99
+ status_code == 201
100
100
  end
101
101
  end
102
- end
102
+ end
@@ -1,3 +1,3 @@
1
1
  class Veritrans
2
- VERSION = "2.1.2"
2
+ VERSION = "2.1.3"
3
3
  end
@@ -232,7 +232,7 @@ development:
232
232
  visit "/payments/new"
233
233
  click_link "Pay via VT-Web"
234
234
 
235
- page.should have_content("Payment is securely processed by Veritrans")
235
+ page.should have_content("Payment is securely processed by Midtrans")
236
236
  #Capybara::Screenshot.screenshot_and_open_image
237
237
 
238
238
  # TEST CALLBACK FOR WRONG DATA
@@ -32,8 +32,8 @@ describe Veritrans::Config do
32
32
 
33
33
  response.should be_a(Veritrans::SnapResult)
34
34
  response.success?.should be_truthy
35
- response.token_id.should be_present
36
- response.token_id.should == response.data[:token_id]
37
- response.inspect.should =~ /#<Veritrans::SnapResult:\d+ \^\^ status: 200 time: \d+ms \^\^ data: \{token_id: "[\da-f\-]+"\}>/
35
+ response.token.should be_present
36
+ response.token.should == response.data[:token]
37
+ response.inspect.should =~ /#<Veritrans::SnapResult:\d+ \^\^ status: 201 time: \d+ms \^\^ data: \{token: "[\da-f\-]+"\}>/
38
38
  end
39
- end
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veritrans
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Veritrans Dev Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-20 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  requirements: []
206
206
  rubyforge_project:
207
- rubygems_version: 2.6.6
207
+ rubygems_version: 2.5.1
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: Veritrans ruby library