Skip to content

Commit

Permalink
Reverted recurring IDs back to subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jun 4, 2024
1 parent f73eb8a commit dd8ff7a
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="paypal_recurring" class="paypal-recurring">
<div id="paypal_subscription" class="paypal-subscription">
{% if ((recurring_status == '2') or (recurring_status == '3')) %}
<button type="button" class="btn btn-primary button-enable-recurring">{{ button_enable_recurring }}</button>
{% else %}
Expand All @@ -8,17 +8,17 @@
<br />
<script type="text/javascript">
$('#paypal_recurring').on('click', '.button-enable-recurring', function() {
$('#paypal_subscription').on('click', '.button-enable-recurring', function() {
$.ajax({
type: 'post',
url: '{{ enable_url }}',
data: {'order_recurring_id' : '{{ order_recurring_id }}'},
dataType: 'json',
beforeSend: function() {
$('#paypal_recurring .btn').prop('disabled', true);
$('#paypal_subscription .btn').prop('disabled', true);
},
complete: function() {
$('#paypal_recurring .btn').prop('disabled', false);
$('#paypal_subscription .btn').prop('disabled', false);
},
success: function(json) {
$('.alert-dismissible').remove();
Expand All @@ -34,7 +34,7 @@ $('#paypal_recurring').on('click', '.button-enable-recurring', function() {
$('html, body').animate({scrollTop: 0}, 'slow');
$('#paypal_recurring').load('{{ info_url }} #paypal_recurring >');
$('#paypal_subscription').load('{{ info_url }} #paypal_subscription >');
}
},
error: function(xhr, ajaxOptions, thrownError) {
Expand All @@ -43,17 +43,17 @@ $('#paypal_recurring').on('click', '.button-enable-recurring', function() {
});
});
$('#paypal_recurring').on('click', '.button-disable-recurring', function() {
$('#paypal_subscription').on('click', '.button-disable-recurring', function() {
$.ajax({
type: 'post',
url: '{{ disable_url }}',
data: {'subscription_id' : '{{ subscription_id }}'},
dataType: 'json',
beforeSend: function() {
$('#paypal_recurring .btn').prop('disabled', true);
$('#paypal_subscription .btn').prop('disabled', true);
},
complete: function() {
$('#paypal_recurring .btn').prop('disabled', false);
$('#paypal_subscription .btn').prop('disabled', false);
},
success: function(json) {
$('.alert-dismissible').remove();
Expand All @@ -69,7 +69,7 @@ $('#paypal_recurring').on('click', '.button-disable-recurring', function() {
$('html, body').animate({scrollTop: 0}, 'slow');
$('#paypal_recurring').load('{{ info_url }} #paypal_recurring >');
$('#paypal_subscription').load('{{ info_url }} #paypal_subscription >');
}
},
error: function(xhr, ajaxOptions, thrownError) {
Expand Down

0 comments on commit dd8ff7a

Please sign in to comment.