veritrans 2.1.3 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -1
- data/.travis.yml +3 -5
- data/CHANGELOG.md +20 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +89 -94
- data/Procfile +1 -1
- data/README.md +62 -13
- data/api_reference.md +10 -10
- data/example/rails/cable/Gemfile +48 -0
- data/example/rails/cable/Gemfile.lock +184 -0
- data/example/rails/cable/README.md +29 -0
- data/example/rails/cable/Rakefile +6 -0
- data/example/rails/cable/app/assets/config/manifest.js +3 -0
- data/example/rails/cable/app/assets/images/.keep +0 -0
- data/example/rails/cable/app/assets/javascripts/application.js +15 -0
- data/example/rails/cable/app/assets/javascripts/cable.js +13 -0
- data/example/rails/cable/app/assets/javascripts/channels/.keep +0 -0
- data/example/rails/cable/app/assets/javascripts/chats.js +39 -0
- data/example/rails/cable/app/assets/javascripts/rooms.js +55 -0
- data/example/rails/cable/app/assets/stylesheets/application.css +16 -0
- data/example/rails/cable/app/assets/stylesheets/chatbox.scss +31 -0
- data/example/rails/cable/app/assets/stylesheets/peoplebox.scss +6 -0
- data/example/rails/cable/app/channels/application_cable/channel.rb +4 -0
- data/example/rails/cable/app/channels/application_cable/connection.rb +4 -0
- data/example/rails/cable/app/channels/rooms_texting_channel.rb +13 -0
- data/example/rails/cable/app/controllers/application_controller.rb +3 -0
- data/example/rails/cable/app/controllers/chats_controller.rb +18 -0
- data/example/rails/cable/app/controllers/concerns/.keep +0 -0
- data/example/rails/cable/app/controllers/pays_controller.rb +28 -0
- data/example/rails/cable/app/controllers/rooms_controller.rb +4 -0
- data/example/rails/cable/app/helpers/application_helper.rb +2 -0
- data/example/rails/cable/app/helpers/chats_helper.rb +2 -0
- data/example/rails/cable/app/helpers/rooms_helper.rb +5 -0
- data/example/rails/cable/app/jobs/application_job.rb +2 -0
- data/example/rails/cable/app/jobs/chat_broadcaster_job.rb +15 -0
- data/example/rails/cable/app/mailers/application_mailer.rb +4 -0
- data/example/rails/cable/app/models/application_record.rb +3 -0
- data/example/rails/cable/app/models/chat.rb +41 -0
- data/example/rails/cable/app/models/concerns/.keep +0 -0
- data/example/rails/cable/app/models/order.rb +2 -0
- data/example/rails/cable/app/models/user.rb +2 -0
- data/example/rails/cable/app/views/chats/_chat.html.erb +18 -0
- data/example/rails/cable/app/views/layouts/application.html.erb +19 -0
- data/example/rails/cable/app/views/layouts/mailer.html.erb +13 -0
- data/example/rails/cable/app/views/layouts/mailer.text.erb +1 -0
- data/example/rails/cable/app/views/rooms/_chatbox.html.erb +13 -0
- data/example/rails/cable/app/views/rooms/_online_people.html.erb +53 -0
- data/example/rails/cable/app/views/rooms/index.html.erb +9 -0
- data/example/rails/cable/bin/bundle +3 -0
- data/example/rails/cable/bin/rails +9 -0
- data/example/rails/cable/bin/rake +9 -0
- data/example/rails/cable/bin/setup +34 -0
- data/example/rails/cable/bin/spring +16 -0
- data/example/rails/cable/bin/update +29 -0
- data/example/rails/cable/config.ru +5 -0
- data/example/rails/cable/config/application.rb +16 -0
- data/example/rails/cable/config/boot.rb +3 -0
- data/example/rails/cable/config/cable.yml +9 -0
- data/example/rails/cable/config/database.yml +20 -0
- data/example/rails/cable/config/environment.rb +5 -0
- data/example/rails/cable/config/environments/development.rb +57 -0
- data/example/rails/cable/config/environments/production.rb +86 -0
- data/example/rails/cable/config/environments/test.rb +42 -0
- data/example/rails/cable/config/initializers/application_controller_renderer.rb +6 -0
- data/example/rails/cable/config/initializers/assets.rb +11 -0
- data/example/rails/cable/config/initializers/backtrace_silencers.rb +7 -0
- data/example/rails/cable/config/initializers/cookies_serializer.rb +5 -0
- data/example/rails/cable/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/rails/cable/config/initializers/inflections.rb +16 -0
- data/example/rails/cable/config/initializers/mime_types.rb +4 -0
- data/example/rails/cable/config/initializers/new_framework_defaults.rb +24 -0
- data/example/rails/cable/config/initializers/session_store.rb +3 -0
- data/example/rails/cable/config/initializers/sidekiq.rb +2 -0
- data/example/rails/cable/config/initializers/veritrans.rb +46 -0
- data/example/rails/cable/config/initializers/wrap_parameters.rb +14 -0
- data/example/rails/cable/config/locales/en.yml +23 -0
- data/example/rails/cable/config/puma.rb +47 -0
- data/example/rails/cable/config/routes.rb +18 -0
- data/example/rails/cable/config/secrets.yml +22 -0
- data/example/rails/cable/config/spring.rb +6 -0
- data/example/rails/cable/config/veritrans.yml +13 -0
- data/example/rails/cable/db/development.sqlite3 +0 -0
- data/example/rails/cable/db/migrate/20161215070044_create_chats.rb +10 -0
- data/example/rails/cable/db/migrate/20161215072021_create_users.rb +10 -0
- data/example/rails/cable/db/migrate/20161219110219_create_orders.rb +11 -0
- data/example/rails/cable/db/schema.rb +37 -0
- data/example/rails/cable/db/seeds.rb +41 -0
- data/example/rails/cable/db/test.sqlite3 +0 -0
- data/example/rails/cable/lib/assets/.keep +0 -0
- data/example/rails/cable/lib/tasks/.keep +0 -0
- data/example/rails/cable/public/404.html +67 -0
- data/example/rails/cable/public/422.html +67 -0
- data/example/rails/cable/public/500.html +66 -0
- data/example/rails/cable/public/apple-touch-icon-precomposed.png +0 -0
- data/example/rails/cable/public/apple-touch-icon.png +0 -0
- data/example/rails/cable/public/favicon.ico +0 -0
- data/example/rails/cable/public/images/avatar1.jpg +0 -0
- data/example/rails/cable/public/images/avatar2.jpg +0 -0
- data/example/rails/cable/public/images/avatar3.jpg +0 -0
- data/example/rails/cable/public/images/avatar4.jpg +0 -0
- data/example/rails/cable/public/images/avatar5.jpg +0 -0
- data/example/rails/cable/public/images/avatar6.jpg +0 -0
- data/example/rails/cable/public/robots.txt +5 -0
- data/example/rails/cable/vendor/assets/javascripts/.keep +0 -0
- data/example/rails/cable/vendor/assets/stylesheets/.keep +0 -0
- data/example/rails/cable/vendor/assets/stylesheets/photon.css +2333 -0
- data/example/rails/simplepay/Gemfile +54 -0
- data/example/rails/simplepay/Gemfile.lock +178 -0
- data/example/rails/simplepay/README.md +30 -0
- data/example/rails/simplepay/Rakefile +6 -0
- data/example/rails/simplepay/app/assets/config/manifest.js +3 -0
- data/example/rails/simplepay/app/assets/images/.keep +0 -0
- data/example/rails/simplepay/app/assets/javascripts/application.js +16 -0
- data/example/rails/simplepay/app/assets/javascripts/cable.js +13 -0
- data/example/rails/simplepay/app/assets/javascripts/channels/.keep +0 -0
- data/example/rails/simplepay/app/assets/javascripts/pay.js +18 -0
- data/example/rails/simplepay/app/assets/stylesheets/application.css +15 -0
- data/example/rails/simplepay/app/assets/stylesheets/style.css +254 -0
- data/example/rails/simplepay/app/channels/application_cable/channel.rb +4 -0
- data/example/rails/simplepay/app/channels/application_cable/connection.rb +4 -0
- data/example/rails/simplepay/app/controllers/application_controller.rb +3 -0
- data/example/rails/simplepay/app/controllers/concerns/.keep +0 -0
- data/example/rails/simplepay/app/controllers/home_controller.rb +16 -0
- data/example/rails/simplepay/app/controllers/pay_controller.rb +10 -0
- data/example/rails/simplepay/app/helpers/application_helper.rb +2 -0
- data/example/rails/simplepay/app/helpers/pay_helper.rb +2 -0
- data/example/rails/simplepay/app/jobs/application_job.rb +2 -0
- data/example/rails/simplepay/app/mailers/application_mailer.rb +4 -0
- data/example/rails/simplepay/app/models/application_record.rb +3 -0
- data/example/rails/simplepay/app/models/concerns/.keep +0 -0
- data/example/rails/simplepay/app/models/order.rb +2 -0
- data/example/rails/simplepay/app/views/home/index.html.erb +19 -0
- data/example/rails/simplepay/app/views/layouts/application.html.erb +15 -0
- data/example/rails/simplepay/app/views/layouts/mailer.html.erb +13 -0
- data/example/rails/simplepay/app/views/layouts/mailer.text.erb +1 -0
- data/example/rails/simplepay/app/views/pay/notify.html.erb +2 -0
- data/example/rails/simplepay/bin/bundle +3 -0
- data/example/rails/simplepay/bin/rails +9 -0
- data/example/rails/simplepay/bin/rake +9 -0
- data/example/rails/simplepay/bin/setup +34 -0
- data/example/rails/simplepay/bin/spring +16 -0
- data/example/rails/simplepay/bin/update +29 -0
- data/example/rails/simplepay/config.ru +5 -0
- data/example/rails/simplepay/config/application.rb +15 -0
- data/example/rails/simplepay/config/boot.rb +3 -0
- data/example/rails/simplepay/config/cable.yml +9 -0
- data/example/rails/simplepay/config/database.yml +25 -0
- data/example/rails/simplepay/config/environment.rb +5 -0
- data/example/rails/simplepay/config/environments/development.rb +57 -0
- data/example/rails/simplepay/config/environments/production.rb +86 -0
- data/example/rails/simplepay/config/environments/test.rb +42 -0
- data/example/rails/simplepay/config/initializers/application_controller_renderer.rb +6 -0
- data/example/rails/simplepay/config/initializers/assets.rb +11 -0
- data/example/rails/simplepay/config/initializers/backtrace_silencers.rb +7 -0
- data/example/rails/simplepay/config/initializers/cookies_serializer.rb +5 -0
- data/example/rails/simplepay/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/rails/simplepay/config/initializers/inflections.rb +16 -0
- data/example/rails/simplepay/config/initializers/mime_types.rb +4 -0
- data/example/rails/simplepay/config/initializers/new_framework_defaults.rb +24 -0
- data/example/rails/simplepay/config/initializers/session_store.rb +3 -0
- data/example/rails/simplepay/config/initializers/veritrans.rb +46 -0
- data/example/rails/simplepay/config/initializers/wrap_parameters.rb +14 -0
- data/example/rails/simplepay/config/locales/en.yml +23 -0
- data/example/rails/simplepay/config/puma.rb +47 -0
- data/example/rails/simplepay/config/routes.rb +5 -0
- data/example/rails/simplepay/config/secrets.yml +22 -0
- data/example/rails/simplepay/config/spring.rb +6 -0
- data/example/rails/simplepay/config/veritrans.yml +18 -0
- data/example/rails/simplepay/db/development.sqlite3 +0 -0
- data/example/rails/simplepay/db/migrate/20161221090855_create_orders.rb +10 -0
- data/example/rails/simplepay/db/schema.rb +22 -0
- data/example/rails/simplepay/db/seeds.rb +7 -0
- data/example/rails/simplepay/db/test.sqlite3 +0 -0
- data/example/rails/simplepay/lib/assets/.keep +0 -0
- data/example/rails/simplepay/lib/tasks/.keep +0 -0
- data/example/rails/simplepay/public/404.html +67 -0
- data/example/rails/simplepay/public/422.html +67 -0
- data/example/rails/simplepay/public/500.html +66 -0
- data/example/rails/simplepay/public/apple-touch-icon-precomposed.png +0 -0
- data/example/rails/simplepay/public/apple-touch-icon.png +0 -0
- data/example/rails/simplepay/public/favicon.ico +0 -0
- data/example/rails/simplepay/public/robots.txt +5 -0
- data/example/rails/simplepay/vendor/assets/javascripts/.keep +0 -0
- data/example/rails/simplepay/vendor/assets/stylesheets/.keep +0 -0
- data/example/{README.md → sinatra/README.md} +0 -0
- data/example/{config.ru → sinatra/config.ru} +3 -0
- data/example/{index.erb → sinatra/index.erb} +7 -6
- data/example/{localization.erb → sinatra/localization.erb} +6 -5
- data/example/{points.erb → sinatra/points.erb} +6 -5
- data/example/{recurring.erb → sinatra/recurring.erb} +6 -6
- data/example/{response.erb → sinatra/response.erb} +4 -1
- data/example/{sinatra.rb → sinatra/sinatra.rb} +9 -3
- data/example/{style.css → sinatra/style.css} +11 -0
- data/example/{veritrans.yml → sinatra/veritrans.yml} +2 -2
- data/example/{widget.erb → sinatra/widget.erb} +18 -6
- data/lib/generators/templates/assets/credit_card_form.js +6 -0
- data/lib/generators/templates/payments_controller.rb +4 -4
- data/lib/generators/templates/veritrans.yml +5 -5
- data/lib/generators/templates/views/_credit_card_form.erb +2 -2
- data/lib/generators/templates/views/_veritrans_include.erb +1 -1
- data/lib/generators/veritrans/install_generator.rb +1 -1
- data/lib/generators/veritrans/payment_form_generator.rb +1 -1
- data/lib/veritrans.rb +106 -5
- data/lib/veritrans/api.rb +7 -7
- data/lib/veritrans/cli.rb +11 -5
- data/lib/veritrans/client.rb +7 -4
- data/lib/veritrans/config.rb +5 -3
- data/lib/veritrans/events.rb +46 -35
- data/lib/veritrans/result.rb +58 -2
- data/lib/veritrans/testing.rb +156 -0
- data/lib/veritrans/version.rb +1 -1
- data/spec/cli_spec.rb +2 -2
- data/spec/fixtures/approve_failed.yml +1 -1
- data/spec/fixtures/cancel_failed.yml +1 -1
- data/spec/fixtures/cancel_success.yml +2 -2
- data/spec/fixtures/capture_failed.yml +1 -1
- data/spec/fixtures/charge.yml +2 -2
- data/spec/fixtures/charge_direct.yml +1 -1
- data/spec/fixtures/charge_vtweb.yml +2 -2
- data/spec/fixtures/cli_test_1111-not-exists.yml +1 -1
- data/spec/fixtures/cli_test_not_exists.yml +1 -1
- data/spec/fixtures/cli_test_real_txn.yml +1 -1
- data/spec/fixtures/cli_test_unauthorized.yml +1 -1
- data/spec/fixtures/events_test_real_txn.yml +1 -1
- data/spec/fixtures/expire_failed.yml +1 -1
- data/spec/fixtures/expire_success.yml +1 -1
- data/spec/fixtures/midtrans_status.yml +2 -2
- data/spec/fixtures/status_fail.yml +1 -1
- data/spec/fixtures/status_success.yml +2 -2
- data/spec/rails_plugin_spec.rb +37 -20
- data/spec/spec_helper.rb +0 -1
- data/spec/veritrans_client_spec.rb +1 -1
- data/spec/veritrans_config_spec.rb +1 -1
- data/spec/veritrans_events_spec.rb +6 -6
- data/spec/veritrans_testing_spec.rb +184 -0
- data/testing_webhooks.md +2 -2
- data/veritrans.gemspec +1 -1
- metadata +195 -16
- data/lib/veritrans/core_extensions.rb +0 -32
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,13 +2,14 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>veritrans-ruby demo</title>
|
5
|
-
<link rel="icon" type="image/x-icon" href="https://account.
|
5
|
+
<link rel="icon" type="image/x-icon" href="https://account.midtrans.com/favicon.ico" />
|
6
6
|
<link rel="stylesheet" href="/style.css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
|
10
10
|
<header>
|
11
|
-
<h3>
|
11
|
+
<h3>Midtrans sinatra app</h3>
|
12
|
+
<a href="https://github.com/veritrans/veritrans-ruby" class="github">Source Code</a>
|
12
13
|
</header>
|
13
14
|
|
14
15
|
<section>
|
@@ -46,7 +47,7 @@
|
|
46
47
|
<input type="text" name="bin_promo" placeholder="411111, 500000, bni, mandiri, 3111">
|
47
48
|
<br/>
|
48
49
|
<small class="bins-hint">
|
49
|
-
<a href="
|
50
|
+
<a href="https://api-docs.midtrans.com/#card-features-bin-promo">See documentation</a>
|
50
51
|
</small>
|
51
52
|
</p>
|
52
53
|
|
@@ -103,7 +104,7 @@
|
|
103
104
|
<a onclick="$('#card_number').val('4511 1111 1111 1117')">challenge</a>
|
104
105
|
<a onclick="$('#card_number').val('4611 1111 1111 1116')">Deny by FDS</a>
|
105
106
|
<a onclick="$('#card_number').val('4911 1111 1111 1113')">Deny by bank</a>
|
106
|
-
<a href="
|
107
|
+
<a href="https://docs.midtrans.com/en/reference/test.html" target="_blank">documentation</a>
|
107
108
|
</small>
|
108
109
|
</p>
|
109
110
|
<p>
|
@@ -112,7 +113,7 @@
|
|
112
113
|
</p>
|
113
114
|
<p>
|
114
115
|
<label for="card_exp">Expiration date</label>
|
115
|
-
<input type="text" id="card_exp" placeholder="MM / YY" value="12 /
|
116
|
+
<input type="text" id="card_exp" placeholder="MM / YY" value="12 / 18">
|
116
117
|
</p>
|
117
118
|
|
118
119
|
<p>
|
@@ -147,7 +148,7 @@
|
|
147
148
|
<a href="/widget">Click here</a>
|
148
149
|
</section>
|
149
150
|
|
150
|
-
<script src="
|
151
|
+
<script src="https://api.sandbox.midtrans.com/v2/assets/veritrans.js"></script>
|
151
152
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
152
153
|
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.payment/1.0.2/jquery.payment.js"></script>
|
153
154
|
<script src="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/0.9.9/jquery.magnific-popup.min.js"></script>
|
@@ -2,15 +2,16 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>veritrans-ruby demo</title>
|
5
|
-
<link rel="icon" type="image/x-icon" href="https://account.
|
5
|
+
<link rel="icon" type="image/x-icon" href="https://account.midtrans.com/favicon.ico" />
|
6
6
|
<link rel="stylesheet" href="/style.css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
|
10
10
|
<header>
|
11
11
|
<h3>
|
12
|
-
<a href="/">
|
12
|
+
<a href="/">Midtrans sinatra app</a>
|
13
13
|
</h3>
|
14
|
+
<a href="https://github.com/veritrans/veritrans-ruby" class="github">Source Code</a>
|
14
15
|
</header>
|
15
16
|
|
16
17
|
<section>
|
@@ -42,7 +43,7 @@
|
|
42
43
|
<a onclick="$('#card_number').val('4511 1111 1111 1117')">challenge</a>
|
43
44
|
<a onclick="$('#card_number').val('4611 1111 1111 1116')">Deny by FDS</a>
|
44
45
|
<a onclick="$('#card_number').val('4911 1111 1111 1113')">Deny by bank</a>
|
45
|
-
<a href="
|
46
|
+
<a href="https://docs.midtrans.com/en/reference/test.html" target="_blank">documentation</a>
|
46
47
|
</small>
|
47
48
|
</p>
|
48
49
|
<p>
|
@@ -51,7 +52,7 @@
|
|
51
52
|
</p>
|
52
53
|
<p>
|
53
54
|
<label for="card_exp">Card Expiry Date</label>
|
54
|
-
<input type="text" id="card_exp" placeholder="MM / YY" value="12 /
|
55
|
+
<input type="text" id="card_exp" placeholder="MM / YY" value="12 / 18">
|
55
56
|
</p>
|
56
57
|
|
57
58
|
<p>
|
@@ -65,7 +66,7 @@
|
|
65
66
|
</form>
|
66
67
|
</section>
|
67
68
|
|
68
|
-
<script src="https://api.sandbox.
|
69
|
+
<script src="https://api.sandbox.midtrans.com/v2/assets/veritrans.js"></script>
|
69
70
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
70
71
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.payment/1.0.2/jquery.payment.js"></script>
|
71
72
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>
|
@@ -2,15 +2,16 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>veritrans-ruby demo</title>
|
5
|
-
<link rel="icon" type="image/x-icon" href="https://account.
|
5
|
+
<link rel="icon" type="image/x-icon" href="https://account.midtrans.com/favicon.ico" />
|
6
6
|
<link rel="stylesheet" href="/style.css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
|
10
10
|
<header>
|
11
11
|
<h3>
|
12
|
-
<a href="/">
|
12
|
+
<a href="/">Midtrans sinatra app</a>
|
13
13
|
</h3>
|
14
|
+
<a href="https://github.com/veritrans/veritrans-ruby" class="github">Source Code</a>
|
14
15
|
</header>
|
15
16
|
|
16
17
|
<section>
|
@@ -43,12 +44,12 @@
|
|
43
44
|
<small style="margin-left: 100px" class="card-numbers">
|
44
45
|
<a onclick="$('#card_number').val('4802 0000 0000 0002')">Success</a>
|
45
46
|
<a onclick="$('#card_number').val('4902 0000 0000 0001')">Deny</a>
|
46
|
-
<a href="
|
47
|
+
<a href="https://api-docs.midtrans.com/#card-features-installment" target="_blank">documentation</a>
|
47
48
|
</small>
|
48
49
|
</p>
|
49
50
|
<p>
|
50
51
|
<label for="card_exp">Expiry Date</label>
|
51
|
-
<input type="text" id="card_exp" placeholder="MM / YY" value="12 /
|
52
|
+
<input type="text" id="card_exp" placeholder="MM / YY" value="12 / 18">
|
52
53
|
</p>
|
53
54
|
<p>
|
54
55
|
<label for="card_cvc">Card CVV</label>
|
@@ -67,7 +68,7 @@
|
|
67
68
|
</form>
|
68
69
|
</section>
|
69
70
|
|
70
|
-
<script src="https://api.sandbox.
|
71
|
+
<script src="https://api.sandbox.midtrans.com/v2/assets/veritrans.js"></script>
|
71
72
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
72
73
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.payment/1.0.2/jquery.payment.js"></script>
|
73
74
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>
|
@@ -2,16 +2,16 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>veritrans-ruby demo</title>
|
5
|
-
<link rel="icon" type="image/x-icon" href="https://account.
|
5
|
+
<link rel="icon" type="image/x-icon" href="https://account.midtrans.com/favicon.ico" />
|
6
6
|
<link rel="stylesheet" href="/style.css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
|
10
10
|
<header>
|
11
11
|
<h3>
|
12
|
-
<a href="/">
|
13
|
-
<link rel="icon" type="image/x-icon" href="https://account.veritrans.co.id/favicon.ico" />
|
12
|
+
<a href="/">Midtrans sinatra app</a>
|
14
13
|
</h3>
|
14
|
+
<a href="https://github.com/veritrans/veritrans-ruby" class="github">Source Code</a>
|
15
15
|
</header>
|
16
16
|
|
17
17
|
<section class="recurring-page">
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<a onclick="$('#card_number').val('4411 1111 1111 1118')">success Visa 2</a>
|
38
38
|
<a onclick="$('#card_number').val('5810 1111 1111 1112')">success MasterCard 1</a>
|
39
39
|
<a onclick="$('#card_number').val('5410 1111 1111 1116')">success MasterCard 2</a>
|
40
|
-
<a href="
|
40
|
+
<a href="https://docs.midtrans.com/en/reference/test.html" target="_blank">documentation</a>
|
41
41
|
</small>
|
42
42
|
</p>
|
43
43
|
|
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
<p>
|
50
50
|
<label for="card_exp">Expiration date</label>
|
51
|
-
<input type="text" id="card_exp" placeholder="MM / YY" value="12 /
|
51
|
+
<input type="text" id="card_exp" placeholder="MM / YY" value="12 / 18">
|
52
52
|
</p>
|
53
53
|
|
54
54
|
</fieldset>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<input id="add_card_btn" type="submit" value="Add Card">
|
57
57
|
</form>
|
58
58
|
|
59
|
-
<script src="
|
59
|
+
<script src="https://api.sandbox.midtrans.com/v2/assets/veritrans.js"></script>
|
60
60
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
61
61
|
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.payment/1.0.2/jquery.payment.js"></script>
|
62
62
|
<script src="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.1/jquery.magnific-popup.js"></script>
|
@@ -1,7 +1,10 @@
|
|
1
1
|
<link rel="stylesheet" href="/style.css">
|
2
2
|
|
3
3
|
<header>
|
4
|
-
<h3>
|
4
|
+
<h3>
|
5
|
+
<a href="/">Midtrans sinatra app</a>
|
6
|
+
</h3>
|
7
|
+
<a href="https://github.com/veritrans/veritrans-ruby" class="github">Source Code</a>
|
5
8
|
</header>
|
6
9
|
|
7
10
|
<% if @result.redirect_url %>
|
@@ -16,7 +16,7 @@ Veritrans.setup do
|
|
16
16
|
|
17
17
|
# config.server_key = "..."
|
18
18
|
# config.client_key = "..."
|
19
|
-
# config.api_host = "https://api.sandbox.
|
19
|
+
# config.api_host = "https://api.sandbox.midtrans.com" (default)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Veritrans.config.server_key
|
@@ -55,7 +55,8 @@ get "/widget" do
|
|
55
55
|
gross_amount: 30_000
|
56
56
|
}
|
57
57
|
)
|
58
|
-
|
58
|
+
|
59
|
+
@token = response.token_id
|
59
60
|
erb :widget
|
60
61
|
end
|
61
62
|
|
@@ -143,7 +144,12 @@ get "/charge_vtweb" do
|
|
143
144
|
transaction_details: {
|
144
145
|
order_id: generate_order_id,
|
145
146
|
gross_amount: 100_000
|
146
|
-
}
|
147
|
+
},
|
148
|
+
item_details: [
|
149
|
+
name: "Mountain Apple",
|
150
|
+
price: 2_000,
|
151
|
+
quantity: 50
|
152
|
+
]
|
147
153
|
}
|
148
154
|
|
149
155
|
@result = Veritrans.charge(@cahrge_params)
|
@@ -15,6 +15,17 @@ header {
|
|
15
15
|
background: #F5FAFC;
|
16
16
|
padding: 3px 5px;
|
17
17
|
border-bottom: 1px solid #ccc;
|
18
|
+
overflow: hidden;
|
19
|
+
}
|
20
|
+
|
21
|
+
header .github {
|
22
|
+
float: right;
|
23
|
+
margin: 18px 0;
|
24
|
+
}
|
25
|
+
|
26
|
+
header h3 {
|
27
|
+
float: left;
|
28
|
+
margin: 18px 0;
|
18
29
|
}
|
19
30
|
|
20
31
|
section {
|
@@ -5,7 +5,7 @@ development:
|
|
5
5
|
server_key: VT-server-9Htb-RxXkg7-7hznSCCjxvoY
|
6
6
|
|
7
7
|
# For production use
|
8
|
-
# api_host: https://api.
|
8
|
+
# api_host: https://api.midtrans.com
|
9
9
|
|
10
10
|
# For sandbox use
|
11
|
-
# api_host: https://api.sandbox.
|
11
|
+
# api_host: https://api.sandbox.midtrans.com
|
@@ -2,27 +2,37 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>veritrans-ruby demo</title>
|
5
|
-
<link rel="icon" type="image/x-icon" href="https://account.
|
5
|
+
<link rel="icon" type="image/x-icon" href="https://account.midtrans.com/favicon.ico" />
|
6
6
|
<link rel="stylesheet" href="/style.css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
|
10
10
|
<header>
|
11
11
|
<h3>
|
12
|
-
<a href="/">
|
12
|
+
<a href="/">Midtrans sinatra app</a>
|
13
13
|
</h3>
|
14
|
+
<a href="https://github.com/veritrans/veritrans-ruby" class="github">Source Code</a>
|
14
15
|
</header>
|
15
16
|
|
16
17
|
<section>
|
17
|
-
<h4>
|
18
|
+
<h4>Midtrans SNAP example</h4>
|
18
19
|
|
19
20
|
<section>
|
20
21
|
<p>
|
21
22
|
<label>Snap Token</label>
|
22
|
-
<input type="text" id="token" value="<%= @token %>" readonly>
|
23
|
+
<input type="text" id="token" value="<%= @token %>" readonly size="50">
|
23
24
|
</p>
|
24
25
|
<button id="snap_pay">Pay Now</button>
|
25
26
|
</section>
|
27
|
+
|
28
|
+
<p>
|
29
|
+
To complete payment in sandbox mode, plese use <a href="https://docs.midtrans.com/en/api/test_credentials.html" target="_blank">testing credentials</a>.<br/>
|
30
|
+
For more details see <a href="https://snap-docs.midtrans.com/">SNAP Documentation</a>
|
31
|
+
<p>
|
32
|
+
|
33
|
+
<code>
|
34
|
+
<pre class="callback-result"></pre>
|
35
|
+
</code>
|
26
36
|
</section>
|
27
37
|
|
28
38
|
<script src="https://app.sandbox.midtrans.com/snap/snap.js"></script>
|
@@ -34,8 +44,10 @@ $('#snap_pay').on('click', function (e) {
|
|
34
44
|
snap.pay($('#token').val() + "?locale=en", {
|
35
45
|
onSuccess: function (res) {
|
36
46
|
console.log('onSuccess', res);
|
37
|
-
|
38
|
-
|
47
|
+
$('.callback-result').text("SNAP Callback parameters:\n" + JSON.stringify(res, null, 4));
|
48
|
+
if (confirm(res.status_message + "\nRedirect to confirm page?")) {
|
49
|
+
window.location = "/widget/confirm/" + res.transaction_id;
|
50
|
+
}
|
39
51
|
},
|
40
52
|
onPending: function (res) {
|
41
53
|
console.log('onPending', res);
|