Skip to content

Commit

Permalink
fix: ceil transfer number to integer because stripe doesnt take floats
Browse files Browse the repository at this point in the history
  • Loading branch information
vackca committed Jul 7, 2023
1 parent 8106e71 commit 3f76624
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ class Stripe extends Abstract {
}

const { id } = await this.sdk.transfers.create({
amount: transfer.amount * payoutCoeff,
amount: Math.ceil(transfer.amount * payoutCoeff),
currency: 'usd',
destination: transfer.destinationUser,
});
Expand All @@ -1195,7 +1195,7 @@ class Stripe extends Abstract {
transactionId: id,
userId: transfer.userId,
entityId,
amount: transfer.amount * payoutCoeff,
amount: Math.ceil(transfer.amount * payoutCoeff),
type: TransactionType.DEBIT,
status: TransactionStatus.INITIAL,
product: {
Expand Down

0 comments on commit 3f76624

Please sign in to comment.