You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
892 B

$(function () {
$(".btn-create-payment-method").click(function() {
var planId = $(this).data("plan-id");
$("#plan_id").val(planId);
$.getJSON("/pricing/get_client_token/", function(data) {
var $modal = $("#payment-method-modal");
braintree.setup(data.client_token, "dropin", {
container: "payment-form"
});
$modal.modal("show");
})
});
$(".btn-update-payment-method").click(function() {
$.getJSON("/pricing/get_client_token/", function(data) {
var $modal = $("#update-payment-method-modal");
braintree.setup(data.client_token, "dropin", {
container: "update-payment-form"
});
$modal.modal("show");
})
});
$(".pm-modal").on("hidden.bs.modal", function() {
location.reload();
})
});