example/index.erb in veritrans-2.0.4 vs example/index.erb in veritrans-2.1.0

- old
+ new

@@ -1,21 +1,91 @@ -<link rel="stylesheet" href="/style.css"> +<!doctype html> +<html> +<head> + <title>veritrans-ruby demo</title> + <link rel="icon" type="image/x-icon" href="https://account.veritrans.co.id/favicon.ico" /> + <link rel="stylesheet" href="/style.css"> +</head> +<body> <header> <h3>Veritrans sinatra app</h3> </header> <section> - <p> - Charge request VT-Web <a href="/charge_vtweb">click to see payment page</a> - </p> + <h4>VT-Web</h4> + <form action="/charge_vtweb" method="GET" id="vtweb_form"> + <fieldset> + <p> + <label>Language</label> + <select name="locale"> + <option></option> + <option value="id">Indonesian</option> + <option value="en">English</option> + </select> + </p> + + <div class="form-row"> + <label>Payment Types</label> + <ul> + <% @payment_types = %w{CREDIT_CARD MANDIRI_CLICKPAY MANDIRI_BILL CIMB_CLICKS INDOMARET BANK_TRANSFER MANDIRI_BILL} %> + <% for type in @payment_types %> + <li> + <label> + <input type="checkbox" name="enabled_payments[]" value="<%= type %>"> + <%= type.split("_").map(&:capitalize).join(' ') %> + </label> + </li> + <% end %> + </ul> + <br/> + <small class="types-hint">By default Veritrans will show all available types</small> + </div> + + <p> + <label>Credit Card BIN promo</label> + <input type="text" name="bin_promo" placeholder="411111, 500000, bni, mandiri, 3111"> + <br/> + <small class="bins-hint"> + <a href="http://docs.veritrans.co.id/en/vtweb/other_features.html#bin-promo">See documentation</a> + </small> + </p> + + <p> + <label>Credit Card 3D Secure</label> + <select name="credit_card_3d_secure"> + <option></option> + <option value="true">Yes</option> + <option value="false">No</option> + </select> + </p> + + <div class="form-row"> + <label>Credit Card Installment</label> + <ul> + <li> + <label><input type="checkbox" name="installment[bni]">BNI</label> + </li> + <li> + <label><input type="checkbox" name="installment[mandiri]">Mandiri</label> + </li> + <li> + <label><input type="checkbox" name="installment[bca]">BCA</label> + </li> + </ul> + </div> + + </fieldset> + + <p> + <input type="submit" value="Create payment page"> + <p> + </form> </section> <section> - <p> - Charge request VT-Direct - </p> + <h4>VT-Direct</h4> <form action="/charge_vtdirect" method="post" id="card_form"> <input type="hidden" name="token_id" id="card_token"> <fieldset> <legend>Credit card</legend> @@ -31,11 +101,11 @@ <a onclick="$('#card_number').val('4811 1111 1111 1114')">success Visa</a> <a onclick="$('#card_number').val('5810 1111 1111 1112')">success MasterCard</a> <a onclick="$('#card_number').val('4511 1111 1111 1117')">challenge</a> <a onclick="$('#card_number').val('4611 1111 1111 1116')">Deny by FDS</a> <a onclick="$('#card_number').val('4911 1111 1111 1113')">Deny by bank</a> - <a href="http://docs.veritrans.co.id/sandbox/card_list.html" target="_blank">documentation</a> + <a href="http://docs.veritrans.co.id/en/api/test_credentials.html" target="_blank">documentation</a> </small> </p> <p> <label for="card_cvc">Security Code</label> <input type="text" id="card_cvc" style="width: 30px" placeholder="cvc" value="123"> @@ -54,10 +124,31 @@ <input id="submit_btn" type="submit"> </form> </section> +<section> + <h4>Localization</h4> + Indonesian translation for validation messages + <a href="/localization">Click here</a> +</section> + +<section> + <h4>Recurring</h4> + <a href="/recurring">Click here</a> +</section> + +<section> + <h4>Credit Card Points</h4> + <a href="/points">Click here</a> +</section> + +<section> + <h4>Snap</h4> + <a href="/widget">Click here</a> +</section> + <script src="//api.sandbox.veritrans.co.id/v2/assets/veritrans.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery.payment/1.0.2/jquery.payment.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/0.9.9/jquery.magnific-popup.min.js"></script> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/0.9.9/magnific-popup.css"> @@ -104,15 +195,19 @@ }); $.magnificPopup.instance.content.find('iframe').height(590); // if no redirect_url and we have token_id then just make charge request } else if (data.token_id) { $('#card_token').val(data.token_id); + $.magnificPopup.close(); form.submit(); // if no redirect_url and no token_id, then it should be error } else { alert(data.validation_messages ? data.validation_messages.join("\n") : data.status_message); $('#submit_btn').removeAttr('disabled').removeAttr("value"); } }); }); }); -</script> \ No newline at end of file +</script> + +</body> +</html>