爲了開發目的,我創建了一個主帳戶作爲開發者,並且還創建了一個「沙箱」帳戶。此帳戶也在我的儀表板中作爲v.zero部分中的SandBox帳戶進行聲明。貝寶沙箱帳號未授權
在我的應用程序,我添加了一個文件CONFIGS/paypal.yaml信息更新後的CLIENT_ID,client_secret ....它看起來像如下:
test: &default
client_id: Af9L4GJ7xxxxtp4wPQFqkL03bYYWuFius
client_secret: xxxxxx*//*
username: first.last_api2.corp.com
password: YEQZF7KGCY5SFFGC
signature: AFcWxV21C7fd0DDDDDSRl31ADLwdbXazZRfAA1zsZFfI4630wJS
app_id: Braintree-1478556332407
http_timeout: 120
mode: sandbox
sandbox_email_address: [email protected]
development:
<<: *default
with_authentication:
<<: *default
client_id: Af9L4GJ7xxxxtp4wPQFqkL03bYYWuFius
client_secret: xxxxxx*//*
我的應用程序在紅寶石中寫道,並具有把這個paypal.yaml我的config /回購後,我有開發Ruby代碼以啓動支付:
def send_payment params
begin
payout = PayPal::SDK::REST::Payout.new(get_payout_attributes params)
@@logger.info("Create a new Payout #{payout}")
result = payout.create(true)
@@logger.info("Sending Payout: #{result}")
rescue PayPal::SDK::Core::Exceptions => err
@@logger.info("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
@@logger.info("Error #{err}")
@@logger.info("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
end
result
end
get_payout_attributes只是用來獲取一些自定義的數據,如接收器,大寫金額...
任何想法,爲什麼我得到內部失敗?失敗或是來自代碼。
我不面對任何未經授權的用戶,但錯誤而失敗 - 錯誤代碼= 500 - 響應消息=內部服務器錯誤
的問題似乎從payout.create(true)
來,因爲我得到了(響應[500]:內部服務器錯誤),因爲PayPal::SDK::REST::Payout.new
不產生任何問題(響應[200]:OK)
內部錯誤不要給我太多的細節
感謝