add a few sync triggers after payments

master
alice 4 years ago
parent 7fdafa8c16
commit 53f0664f23

@ -170,6 +170,8 @@ class PaypalBackend(BackendBase):
payment.status = 'confirmed' payment.status = 'confirmed'
payment.status_message = None payment.status_message = None
payment.save() payment.save()
payment.user.vpnuser.lcore_sync()
return True return True
def verify_ipn(self, request): def verify_ipn(self, request):

@ -181,6 +181,8 @@ class StripeBackend(BackendBase):
payment.user.vpnuser.on_payment_confirmed(payment) payment.user.vpnuser.on_payment_confirmed(payment)
payment.user.vpnuser.save() payment.user.vpnuser.save()
payment.user.vpnuser.lcore_sync()
def get_subscription_from_invoice(self, invoice): def get_subscription_from_invoice(self, invoice):
from payments.models import Subscription from payments.models import Subscription
@ -234,6 +236,8 @@ class StripeBackend(BackendBase):
payment.user.vpnuser.save() payment.user.vpnuser.save()
payment.save() payment.save()
payment.user.vpnuser.lcore_sync()
def webhook_subscr_update(self, event): def webhook_subscr_update(self, event):
from payments.models import Subscription from payments.models import Subscription
stripe_sub = event['data']['object'] stripe_sub = event['data']['object']

Loading…
Cancel
Save