I'm working on the marketplace application. When payout to a connect account from the platform, I want to update account's balance information and add receipt model on my application. But No signatures found matching the expected signature for payload
error occurs and I can't get payout.paid
event.
stripe.rb
StripeEvent.configure do |events|
# The case transfer created
events.subscribe(
'payout.paid',
Events::PayoutPaid.new
)
end
apps/services/events/payout_paid.rb
class Events::PayoutPaid
def call(event)
source = event.data.object
# Fetch balence information
account = source.destination
balance = Stripe::Balance.retrieve(
{stripe_account: account}
)
@user = User.find_by({
stripe_account_id: account
})
@user.balance = balance["available"][0]["amount"]
@user.save
# create receipt
@receipt = Receipt.new
@receipt.user = @user
@receipt.amount = source.amount
@receipt.save
end
end
Although other stripe webhook would work.
I was having the same problem, and the solution was to:
This is mentioned in the Stripe docs, here.