Skip to content

Commit

Permalink
Reverted to subscription_id in extension/subscription/paypal TWIG file
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jun 4, 2024
1 parent 18c541e commit f73eb8a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 97 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<div class="paypal-subscription" id="paypal-subscription">
{% if subscription_status == '2' or subscription_status == '3' %}
<button type="button" class="btn btn-primary button-enable-subscription">{{ button_enable_subscription }}</button>
{% else %}
<button type="button" class="btn btn-primary button-disable-subscription">{{ button_disable_subscription }}</button>
{% endif %}
<div id="paypal_recurring" class="paypal-recurring">
{% if ((recurring_status == '2') or (recurring_status == '3')) %}
<button type="button" class="btn btn-primary button-enable-recurring">{{ button_enable_recurring }}</button>
{% else %}
<button type="button" class="btn btn-primary button-disable-recurring">{{ button_disable_recurring }}</button>
{% endif %}
</div>
<br/>
<br />
<script type="text/javascript">
$('#paypal-subscription').on('click', '.button-enable-subscription', function() {
$('#paypal_recurring').on('click', '.button-enable-recurring', function() {
$.ajax({
type: 'post',
url: '{{ enable_url }}',
data: { 'order_subscription_id' : '{{ order_subscription_id }}' },
data: {'order_recurring_id' : '{{ order_recurring_id }}'},
dataType: 'json',
beforeSend: function() {
$('#paypal-subscription .btn').prop('disabled', true);
$('#paypal_recurring .btn').prop('disabled', true);
},
complete: function() {
$('#paypal-subscription .btn').prop('disabled', false);
$('#paypal_recurring .btn').prop('disabled', false);
},
success: function(json) {
$('.alert-dismissible').remove();
Expand All @@ -34,7 +34,7 @@ $('#paypal-subscription').on('click', '.button-enable-subscription', function()
$('html, body').animate({scrollTop: 0}, 'slow');
$('#paypal-subscription').load('{{ info_url }} #paypal-subscription >');
$('#paypal_recurring').load('{{ info_url }} #paypal_recurring >');
}
},
error: function(xhr, ajaxOptions, thrownError) {
Expand All @@ -43,17 +43,17 @@ $('#paypal-subscription').on('click', '.button-enable-subscription', function()
});
});
$('#paypal-subscription').on('click', '.button-disable-subscription', function() {
$('#paypal_recurring').on('click', '.button-disable-recurring', function() {
$.ajax({
type: 'post',
url: '{{ disable_url }}',
data: {'subscription_id' : '{{ subscription_id }}'},
dataType: 'json',
beforeSend: function() {
$('#paypal-subscription .btn').prop('disabled', true);
$('#paypal_recurring .btn').prop('disabled', true);
},
complete: function() {
$('#paypal-subscription .btn').prop('disabled', false);
$('#paypal_recurring .btn').prop('disabled', false);
},
success: function(json) {
$('.alert-dismissible').remove();
Expand All @@ -69,7 +69,7 @@ $('#paypal-subscription').on('click', '.button-disable-subscription', function()
$('html, body').animate({scrollTop: 0}, 'slow');
$('#paypal-subscription').load('{{ info_url }} #paypal-subscription >');
$('#paypal_recurring').load('{{ info_url }} #paypal_recurring >');
}
},
error: function(xhr, ajaxOptions, thrownError) {
Expand Down

0 comments on commit f73eb8a

Please sign in to comment.