Skip to content

Commit 94fcdf6

Browse files
Merge pull request stripe-ruby-mock#664 from typeoneerror/payment-intent-charge
Bugfix: pass through PaymentIntent amount to mocked Charge
2 parents 8e22e15 + 099b43f commit 94fcdf6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/stripe_mock/request_handlers/payment_intents.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ def last_payment_error_generator(code: nil, message: nil, decline_code: nil)
167167
def succeeded_payment_intent(payment_intent)
168168
payment_intent[:status] = 'succeeded'
169169
btxn = new_balance_transaction('txn', { source: payment_intent[:id] })
170-
payment_intent[:charges][:data] << Data.mock_charge(balance_transaction: btxn)
170+
171+
payment_intent[:charges][:data] << Data.mock_charge(
172+
balance_transaction: btxn,
173+
amount: payment_intent[:amount],
174+
currency: payment_intent[:currency]
175+
)
176+
171177
payment_intent
172178
end
173179
end

0 commit comments

Comments
 (0)