Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
c7008ee7
Commit
c7008ee7
authored
Apr 10, 2019
by
Harsh Shah
Browse files
Options
Browse Files
Download
Plain Diff
Finish Hotfix-20190321
parents
a8397870
ac615652
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
StripeUtils.java
cmsWebApp/src/performa/utils/StripeUtils.java
+15
-7
No files found.
cmsWebApp/src/performa/utils/StripeUtils.java
View file @
c7008ee7
...
@@ -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
,
0
d
)));
int
amount
=
NullArith
.
intVal
(
NullArith
.
multiply
(
hiringTeam
.
getPPJAmount
(
job
),
100
,
0
d
));
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment