veritrans 2.2.0 → 2.3.0
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 +5 -5
- data/.rubocop.yml +35 -0
- data/.travis.yml +11 -5
- data/CHANGELOG.md +12 -0
- data/Gemfile +14 -6
- data/Gemfile.lock +131 -109
- data/README.md +46 -24
- data/api_reference.md +85 -3
- data/lib/generators/templates/payments_controller.rb +1 -1
- data/lib/generators/templates/views/_credit_card_form.erb +1 -1
- data/lib/veritrans.rb +15 -6
- data/lib/veritrans/api.rb +33 -6
- data/lib/veritrans/client.rb +1 -1
- data/lib/veritrans/result.rb +5 -0
- data/lib/veritrans/testing.rb +1 -1
- data/lib/veritrans/version.rb +1 -1
- data/spec/fixtures/cancel_failed.yml +18 -18
- data/spec/fixtures/cancel_success.yml +48 -28
- data/spec/fixtures/deny_failed.yml +144 -0
- data/spec/fixtures/refund_failed.yml +54 -0
- data/spec/fixtures/status_fail.yml +19 -17
- data/spec/fixtures/status_success.yml +51 -32
- data/spec/fixtures/test_token.yml +49 -0
- data/spec/rails_plugin_spec.rb +105 -86
- data/spec/spec_helper.rb +18 -7
- data/spec/veritrans_client_spec.rb +60 -9
- data/spec/veritrans_snap_spec.rb +17 -2
- data/veritrans.gemspec +0 -6
- metadata +7 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 198c28438ceb828b7c7d7e84d3211ef6f60311a9b9433a31de193bdc61f024f0
|
4
|
+
data.tar.gz: 12bb67253165bb466ecb48c8a72fb59df99c3d81f9b6fc7dd0b3a6aa7040ea23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c46fc675f2ce31f1ad0c9737ec0c19a6306b6fa1e765db4fa8e55f5123ccd626d2d726b8bb09a0b672b59cbfe36185adb07063c80e0b9f4f7803f910e43c21c
|
7
|
+
data.tar.gz: ecb2db780ad8ff7a3e832148a04496ce72a7f46c4a97cda597cd02c5b423a39a3583fe775753a8eb70183d5d01b2a7d0da303b30d5ed716d13cddae499070bc2
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
Rails:
|
2
|
+
Enabled: true
|
3
|
+
|
4
|
+
Metrics/MethodLength:
|
5
|
+
Max: 100
|
6
|
+
|
7
|
+
Metrics/AbcSize:
|
8
|
+
Max: 40
|
9
|
+
|
10
|
+
Metrics/CyclomaticComplexity:
|
11
|
+
Max: 10
|
12
|
+
|
13
|
+
Metrics/PerceivedComplexity:
|
14
|
+
Max: 10
|
15
|
+
|
16
|
+
Metrics/ClassLength:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Metrics/BlockLength:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Metrics/LineLength:
|
23
|
+
Max: 120
|
24
|
+
|
25
|
+
Metrics/ModuleLength:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Rails/CreateTableWithTimestamps:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/FrozenStringLiteralComment:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/Documentation:
|
35
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
|
+
|
3
4
|
env:
|
4
|
-
- DEBUG=1
|
5
|
+
# - DEBUG=1
|
6
|
+
|
7
|
+
before_install:
|
8
|
+
- gem install bundler -v '1.17.3' --no-doc
|
5
9
|
|
6
|
-
script:
|
10
|
+
script:
|
11
|
+
- bundle exec rspec
|
7
12
|
|
8
13
|
rvm:
|
9
|
-
- 2.
|
10
|
-
- 2.
|
11
|
-
- 2.
|
14
|
+
- 2.3.8
|
15
|
+
- 2.4.6
|
16
|
+
- 2.5.5
|
17
|
+
- 2.6.2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### Version 2.3.0 (date 1 April 2019)
|
2
|
+
|
3
|
+
* Add refund, deny, and test_token methods (Thank to @christianmkuss)
|
4
|
+
* Remove logging of server key
|
5
|
+
|
6
|
+
### Version 2.2.1 (date 30 May 2018)
|
7
|
+
|
8
|
+
* Update assertion message value
|
9
|
+
* Add alias method create_snap_redirect_url
|
10
|
+
* add redirect_url accessor in SnapResult
|
11
|
+
* Improve some wordings and examples in README.md
|
12
|
+
|
1
13
|
### Version 2.2.0 (date 08 May 2017)
|
2
14
|
|
3
15
|
* Change default endpoint to *.midtrans.com
|
data/Gemfile
CHANGED
@@ -1,12 +1,20 @@
|
|
1
|
-
source
|
2
|
-
|
3
|
-
gem 'rake'
|
4
|
-
gem 'rspec'
|
1
|
+
source 'https://rubygems.org'
|
5
2
|
|
3
|
+
gem 'puma'
|
6
4
|
gem 'rails', '< 6'
|
7
|
-
|
5
|
+
gem 'rake'
|
8
6
|
gem 'sinatra'
|
9
|
-
gem 'puma'
|
10
7
|
gem 'tilt'
|
8
|
+
gem 'sqlite3'
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem 'capybara', '~> 3.15.0' # for ruby 2.3 support
|
12
|
+
gem 'capybara-screenshot'
|
13
|
+
gem 'poltergeist', '~> 1.8'
|
14
|
+
gem 'rspec', '~> 3.4'
|
15
|
+
gem 'vcr', '~> 4.0'
|
16
|
+
gem 'webmock', '>= 1.20'
|
17
|
+
gem 'timecop'
|
18
|
+
end
|
11
19
|
|
12
20
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,176 +1,198 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
veritrans (2.
|
4
|
+
veritrans (2.3.0)
|
5
5
|
excon (~> 0.20)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (5.
|
11
|
-
actionpack (= 5.
|
10
|
+
actioncable (5.2.3)
|
11
|
+
actionpack (= 5.2.3)
|
12
12
|
nio4r (~> 2.0)
|
13
|
-
websocket-driver (
|
14
|
-
actionmailer (5.
|
15
|
-
actionpack (= 5.
|
16
|
-
actionview (= 5.
|
17
|
-
activejob (= 5.
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailer (5.2.3)
|
15
|
+
actionpack (= 5.2.3)
|
16
|
+
actionview (= 5.2.3)
|
17
|
+
activejob (= 5.2.3)
|
18
18
|
mail (~> 2.5, >= 2.5.4)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.
|
21
|
-
actionview (= 5.
|
22
|
-
activesupport (= 5.
|
20
|
+
actionpack (5.2.3)
|
21
|
+
actionview (= 5.2.3)
|
22
|
+
activesupport (= 5.2.3)
|
23
23
|
rack (~> 2.0)
|
24
|
-
rack-test (
|
24
|
+
rack-test (>= 0.6.3)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.
|
28
|
-
activesupport (= 5.
|
27
|
+
actionview (5.2.3)
|
28
|
+
activesupport (= 5.2.3)
|
29
29
|
builder (~> 3.1)
|
30
30
|
erubi (~> 1.4)
|
31
31
|
rails-dom-testing (~> 2.0)
|
32
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.
|
34
|
-
activesupport (= 5.
|
33
|
+
activejob (5.2.3)
|
34
|
+
activesupport (= 5.2.3)
|
35
35
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.
|
37
|
-
activesupport (= 5.
|
38
|
-
activerecord (5.
|
39
|
-
activemodel (= 5.
|
40
|
-
activesupport (= 5.
|
41
|
-
arel (
|
42
|
-
|
36
|
+
activemodel (5.2.3)
|
37
|
+
activesupport (= 5.2.3)
|
38
|
+
activerecord (5.2.3)
|
39
|
+
activemodel (= 5.2.3)
|
40
|
+
activesupport (= 5.2.3)
|
41
|
+
arel (>= 9.0)
|
42
|
+
activestorage (5.2.3)
|
43
|
+
actionpack (= 5.2.3)
|
44
|
+
activerecord (= 5.2.3)
|
45
|
+
marcel (~> 0.3.1)
|
46
|
+
activesupport (5.2.3)
|
43
47
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
44
|
-
i18n (
|
48
|
+
i18n (>= 0.7, < 2)
|
45
49
|
minitest (~> 5.1)
|
46
50
|
tzinfo (~> 1.1)
|
47
|
-
addressable (2.
|
48
|
-
public_suffix (
|
49
|
-
arel (
|
51
|
+
addressable (2.6.0)
|
52
|
+
public_suffix (>= 2.0.2, < 4.0)
|
53
|
+
arel (9.0.0)
|
50
54
|
builder (3.2.3)
|
51
|
-
capybara (
|
55
|
+
capybara (3.15.0)
|
52
56
|
addressable
|
53
|
-
|
54
|
-
nokogiri (
|
55
|
-
rack (>= 1.
|
56
|
-
rack-test (>= 0.
|
57
|
-
|
57
|
+
mini_mime (>= 0.1.3)
|
58
|
+
nokogiri (~> 1.8)
|
59
|
+
rack (>= 1.6.0)
|
60
|
+
rack-test (>= 0.6.3)
|
61
|
+
regexp_parser (~> 1.2)
|
62
|
+
xpath (~> 3.2)
|
63
|
+
capybara-screenshot (1.0.22)
|
64
|
+
capybara (>= 1.0, < 4)
|
65
|
+
launchy
|
58
66
|
cliver (0.3.2)
|
59
|
-
concurrent-ruby (1.
|
67
|
+
concurrent-ruby (1.1.5)
|
60
68
|
crack (0.4.3)
|
61
69
|
safe_yaml (~> 1.0.0)
|
70
|
+
crass (1.0.4)
|
62
71
|
diff-lcs (1.3)
|
63
|
-
erubi (1.
|
64
|
-
excon (0.
|
65
|
-
globalid (0.4.
|
72
|
+
erubi (1.8.0)
|
73
|
+
excon (0.62.0)
|
74
|
+
globalid (0.4.2)
|
66
75
|
activesupport (>= 4.2.0)
|
67
|
-
hashdiff (0.3.
|
68
|
-
i18n (
|
69
|
-
|
76
|
+
hashdiff (0.3.8)
|
77
|
+
i18n (1.6.0)
|
78
|
+
concurrent-ruby (~> 1.0)
|
79
|
+
launchy (2.4.3)
|
80
|
+
addressable (~> 2.3)
|
81
|
+
loofah (2.2.3)
|
82
|
+
crass (~> 1.0.2)
|
70
83
|
nokogiri (>= 1.5.9)
|
71
|
-
mail (2.
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
84
|
+
mail (2.7.1)
|
85
|
+
mini_mime (>= 0.1.1)
|
86
|
+
marcel (0.3.3)
|
87
|
+
mimemagic (~> 0.3.2)
|
88
|
+
method_source (0.9.2)
|
89
|
+
mimemagic (0.3.3)
|
90
|
+
mini_mime (1.0.1)
|
91
|
+
mini_portile2 (2.4.0)
|
92
|
+
minitest (5.11.3)
|
93
|
+
mustermann (1.0.3)
|
94
|
+
nio4r (2.3.1)
|
95
|
+
nokogiri (1.10.2)
|
96
|
+
mini_portile2 (~> 2.4.0)
|
97
|
+
poltergeist (1.18.1)
|
98
|
+
capybara (>= 2.1, < 4)
|
85
99
|
cliver (~> 0.3.1)
|
86
100
|
websocket-driver (>= 0.2.0)
|
87
|
-
public_suffix (
|
88
|
-
puma (3.
|
89
|
-
rack (2.0.
|
90
|
-
rack-protection (2.0.
|
101
|
+
public_suffix (3.0.3)
|
102
|
+
puma (3.12.1)
|
103
|
+
rack (2.0.7)
|
104
|
+
rack-protection (2.0.5)
|
91
105
|
rack
|
92
|
-
rack-test (
|
93
|
-
rack (>= 1.0)
|
94
|
-
rails (5.
|
95
|
-
actioncable (= 5.
|
96
|
-
actionmailer (= 5.
|
97
|
-
actionpack (= 5.
|
98
|
-
actionview (= 5.
|
99
|
-
activejob (= 5.
|
100
|
-
activemodel (= 5.
|
101
|
-
activerecord (= 5.
|
102
|
-
|
103
|
-
|
104
|
-
|
106
|
+
rack-test (1.1.0)
|
107
|
+
rack (>= 1.0, < 3)
|
108
|
+
rails (5.2.3)
|
109
|
+
actioncable (= 5.2.3)
|
110
|
+
actionmailer (= 5.2.3)
|
111
|
+
actionpack (= 5.2.3)
|
112
|
+
actionview (= 5.2.3)
|
113
|
+
activejob (= 5.2.3)
|
114
|
+
activemodel (= 5.2.3)
|
115
|
+
activerecord (= 5.2.3)
|
116
|
+
activestorage (= 5.2.3)
|
117
|
+
activesupport (= 5.2.3)
|
118
|
+
bundler (>= 1.3.0)
|
119
|
+
railties (= 5.2.3)
|
105
120
|
sprockets-rails (>= 2.0.0)
|
106
|
-
rails-dom-testing (2.0.
|
107
|
-
activesupport (>= 4.2.0
|
108
|
-
nokogiri (
|
109
|
-
rails-html-sanitizer (1.0.
|
110
|
-
loofah (~> 2.
|
111
|
-
railties (5.
|
112
|
-
actionpack (= 5.
|
113
|
-
activesupport (= 5.
|
121
|
+
rails-dom-testing (2.0.3)
|
122
|
+
activesupport (>= 4.2.0)
|
123
|
+
nokogiri (>= 1.6)
|
124
|
+
rails-html-sanitizer (1.0.4)
|
125
|
+
loofah (~> 2.2, >= 2.2.2)
|
126
|
+
railties (5.2.3)
|
127
|
+
actionpack (= 5.2.3)
|
128
|
+
activesupport (= 5.2.3)
|
114
129
|
method_source
|
115
130
|
rake (>= 0.8.7)
|
116
|
-
thor (>= 0.
|
117
|
-
rake (12.
|
118
|
-
|
119
|
-
|
120
|
-
rspec-
|
121
|
-
rspec-
|
122
|
-
|
123
|
-
|
124
|
-
|
131
|
+
thor (>= 0.19.0, < 2.0)
|
132
|
+
rake (12.3.2)
|
133
|
+
regexp_parser (1.4.0)
|
134
|
+
rspec (3.8.0)
|
135
|
+
rspec-core (~> 3.8.0)
|
136
|
+
rspec-expectations (~> 3.8.0)
|
137
|
+
rspec-mocks (~> 3.8.0)
|
138
|
+
rspec-core (3.8.0)
|
139
|
+
rspec-support (~> 3.8.0)
|
140
|
+
rspec-expectations (3.8.2)
|
125
141
|
diff-lcs (>= 1.2.0, < 2.0)
|
126
|
-
rspec-support (~> 3.
|
127
|
-
rspec-mocks (3.
|
142
|
+
rspec-support (~> 3.8.0)
|
143
|
+
rspec-mocks (3.8.0)
|
128
144
|
diff-lcs (>= 1.2.0, < 2.0)
|
129
|
-
rspec-support (~> 3.
|
130
|
-
rspec-support (3.
|
131
|
-
safe_yaml (1.0.
|
132
|
-
sinatra (2.0.
|
145
|
+
rspec-support (~> 3.8.0)
|
146
|
+
rspec-support (3.8.0)
|
147
|
+
safe_yaml (1.0.5)
|
148
|
+
sinatra (2.0.5)
|
133
149
|
mustermann (~> 1.0)
|
134
150
|
rack (~> 2.0)
|
135
|
-
rack-protection (= 2.0.
|
151
|
+
rack-protection (= 2.0.5)
|
136
152
|
tilt (~> 2.0)
|
137
|
-
sprockets (3.7.
|
153
|
+
sprockets (3.7.2)
|
138
154
|
concurrent-ruby (~> 1.0)
|
139
155
|
rack (> 1, < 3)
|
140
|
-
sprockets-rails (3.2.
|
156
|
+
sprockets-rails (3.2.1)
|
141
157
|
actionpack (>= 4.0)
|
142
158
|
activesupport (>= 4.0)
|
143
159
|
sprockets (>= 3.0.0)
|
144
|
-
|
160
|
+
sqlite3 (1.4.0)
|
161
|
+
thor (0.20.3)
|
145
162
|
thread_safe (0.3.6)
|
146
|
-
tilt (2.0.
|
147
|
-
|
163
|
+
tilt (2.0.9)
|
164
|
+
timecop (0.9.1)
|
165
|
+
tzinfo (1.2.5)
|
148
166
|
thread_safe (~> 0.1)
|
149
|
-
vcr (
|
150
|
-
webmock (3.
|
167
|
+
vcr (4.0.0)
|
168
|
+
webmock (3.5.1)
|
151
169
|
addressable (>= 2.3.6)
|
152
170
|
crack (>= 0.3.2)
|
153
171
|
hashdiff
|
154
|
-
websocket-driver (0.
|
172
|
+
websocket-driver (0.7.0)
|
155
173
|
websocket-extensions (>= 0.1.0)
|
156
|
-
websocket-extensions (0.1.
|
157
|
-
xpath (2.0
|
158
|
-
nokogiri (~> 1.
|
174
|
+
websocket-extensions (0.1.3)
|
175
|
+
xpath (3.2.0)
|
176
|
+
nokogiri (~> 1.8)
|
159
177
|
|
160
178
|
PLATFORMS
|
161
179
|
ruby
|
162
180
|
|
163
181
|
DEPENDENCIES
|
182
|
+
capybara (~> 3.15.0)
|
183
|
+
capybara-screenshot
|
164
184
|
poltergeist (~> 1.8)
|
165
185
|
puma
|
166
186
|
rails (< 6)
|
167
187
|
rake
|
168
|
-
rspec
|
188
|
+
rspec (~> 3.4)
|
169
189
|
sinatra
|
190
|
+
sqlite3
|
170
191
|
tilt
|
171
|
-
|
192
|
+
timecop
|
193
|
+
vcr (~> 4.0)
|
172
194
|
veritrans!
|
173
195
|
webmock (>= 1.20)
|
174
196
|
|
175
197
|
BUNDLED WITH
|
176
|
-
1.
|
198
|
+
1.17.3
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Veritrans ruby library
|
2
2
|
|
3
3
|
Veritrans gem is the library that will help you to integrate seamlessly with
|
4
|
-
Midtrans.
|
4
|
+
Midtrans (formerly known as Veritrans Indonesia).
|
5
5
|
|
6
6
|
[](http://badge.fury.io/rb/veritrans)
|
7
7
|
[](https://travis-ci.org/veritrans/veritrans-ruby)
|
@@ -41,24 +41,11 @@ development:
|
|
41
41
|
|
42
42
|
## STEP 1: Process credit cards
|
43
43
|
|
44
|
+
#### Snap
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
*If you want to use VT-Web, add `payment_type: "VTWEB"`*
|
48
|
-
|
49
|
-
```ruby
|
50
|
-
@result = Veritrans.charge(
|
51
|
-
payment_type: "VTWEB",
|
52
|
-
transaction_details: {
|
53
|
-
order_id: "my-unique-order-id",
|
54
|
-
gross_amount: 100_000
|
55
|
-
}
|
56
|
-
)
|
57
|
-
|
58
|
-
redirect_to @result.redirect_url
|
59
|
-
```
|
46
|
+
##### Pop-up
|
60
47
|
|
61
|
-
|
48
|
+
This will result in payment page being a pop-up(iframe) inside your own web page, no need redirection, similar to our [demo](http://demo.midtrans.com)
|
62
49
|
|
63
50
|
First, generate token in the back end provided with enough details as necessary
|
64
51
|
and as detailed as you wish to.
|
@@ -101,10 +88,45 @@ jQuery(".order-button").on("click", function() {
|
|
101
88
|
});
|
102
89
|
```
|
103
90
|
|
104
|
-
|
91
|
+
##### Redirection
|
92
|
+
|
93
|
+
This will result in redirect_url, you can redirect customer to the url, payment page is securely hosted by Midtrans.
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
@result = Veritrans.create_snap_redirect_url(
|
97
|
+
transaction_details: {
|
98
|
+
order_id: "my-unique-order-id",
|
99
|
+
gross_amount: 100_000
|
100
|
+
}
|
101
|
+
)
|
102
|
+
|
103
|
+
redirect_to @result.redirect_url
|
104
|
+
```
|
105
|
+
|
106
|
+
> This is similar feature as old VT-Web
|
107
|
+
|
108
|
+
#### VT-Web
|
109
|
+
|
110
|
+
> !!! WARNING NOTE: VT-Web is deprecated, please use [Snap](#Snap) instead, it has better previous VT-Web feature and many more improvements, including redirect_url.
|
111
|
+
|
112
|
+
*If you want to use VT-Web, add `payment_type: "VTWEB"`*
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
@result = Veritrans.charge(
|
116
|
+
payment_type: "VTWEB",
|
117
|
+
transaction_details: {
|
118
|
+
order_id: "my-unique-order-id",
|
119
|
+
gross_amount: 100_000
|
120
|
+
}
|
121
|
+
)
|
122
|
+
|
123
|
+
redirect_to @result.redirect_url
|
124
|
+
```
|
125
|
+
|
126
|
+
#### VT-Direct / Core API
|
105
127
|
|
106
128
|
It's little more complicated, because credit_card is sensitive data,
|
107
|
-
you need put credit card number in our safe storage first using `
|
129
|
+
you need put credit card number in our safe storage first using `midtrans.min.js` library, then send received token to with other payment details.
|
108
130
|
|
109
131
|
We don't want you to send credit card number to your server, especially for websites not using https.
|
110
132
|
|
@@ -227,13 +249,13 @@ if @result.success?
|
|
227
249
|
end
|
228
250
|
```
|
229
251
|
|
230
|
-
## STEP 2: Process
|
252
|
+
## STEP 2: Process non credit cards payment
|
231
253
|
|
232
|
-
We provide many payment channels to
|
254
|
+
We provide many payment channels to accept payment, but the API call is almost the same.
|
233
255
|
|
234
|
-
For VT-Web in only one request,
|
256
|
+
For Snap / VT-Web in only one request, payment page will display all available payment options.
|
235
257
|
|
236
|
-
For VT-Direct you have to specify payment method (token required only for credit card transactions).
|
258
|
+
For Core API / VT-Direct you have to specify payment method (without get token step, credit card token required only for credit card transactions).
|
237
259
|
|
238
260
|
```ruby
|
239
261
|
@result = Veritrans.charge(
|
@@ -244,7 +266,7 @@ For VT-Direct you have to specify payment method (token required only for credit
|
|
244
266
|
gross_amount: @payment.amount
|
245
267
|
}
|
246
268
|
)
|
247
|
-
puts "Please
|
269
|
+
puts "Please transfer fund to account no. #{@result.permata_va_number} in bank Permata"
|
248
270
|
```
|
249
271
|
|
250
272
|
See [our documentation](https://api-docs.midtrans.com/#charge-features) for other available options.
|