This gem uses the Net::HTTP library to make HTTP requests. By default this library has a read_timeout set to 60 seconds.
As production users of MangoPay API, we've seen how the API sometimes takes more than 60 seconds to respond. This is currently affecting different kind of operations, including PayIn, Refund and Transfers between wallets.
Obviously, having to wait more than 60 seconds for a response from the API is not ideal, but having Net::HTTP firing a timeout is even worse, because when that happens, MangoPay will continue processing the operation, but your app won't ever get noticed of the result, causing multiple kind of issues such as duplicated payments, which means angry customers.
This PR let gem users to increase the timeout of Net::HTTP from MangoPay.configure block:
MangoPay.configure do |c|
c.read_timeout = 120 # seconds
end
This gem uses the Net::HTTP library to make HTTP requests. By default this library has a read_timeout set to 60 seconds.
As production users of MangoPay API, we've seen how the API sometimes takes more than 60 seconds to respond. This is currently affecting different kind of operations, including PayIn, Refund and Transfers between wallets.
Obviously, having to wait more than 60 seconds for a response from the API is not ideal, but having
Net::HTTP
firing a timeout is even worse, because when that happens, MangoPay will continue processing the operation, but your app won't ever get noticed of the result, causing multiple kind of issues such as duplicated payments, which means angry customers.This PR let gem users to increase the timeout of
Net::HTTP
fromMangoPay.configure
block: