veritrans 2.1.1 → 2.1.2
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/Gemfile.lock +2 -2
- data/bin/midtrans +3 -0
- data/example/widget.erb +0 -1
- data/lib/veritrans.rb +2 -0
- data/lib/veritrans/version.rb +1 -1
- data/spec/fixtures/midtrans_status.yml +117 -0
- data/spec/midtrans_rename_spec.rb +27 -0
- data/veritrans.gemspec +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b3d6c35a692b27c7bf8e73cdc3842462ff4f2e4
|
|
4
|
+
data.tar.gz: eba6c6db6e039e048df4e77c288c371c7add0d0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db7c2b13c948249ca67d09201dc28024dbc62e07217e3808ccb8abd64017b074eeddf0c0a53895911f10e1a7c4d26355383f35ea00b11f169fddda95c0e953f2
|
|
7
|
+
data.tar.gz: 59170815eb3b50e4532fd74943cb55a4b8be14a64f6db49cc4785d972d6119b52dbda5dfae8ea944f1a2120b7a43f3624cb22b429fdd4a317193e7c4740df387
|
data/Gemfile.lock
CHANGED
|
@@ -13,7 +13,7 @@ GIT
|
|
|
13
13
|
PATH
|
|
14
14
|
remote: .
|
|
15
15
|
specs:
|
|
16
|
-
veritrans (2.1.
|
|
16
|
+
veritrans (2.1.2)
|
|
17
17
|
excon (~> 0.20)
|
|
18
18
|
|
|
19
19
|
GEM
|
|
@@ -72,7 +72,7 @@ GEM
|
|
|
72
72
|
safe_yaml (~> 1.0.0)
|
|
73
73
|
diff-lcs (1.2.5)
|
|
74
74
|
erubis (2.7.0)
|
|
75
|
-
excon (0.
|
|
75
|
+
excon (0.53.0)
|
|
76
76
|
globalid (0.3.7)
|
|
77
77
|
activesupport (>= 4.1.0)
|
|
78
78
|
hashdiff (0.3.0)
|
data/bin/midtrans
ADDED
data/example/widget.erb
CHANGED
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
$('#snap_pay').on('click', function (e) {
|
|
33
33
|
e.preventDefault();
|
|
34
34
|
snap.pay($('#token_id').val() + "?locale=en", {
|
|
35
|
-
env: 'sandbox',
|
|
36
35
|
onSuccess: function (res) {
|
|
37
36
|
console.log('onSuccess', res);
|
|
38
37
|
alert(res.status_message + "\nRedirecting to confirm page...");
|
data/lib/veritrans.rb
CHANGED
data/lib/veritrans/version.rb
CHANGED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://api.sandbox.veritrans.co.id/v2/charge
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"payment_type":"permata","transaction_details":{"order_id":"2016-10-20
|
|
9
|
+
12:39:16 +0700","gross_amount":100000}}'
|
|
10
|
+
headers:
|
|
11
|
+
User-Agent:
|
|
12
|
+
- Veritrans ruby gem 2.1.2
|
|
13
|
+
Authorization:
|
|
14
|
+
- Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
|
|
15
|
+
Accept:
|
|
16
|
+
- application/json
|
|
17
|
+
Content-Type:
|
|
18
|
+
- application/json
|
|
19
|
+
response:
|
|
20
|
+
status:
|
|
21
|
+
code: 200
|
|
22
|
+
message: ''
|
|
23
|
+
headers:
|
|
24
|
+
Server:
|
|
25
|
+
- nginx
|
|
26
|
+
Date:
|
|
27
|
+
- Thu, 20 Oct 2016 05:39:18 GMT
|
|
28
|
+
Content-Type:
|
|
29
|
+
- application/json
|
|
30
|
+
Content-Length:
|
|
31
|
+
- '425'
|
|
32
|
+
Connection:
|
|
33
|
+
- keep-alive
|
|
34
|
+
Cache-Control:
|
|
35
|
+
- no-cache
|
|
36
|
+
Pragma:
|
|
37
|
+
- no-cache
|
|
38
|
+
Expires:
|
|
39
|
+
- Wed, 31 Dec 1969 17:00:00 GMT
|
|
40
|
+
Strict-Transport-Security:
|
|
41
|
+
- max-age=63072000; includeSubdomains; preload
|
|
42
|
+
body:
|
|
43
|
+
encoding: ASCII-8BIT
|
|
44
|
+
string: |-
|
|
45
|
+
{
|
|
46
|
+
"status_code" : "201",
|
|
47
|
+
"status_message" : "Success, PERMATA VA transaction is successful",
|
|
48
|
+
"transaction_id" : "365ea37f-db35-4b24-9a93-b1fa3fde4780",
|
|
49
|
+
"order_id" : "2016-10-20 12:39:16 +0700",
|
|
50
|
+
"gross_amount" : "100000.00",
|
|
51
|
+
"payment_type" : "bank_transfer",
|
|
52
|
+
"transaction_time" : "2016-10-20 12:39:12",
|
|
53
|
+
"transaction_status" : "pending",
|
|
54
|
+
"fraud_status" : "accept",
|
|
55
|
+
"permata_va_number" : "8778006742354093"
|
|
56
|
+
}
|
|
57
|
+
http_version:
|
|
58
|
+
recorded_at: Thu, 20 Oct 2016 05:39:18 GMT
|
|
59
|
+
- request:
|
|
60
|
+
method: get
|
|
61
|
+
uri: https://api.sandbox.veritrans.co.id/v2/2016-10-20%2012:39:16%20+0700/status
|
|
62
|
+
body:
|
|
63
|
+
encoding: US-ASCII
|
|
64
|
+
string: ''
|
|
65
|
+
headers:
|
|
66
|
+
User-Agent:
|
|
67
|
+
- Veritrans ruby gem 2.1.2
|
|
68
|
+
Authorization:
|
|
69
|
+
- Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
|
|
70
|
+
Accept:
|
|
71
|
+
- application/json
|
|
72
|
+
Content-Type:
|
|
73
|
+
- application/json
|
|
74
|
+
response:
|
|
75
|
+
status:
|
|
76
|
+
code: 200
|
|
77
|
+
message: ''
|
|
78
|
+
headers:
|
|
79
|
+
Server:
|
|
80
|
+
- nginx
|
|
81
|
+
Date:
|
|
82
|
+
- Thu, 20 Oct 2016 05:39:18 GMT
|
|
83
|
+
Content-Type:
|
|
84
|
+
- application/json
|
|
85
|
+
Content-Length:
|
|
86
|
+
- '561'
|
|
87
|
+
Connection:
|
|
88
|
+
- keep-alive
|
|
89
|
+
Cache-Control:
|
|
90
|
+
- no-cache
|
|
91
|
+
Pragma:
|
|
92
|
+
- no-cache
|
|
93
|
+
Expires:
|
|
94
|
+
- Wed, 31 Dec 1969 17:00:00 GMT
|
|
95
|
+
Vary:
|
|
96
|
+
- Accept-Encoding, User-Agent
|
|
97
|
+
Strict-Transport-Security:
|
|
98
|
+
- max-age=63072000; includeSubdomains; preload
|
|
99
|
+
body:
|
|
100
|
+
encoding: ASCII-8BIT
|
|
101
|
+
string: |-
|
|
102
|
+
{
|
|
103
|
+
"status_code" : "201",
|
|
104
|
+
"status_message" : "Success, transaction is found",
|
|
105
|
+
"transaction_id" : "365ea37f-db35-4b24-9a93-b1fa3fde4780",
|
|
106
|
+
"order_id" : "2016-10-20 12:39:16 +0700",
|
|
107
|
+
"gross_amount" : "100000.00",
|
|
108
|
+
"payment_type" : "bank_transfer",
|
|
109
|
+
"transaction_time" : "2016-10-20 12:39:12",
|
|
110
|
+
"transaction_status" : "pending",
|
|
111
|
+
"fraud_status" : "accept",
|
|
112
|
+
"permata_va_number" : "8778006742354093",
|
|
113
|
+
"signature_key" : "bbdb81aead6f9262e6c184fa4fabf615189e92619c654895b8adee538bd1b1100688bc54fd3fd5b26a78ef56175cd5946daefcea41e5fe0abd575c60d9f196fd"
|
|
114
|
+
}
|
|
115
|
+
http_version:
|
|
116
|
+
recorded_at: Thu, 20 Oct 2016 05:39:18 GMT
|
|
117
|
+
recorded_with: VCR 3.0.3
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
describe Veritrans::Client do
|
|
2
|
+
|
|
3
|
+
before do
|
|
4
|
+
hide_const("Rails")
|
|
5
|
+
Midtrans.logger = Logger.new("/dev/null")
|
|
6
|
+
Midtrans.setup do
|
|
7
|
+
config.load_config "./spec/configs/real_key.yml"
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it "should create alias constant for Midtrans" do
|
|
12
|
+
Midtrans.should == Veritrans
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should work with Midtrans" do
|
|
16
|
+
VCR.use_cassette('midtrans_status') do
|
|
17
|
+
txn_result = Veritrans.charge("permata", transaction: { order_id: Time.now.to_s, gross_amount: 100_000 })
|
|
18
|
+
txn_result.success?.should == true
|
|
19
|
+
txn_result.status_message.should == "Success, PERMATA VA transaction is successful"
|
|
20
|
+
|
|
21
|
+
cancel_result = Midtrans.status(txn_result.order_id)
|
|
22
|
+
cancel_result.success?.should == true
|
|
23
|
+
cancel_result.status_message.should == "Success, transaction is found"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
data/veritrans.gemspec
CHANGED
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.2
|
|
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-10-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: excon
|
|
@@ -105,6 +105,7 @@ email:
|
|
|
105
105
|
- dev@veritrans.co.id
|
|
106
106
|
executables:
|
|
107
107
|
- veritrans
|
|
108
|
+
- midtrans
|
|
108
109
|
extensions: []
|
|
109
110
|
extra_rdoc_files: []
|
|
110
111
|
files:
|
|
@@ -118,6 +119,7 @@ files:
|
|
|
118
119
|
- README.md
|
|
119
120
|
- Rakefile
|
|
120
121
|
- api_reference.md
|
|
122
|
+
- bin/midtrans
|
|
121
123
|
- bin/veritrans
|
|
122
124
|
- example/README.md
|
|
123
125
|
- example/config.ru
|
|
@@ -169,8 +171,10 @@ files:
|
|
|
169
171
|
- spec/fixtures/events_test_real_txn.yml
|
|
170
172
|
- spec/fixtures/expire_failed.yml
|
|
171
173
|
- spec/fixtures/expire_success.yml
|
|
174
|
+
- spec/fixtures/midtrans_status.yml
|
|
172
175
|
- spec/fixtures/status_fail.yml
|
|
173
176
|
- spec/fixtures/status_success.yml
|
|
177
|
+
- spec/midtrans_rename_spec.rb
|
|
174
178
|
- spec/rails_plugin_spec.rb
|
|
175
179
|
- spec/spec_helper.rb
|
|
176
180
|
- spec/veritrans_client_spec.rb
|