Commit 5a9e59fd authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: factorize some code

parent c8b3c748
......@@ -85,17 +85,12 @@ if batch_mode:
return {'subscription' : subscription_request.getRelativeUrl(),
'payment': payment.getRelativeUrl() }
if target_language == "zh": # Wechat payment
def wrapRedirectWithShadow(payment_transaction, web_site):
def wrapRedirectWithShadow(payment_transaction, web_site):
# getTotalPayble returns a negative value
if payment_transaction.PaymentTransaction_getTotalPayablePrice() < 0:
if target_language == "zh":
return payment_transaction.PaymentTransaction_redirectToManualWechatPayment(web_site)
return payment_transaction.PaymentTransaction_redirectToManualFreePayment(web_site)
else: # Payzen payment
def wrapRedirectWithShadow(payment_transaction, web_site):
# getTotalPayble returns a negative value
if payment_transaction.PaymentTransaction_getTotalPayablePrice() < 0:
else:
return payment_transaction.PaymentTransaction_redirectToManualPayzenPayment(web_site)
return payment_transaction.PaymentTransaction_redirectToManualFreePayment(web_site)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment