Commit 65d8d740 authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: factorize some code

parent 6f8732f1
...@@ -85,17 +85,12 @@ if batch_mode: ...@@ -85,17 +85,12 @@ if batch_mode:
return {'subscription' : subscription_request.getRelativeUrl(), return {'subscription' : subscription_request.getRelativeUrl(),
'payment': payment.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 # getTotalPayble returns a negative value
if payment_transaction.PaymentTransaction_getTotalPayablePrice() < 0: if payment_transaction.PaymentTransaction_getTotalPayablePrice() < 0:
if target_language == "zh":
return payment_transaction.PaymentTransaction_redirectToManualWechatPayment(web_site) return payment_transaction.PaymentTransaction_redirectToManualWechatPayment(web_site)
return payment_transaction.PaymentTransaction_redirectToManualFreePayment(web_site) else:
else: # Payzen payment
def wrapRedirectWithShadow(payment_transaction, web_site):
# getTotalPayble returns a negative value
if payment_transaction.PaymentTransaction_getTotalPayablePrice() < 0:
return payment_transaction.PaymentTransaction_redirectToManualPayzenPayment(web_site) return payment_transaction.PaymentTransaction_redirectToManualPayzenPayment(web_site)
return payment_transaction.PaymentTransaction_redirectToManualFreePayment(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