Commit ac615652 by Nilu

S25645689 # Client - Incoming Issues (raised by Client) #Click Open Jobs gives "Stripe error".

parent 7adbc77e
...@@ -403,14 +403,23 @@ public class StripeUtils ...@@ -403,14 +403,23 @@ public class StripeUtils
{ {
try try
{ {
CurrencyType currency = hiringTeam.getCountry().getCurrency();
int amount = NullArith.intVal(NullArith.multiply(hiringTeam.getPPJAmount(job), 100, 0d));
int minAmount = currency == CurrencyType.GBP ? 300 : 500;
// 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<>(); Map<String, Object> chargeParams = new HashMap<>();
chargeParams.put("amount", NullArith.intVal(NullArith.multiply(hiringTeam.getPPJAmount(job), 100, 0d)));
chargeParams.put("currency", hiringTeam.getCountry().getCurrency()); chargeParams.put("amount", amount);
chargeParams.put("currency", currency);
chargeParams.put("description", "Charges of creating job"); chargeParams.put("description", "Charges of creating job");
chargeParams.put("customer", hiringTeam.getStripeReference()); chargeParams.put("customer", hiringTeam.getStripeReference());
Charge.create(chargeParams); Charge.create(chargeParams);
} }
}
catch (StripeException e) catch (StripeException e)
{ {
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while making a payment of hiringTeam stripe " + hiringTeam.getStripeReference()); LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while making a payment of hiringTeam stripe " + hiringTeam.getStripeReference());
...@@ -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