Closed nipeco closed 2 years ago
I just expecienced this issue aswell. The payment method has an orange status on the mollie dashboard. You can try to disable and enable the payment method. Mollie gets an event an will contact you if necessay. I know that they are very busy. It took me several days to complete.
Van: Niels @.> Verzonden: donderdag 2 december 2021 14:52 Aan: mollie/laravel-cashier-mollie @.> CC: Subscribed @.***> Onderwerp: [mollie/laravel-cashier-mollie] No suitable payment methods found (Issue #17)
Hey there,
I am trying to create a subscription with the following code:
$user = App\User::find(1);
// Make sure to configure the 'premium' plan in config/cashier_plans.php
$result = $user->newSubscription('main', 'premium')->create();
But I always get the following error message: Error executing API call (422: Unprocessable Entity): No suitable payment methods found.
I have confirmed payment methods in my account and use the test api key. Everything is set up according to your installation guide. Do I miss some additional configuration in Laravel? The customer is created in the test dashboard of Mollie. It doesn't matter what I want to do, I always get the same error.
Best regards Niels
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mollie/laravel-cashier-mollie/issues/17, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAPJFMEVK6WUCAJUHL2CKQDUO52ZLANCNFSM5JHFTINA.
That's correct! Also, in test mode, any payment method you enable in the mollie dashboard should be available instantly.
That's correct! Also, in test mode, any payment method you enable in the mollie dashboard should be available instantly.
@sandervanhooft Sorry to bump this old issue, but do I understand correctly that you are saying that when using a test key, unvalidated payment methods that are active in Mollie should work? Because I am trying this right now and this does not seem to the case. Am I overlooking something?
@ArondeParon
Have you enabled the payment methods on the mollie profile the test key belongs to?
@sandervanhooft yep! They are still pending acceptance, but I'd presume that would not be required for testing.
Can you share a code sample to reproduce the issue?
Hello,
I'm having the same issue and I do not see a solution to my problem in this thread.
Like @nipeco I have used the guide of Cashier Mollie to implement the system. Everything is working when using the test apikey from Mollie. As soon as I change this apikey to live, I get the 422 error. My website is accepted by Mollie (green) and also the payments for iDeal and Bancontact are accepted (blue slider). Cashier Mollie is updated to latest version (v2.5.2)
Code for subscription:
public function subscribe(Request $request)
{
$user = Auth::user();
$plan = $request->plan;
$coupon = $request->coupon;
$name = 'Pro';
if (!$user->subscribed($name, $plan)) {
if ($coupon)
{
$result = $user->newSubscriptionViaMollieCheckout($name, $plan)->withCoupon($coupon)->create();
}
else
{
$result = $user->newSubscriptionViaMollieCheckout($name, $plan)->create();
}
// Check if user has a valid mandate
if (is_a($result, RedirectToCheckoutResponse::class)) {
return $result; // Redirect to Mollie checkout
}
return back()->with('status', 'Welcome to the ' . $plan . ' plan');
// return redirect('/abonnement');
}
return back()->with('status', 'You are already on the ' . $plan . ' plan');
// return redirect('/dashboard');
}
Error message on server 500:
[2022-09-05T12:27:37+0200] Error executing API call (422: Unprocessable Entity): No suitable payment methods found. Documentation: https://docs.mollie.com/overview/handling-errors {"userId":1,"exception":"[object] (Mollie\\Api\\Exceptions\\ApiException(code: 422): [2022-09-05T12:27:37+0200] Error executing API call (422: Unprocessable Entity): No suitable payment methods found. Documentation: https://docs.mollie.com/overview/handling-errors at /home/forge/website.com/vendor/mollie/mollie-api-php/src/Exceptions/ApiException.php:114)
I hope you can help me :)
Hi @ruudjuh87,
What amount are you trying to charge?
@sandervanhooft
Amount is 9.90 ex VAT (9,90 * 1,21 = 11,979)
config/cashier_plans:
'maand' => [
'amount' => [
'value' => '9.90',
'currency' => 'EUR',
],
'interval' => [
'generator' => AdvancedIntervalGenerator::class,
'value' => 1,
'period' => 'month', /* day, month or year*/
'monthOverflow' => true,
],
'description' => 'Maandabonnement ' . config('app.name'),
],
Hi @ruudjuh87,
I suspect this is something account specific. Best to reach out to Mollie support directly.
@sandervanhooft
Thanks for the quick response. Mollie support is saying everything is correct with my account. Website is active and iDeal and Bancontact are active also. They will forward the issue to the tech support team again.
With test_apikey I do see the payment methods, but with live_apikey they cannot be found. Hope this get resolved soon.
Hi @ruudjuh87 ,
One thing you could check for each api key:
dd(collect(mollie()->methods()->allActive())->pluck('id'));
This should give you the list of currently enabled payment methods. At least one should be supporting recurring payments for you to not get that exception message.
test_api:
^ Illuminate\Support\Collection {#529 ▼
#items: []
#escapeWhenCastingToString: false
}
live_
^ Illuminate\Support\Collection {#529 ▼
#items: array:2 [▼
0 => "ideal"
1 => "bancontact"
]
#escapeWhenCastingToString: false
}
Payment methods are being found with live_apikey.
@ruudjuh87 Can you try enabling banktransfer?
@sandervanhooft I did request the banktransfer last week but it has not been approved yet.
But I did get a response from one of the developers from Mollie and he thinks he found the issue, and it probably has to do with the banktransfer like you say. Let me explain (so other people can learn from this too :) )...
Because I want to start a subscription I need a First Payment, in order to allow recurring payments later. Right now iDeal and Bancontact are accepted and they can be used for the first payment. But because we need the method Banktransfer for the recurring payment, it throws the 422 error because the banktransfers has not been approved yet.
The problem should be resolved as soon as the Sepa Direct Debit has been approved. I will keep you updated here!
That makes sense! Thanks for following up, and for the detailed report.
Hey there,
I am trying to create a subscription with the following code:
But I always get the following error message:
Error executing API call (422: Unprocessable Entity): No suitable payment methods found.
I have confirmed payment methods in my account and use the test api key. Everything is set up according to your installation guide. Do I miss some additional configuration in Laravel? The customer is created in the test dashboard of Mollie. It doesn't matter what I want to do, I always get the same error.
Best regards Niels