Browse Source

[IMP] do not auto validate the subscription when the payment type is

deferred
pull/1/head
houssine 7 years ago
parent
commit
9c79a515ca
  1. 2
      easy_my_coop_online_payment/controllers/main.py

2
easy_my_coop_online_payment/controllers/main.py

@ -23,8 +23,8 @@ class SubscriptionOnlinePayment(WebsiteSubscription):
def get_subscription_response(self, values, kwargs): def get_subscription_response(self, values, kwargs):
subscription = values.get('subscription_id', False) subscription = values.get('subscription_id', False)
invoice = subscription.validate_subscription_request()[0]
if kwargs.get('payment_type') == 'online': if kwargs.get('payment_type') == 'online':
invoice = subscription.validate_subscription_request()[0]
acquirer = request.env['payment.acquirer'].search([('website_published', '=', True)])[0] acquirer = request.env['payment.acquirer'].search([('website_published', '=', True)])[0]
return website_payment().pay(reference=invoice.number, amount=invoice.residual, currency_id=invoice.currency_id.id, acquirer_id=acquirer.id) return website_payment().pay(reference=invoice.number, amount=invoice.residual, currency_id=invoice.currency_id.id, acquirer_id=acquirer.id)
else: else:

Loading…
Cancel
Save