Remove unwanted code/comments

This commit is contained in:
PCoder 2021-01-07 16:30:33 +05:30
parent ec13a71866
commit 1e67bef4f5
4 changed files with 7 additions and 23 deletions

View file

@ -471,7 +471,6 @@ class PaymentOrderView(FormView):
id_payment_method = self.request.POST.get('id_payment_method', id_payment_method = self.request.POST.get('id_payment_method',
None) None)
if id_payment_method == 'undefined': if id_payment_method == 'undefined':
# Probably user chose one of the previously saved cards
id_payment_method = address_form.cleaned_data.get('card') id_payment_method = address_form.cleaned_data.get('card')
request.session["id_payment_method"] = id_payment_method request.session["id_payment_method"] = id_payment_method
logger.debug("id_payment_method is %s" % id_payment_method) logger.debug("id_payment_method is %s" % id_payment_method)
@ -1125,8 +1124,9 @@ class OrderConfirmationView(DetailView, FormView):
def create_incomplete_intent_request(request): def create_incomplete_intent_request(request):
""" """
Persist session variables so that they could be pick up Creates a dictionary of all session variables so that they could be
in the webhook for processing. picked up in the webhook for processing.
:param request: :param request:
:return: :return:
""" """
@ -1233,6 +1233,10 @@ def do_provisioning_generic(
stripe_api_cus_id, request['id_payment_method'], stripe_api_cus_id, request['id_payment_method'],
set_as_default=True set_as_default=True
) )
"""
Identical to do_provisioning(), except for the fact that this
is specific to handling provisioning of the generic products
"""
logger.debug("Card %s associate result %s" % ( logger.debug("Card %s associate result %s" % (
request['id_payment_method'], request['id_payment_method'],
acc_result.get('response_object') acc_result.get('response_object')

View file

@ -211,24 +211,6 @@ $(document).ready(function () {
} }
}); });
window.card = cardNumberElement; window.card = cardNumberElement;
/* stripe.confirmCardPayment(
window.paymentIntentSecret,
{
payment_method: {card: cardNumberElement}
}
).then(function(result) {
window.result = result;
if (result.error) {
// Display error.message in your UI.
var errorElement = document.getElementById('card-errors');
errorElement.textContent = result.error.message;
} else {
// The payment has succeeded
// Display a success message
alert("Thanks for the order. Your product will be provisioned " +
"as soon as we receive the payment. Thank you.");
}
}); */
} }
function payWithStripe_new(e) { function payWithStripe_new(e) {
e.preventDefault(); e.preventDefault();

View file

@ -677,7 +677,6 @@ class SettingsView(LoginRequiredMixin, FormView):
msg = _("Billing address updated successfully") msg = _("Billing address updated successfully")
messages.add_message(request, messages.SUCCESS, msg) messages.add_message(request, messages.SUCCESS, msg)
else: else:
# TODO : Test this flow
id_payment_method = request.POST.get('id_payment_method', None) id_payment_method = request.POST.get('id_payment_method', None)
stripe_utils = StripeUtils() stripe_utils = StripeUtils()
card_details = stripe_utils.get_cards_details_from_payment_method( card_details = stripe_utils.get_cards_details_from_payment_method(

View file

@ -111,7 +111,6 @@ class StripeUtils(object):
@handleStripeError @handleStripeError
def update_customer_card(self, customer_id, token): def update_customer_card(self, customer_id, token):
# TODO replace token with payment intent
customer = stripe.Customer.retrieve(customer_id) customer = stripe.Customer.retrieve(customer_id)
current_card_token = customer.default_source current_card_token = customer.default_source
customer.sources.retrieve(current_card_token).delete() customer.sources.retrieve(current_card_token).delete()