0
我正在用rails 5構建一個市場。我可以使用'stripe gem'
來設置「自定義託管帳戶」,使用stripe connect。條紋託管帳戶webhooks和rails
我還使用'stripe_event gem'
來捕捉來自條紋的webhook。我可以使用標準條紋帳戶沒有任何問題。
但是,使用條連接我得再添account attribute
某處當基於stripe docs。由於正在掛鉤的事件不存在於主條帶帳戶中,而是存在於已關聯帳戶中。
它使總體感覺我只是不知道如何更新我的班級這樣做。
Stripe.api_key = Rails.configuration.stripe[:secret_key]
class RecordAccount
def call(event)
myevent = event.data.object
#Look up StripeAccount in our database
stripe_account = StripeAccount.where(stripe_id: myevent.account).last
#Record Verification details and status in StripeAccount
u = stripe_account.update_attributes(
verification_status: myevent.legal_entity.verification.status,
verification_details: myevent.legal_entity.verification.details,
)
u.save
end
end
StripeEvent.configure do |events|
events.subscribe 'account.updated', RecordAccount.new
end
我從上面得到的迴應是404-事件XXXX未找到。這是有道理的,但我該如何解決它。我知道這是一個簡單的答案,我只是一直在看屏幕太久。
你是死的傳奇! –