所以我在我的應用程序中做了一個條形支付選項。當我點擊按鈕付款時,它會告訴我付款是成功的。當我去我的條紋帳戶並進行條紋測試並檢查日誌時,我可以看到我的測試支付代碼爲200 OK。但是這種付款不會顯示在條紋測試事件或條紋測試付款中。是第二天處理日誌付款還是我做錯了?條紋付款問題軌道上的紅寶石
def charge
Stripe.api_key = "some_test_api_key"
customer = Stripe::Customer.retrieve(stripe_customer_id)
if stripe_customer_id.nil?
Stripe::Charge.create(
:amount => 2500,
:currency => "cad",
:customer => stripe_customer_id,
:description => "Usage charges for #{name}"
)
end
rescue Stripe::StripeError => e
logger.error "Stripe Error: " + e.message
errors.add :base, "Unable to process charge. #{e.message}."
false
end
給予更多的上下文和代碼可以在這裏幫助。 – nicooga
def charge Stripe.api_key =「some_test_api_key」 customer = Stripe :: Customer.retrieve(stripe_customer_id) if stripe_customer_id.nil? 條紋:: Charge.create ( :量=> 2500, :貨幣=> 「CAD」, :客戶=> stripe_customer_id, \t \t描述=> 「爲#{名稱}用法費用」) end rescue Stripe :: StripeError => e logger.error「Stripe Error:」+ e.message errors.add:base,「Unable to process charge。#{e.message}。」 false 結束 這是我的方法 –
我得到我應該在日誌中的一切 –