veritrans 2.1.2 → 2.1.3
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/example/sinatra.rb +1 -1
- data/example/widget.erb +4 -4
- data/lib/veritrans/api.rb +3 -3
- data/lib/veritrans/result.rb +3 -3
- data/lib/veritrans/version.rb +1 -1
- data/spec/rails_plugin_spec.rb +1 -1
- data/spec/veritrans_snap_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c610e190c04bc6be296adf2fe3d4b5ad00009872
|
4
|
+
data.tar.gz: 19375928d04af1fef395e20df335910f621ec9a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e83f571dc75053a9cd0d254202cbef175c045ad9477af7ea94480e77c31f317631cf377b512ac9a4e2d9f88d15270958fb24294f7195c8265899a3536a68d67
|
7
|
+
data.tar.gz: 8593be4707141266a9d55dbd8599242d5e8153b04d8ad7b985a71aa7358a620cb61c04c63c32b8765513eb86c1aad2e2f9208af5cfc23c1db713d743475ca831
|
data/example/sinatra.rb
CHANGED
data/example/widget.erb
CHANGED
@@ -18,20 +18,20 @@
|
|
18
18
|
|
19
19
|
<section>
|
20
20
|
<p>
|
21
|
-
<label>Token
|
22
|
-
<input type="text" id="
|
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.
|
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($('#
|
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/
|
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/
|
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
|
data/lib/veritrans/result.rb
CHANGED
data/lib/veritrans/version.rb
CHANGED
data/spec/rails_plugin_spec.rb
CHANGED
@@ -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
|
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
|
data/spec/veritrans_snap_spec.rb
CHANGED
@@ -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.
|
36
|
-
response.
|
37
|
-
response.inspect.should =~ /#<Veritrans::SnapResult:\d+ \^\^ status:
|
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.
|
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-
|
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.
|
207
|
+
rubygems_version: 2.5.1
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: Veritrans ruby library
|