File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
stripe/src/main/scala/app/softnetwork/payment/spi Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -172,15 +172,19 @@ trait StripePayOutApi extends PayOutApi { _: StripeContext with StripeTransferAp
172172 requestOptions = requestOptions.setStripeAccount(payOutTransaction.creditedUserId)
173173
174174 // load balance
175- val availableAmount =
175+ val balances : Seq [ Balance . Available ] =
176176 Balance
177177 .retrieve(requestOptions.build())
178178 .getAvailable
179179 .asScala
180- .find(_.getCurrency == payOutTransaction.currency) match {
180+ .toSeq
181+
182+ val availableAmount =
183+ balances.find(_.getCurrency.toLowerCase() == payOutTransaction.currency.toLowerCase) match {
181184 case Some (balance) =>
182185 balance.getAmount.intValue()
183186 case None =>
187+ mlog.info(s " balances -> ${new Gson ().toJson(balances)}" )
184188 0
185189 }
186190
@@ -201,15 +205,19 @@ trait StripePayOutApi extends PayOutApi { _: StripeContext with StripeTransferAp
201205 } else {
202206 // we receive funds from Stripe
203207 // load balance
204- val availableAmount =
208+ val balances : Seq [ Balance . Available ] =
205209 Balance
206210 .retrieve(requestOptions.build())
207211 .getAvailable
208212 .asScala
209- .find(_.getCurrency == payOutTransaction.currency) match {
213+ .toSeq
214+
215+ val availableAmount =
216+ balances.find(_.getCurrency.toLowerCase() == payOutTransaction.currency.toLowerCase) match {
210217 case Some (balance) =>
211218 balance.getAmount.intValue()
212219 case None =>
220+ mlog.info(s " balances -> ${new Gson ().toJson(balances)}" )
213221 0
214222 }
215223
You can’t perform that action at this time.
0 commit comments