[fix] validate minimum transaction amount in Payment Request for selected payment gateway (#13328)

This commit is contained in:
Saurabh 2018-03-19 18:29:01 +05:30 committed by Rushabh Mehta
parent 3d85951c1f
commit 2777fd4332

View File

@ -78,6 +78,9 @@ class PaymentRequest(Document):
controller = get_payment_gateway_controller(self.payment_gateway)
controller.validate_transaction_currency(self.currency)
if hasattr(controller, 'validate_minimum_transaction_amount'):
controller.validate_minimum_transaction_amount(self.currency, self.grand_total)
return controller.get_payment_url(**{
"amount": flt(self.grand_total, self.precision("grand_total")),
"title": data.company.encode("utf-8"),