Commit 9052a704 by Harsh Shah

Finish Hotfix-20190321

parents 7adbc77e ac615652
...@@ -403,13 +403,22 @@ public class StripeUtils ...@@ -403,13 +403,22 @@ public class StripeUtils
{ {
try try
{ {
Map<String, Object> chargeParams = new HashMap<>(); CurrencyType currency = hiringTeam.getCountry().getCurrency();
chargeParams.put("amount", NullArith.intVal(NullArith.multiply(hiringTeam.getPPJAmount(job), 100, 0d))); int amount = NullArith.intVal(NullArith.multiply(hiringTeam.getPPJAmount(job), 100, 0d));
chargeParams.put("currency", hiringTeam.getCountry().getCurrency()); int minAmount = currency == CurrencyType.GBP ? 300 : 500;
chargeParams.put("description", "Charges of creating job");
chargeParams.put("customer", hiringTeam.getStripeReference()); // Stripe has a min amount for charge GBP 0.30 and other AUD, UAD, CAD, SGD, EUR 0.50
if(amount >= minAmount)
{
Map<String, Object> chargeParams = new HashMap<>();
Charge.create(chargeParams); chargeParams.put("amount", amount);
chargeParams.put("currency", currency);
chargeParams.put("description", "Charges of creating job");
chargeParams.put("customer", hiringTeam.getStripeReference());
Charge.create(chargeParams);
}
} }
catch (StripeException e) catch (StripeException e)
{ {
...@@ -420,7 +429,6 @@ public class StripeUtils ...@@ -420,7 +429,6 @@ public class StripeUtils
} }
public static void handleWebhook(HttpServletRequest request, ObjectTransaction objTran) throws FieldException public static void handleWebhook(HttpServletRequest request, ObjectTransaction objTran) throws FieldException
{ {
try try
......
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