laravel/cashier-mollie

Guzzle timeout when trying to create a new customer.

garethwi opened this issue · 5 comments

I have installed cashier, but when I try to create a new customer as specified in the example:

cURL error 28: Resolving timed out after 2068 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.mollie.com/v2/customers. Request body: {"email":"xxxxxx@xxxxxxx.com","name":"Xxxxx Xxxxx"}

However, when I try to create a customer using Http::post, it works fine:

$something = Http::withHeaders([
"Accept" => "application/json",
"Authorization" => "Bearer test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"User-Agent" => "Mollie/2.35.0 PHP/8.0.2 Guzzle/7 MollieLaravel/2.14.0 MollieLaravelCashier/1.16.2",
"Content-Type" => "application/json",
"X-Mollie-Client-Info" => "Darwin Gareths-MacBook-Pro.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64"
])->post(
'https://api.mollie.com/v2/customers',
[
"email" => "xxxxxx@xxxxxxx.com",
"name" => "Xxxxxx Xxxxxxxxx"
]
);

I've been in touch with Mollie and they recommended me contacting you here.

This seems like a networking issue.

  • Where are you located?
  • Are you making the calls from the exact same infrastructure setup? I.e. Docker can block outgoing requests.

Hi, It is a network error, because when I connect to the internet via my phone, I get the expected webhook error.

I'm in Zeist, NL, and am making both calls through the same setup.

The things that bothers me is that cashier_mollie gives this error, but Http::post doesn't.

Are there default settings which differ from the standard Laravel ones?

Cashier is not using Laravel's HTTP wrapper, but Guzzle directly.

The Guzzle client configured for Mollie has a 2s connection timeout, so this may cause the discrepancy.

Closing this for now, let me know if it should be reopened.