Add code to differentiate between subscription and non-subscription in js

This commit is contained in:
PCoder 2021-01-01 00:07:23 +05:30
parent 9faf897818
commit a32a5af5a3
2 changed files with 5 additions and 0 deletions

View file

@ -337,5 +337,6 @@
var success_title = '{{ success_msg.msg_title }}';
var success_url = '{{ success_msg.redirect }}';
window.stripeKey = "{{stripe_key}}";
window.isSubscription = ("{{is_subscription}}" === 'true');
</script>
{%endblock%}

View file

@ -729,6 +729,10 @@ class OrderConfirmationView(DetailView, FormView):
reverse('datacenterlight:index')
},
'stripe_key': settings.STRIPE_API_PUBLIC_KEY,
'is_subscription': 'true' if (
'generic_payment_type' not in request.session or
(request.session['generic_payment_details']['recurring'])
) else 'false'
})
logger.debug("Request %s" % create_incomplete_intent_request(
self.request))