Browse Source

Updated verbage of cancelation

master
Teknikode 7 months ago
parent
commit
ef5e5cd82a
  1. 21
      Teknik/Scripts/Billing/Billing.js
  2. 6
      Teknik/Scripts/User/BillingSettings.js

21
Teknik/Scripts/Billing/Billing.js

@ -1,20 +1 @@ @@ -1,20 +1 @@
// Set your publishable key: remember to change this to your live publishable key in production
// See your keys here: https://dashboard.stripe.com/apikeys
let stripe = Stripe(stripePublishKey);
let elements = stripe.elements();
let card = elements.create('card');
card.mount('#card-element');
card.on('change', function (event) {
displayError(event);
});
function displayError(event) {
changeLoadingStatePrices(false);
let displayError = document.getElementById('card-element-errors');
if (event.error) {
displayError.textContent = event.error.message;
} else {
displayError.textContent = '';
}
}


6
Teknik/Scripts/User/BillingSettings.js

@ -5,9 +5,8 @@ $(document).ready(function () { @@ -5,9 +5,8 @@ $(document).ready(function () {
var subscriptionId = $(this).data('subscription-id');
var productId = $(this).data('product-id');
var element = $('#activeSubscriptionList [id="' + subscriptionId + '"');
confirmDialog('Confirm', 'Back', 'Are you sure you want to cancel your subscription?', function (result) {
confirmDialog('Confirm', 'Back', 'Are you sure you want to cancel your subscription? Your plan will be canceled, but is still available until the end of your billing period.', function (result) {
if (result) {
$.ajax({
type: "POST",
@ -21,9 +20,8 @@ $(document).ready(function () { @@ -21,9 +20,8 @@ $(document).ready(function () {
},
success: function (response) {
if (response.result) {
element.remove();
$("#top_msg").css('display', 'inline', 'important');
$("#top_msg").html('<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Subscription successfully canceled.</div>');
$("#top_msg").html('<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Subscription will be canceled at the end of your billing cycle.</div>');
}
else {
$("#top_msg").css('display', 'inline', 'important');

Loading…
Cancel
Save