-
Notifications
You must be signed in to change notification settings - Fork 63
Payment status not updated after plan swap #169
Comments
Can you check this is still the case? The order payment status is updated using the webhook. Regarding the PaymentPaid event, that's also triggered when the webhook controller processes the payment update. |
Yes, it's still open there was no atempt to call the webhook since yesterday: https://prnt.sc/rexjp7 |
Is there anything in your log? |
Thank you for your response. Here are the webhook requests I received. After creation of new subscription: https://prnt.sc/rf8jmy Here are the queries ran during creation and swap After creation of new subscription: https://prnt.sc/rf9ey5 Here is the code I am using in order to swap the plans. $subscription = $listing->subscription;
// Check if user selected different plan
if($subscription && (request('plan') != $subscription->plan)){
$plans = config('cashier_plans.plans');
//User chose a more expensive plan
if($plans[request('plan')]['amount']['value'] > $plans[$listing->plan]['amount']['value']){
$subscription->swapAndInvoice(request('plan'));
}
//User downgraded to a cheaper plan
else{
$subscription->swapNextCycle(request('plan'));
}
} All I do here is checking if the user opted for a more expensive plan or downgraded to cheaper one. If you need anything else let me know. |
@DiyanDev I think I have the same issue. Could you please check my comment here: #117 (comment) ? |
Hi @DiyanDev , Are you in test mode? In test mode Mollie does not automatically update the payment status of mandated payments. You can set it manually in the browser using mollie()->payments()->get($paymentId)->_links->changePaymentState(); // yields a url string More info here. The issue @Paulsky is referring to is a race condition issue that only happens in test mode as well. Also a good one to be aware of. Does this clear things up for you? |
Ow I see... That makes sense now, I am running in test mode indeed. |
No problem, thanks for following up! |
Using the swap or swapAndInvoice functions on an existing subscription seems to swap the customer plan and charge the difference, that's fine but the created order has a payment status of "open" even tho it shows as paid on the mollie dashboard. Here are some screenshots showing what I am trying to explain:
Local payment status: https://prnt.sc/re851v
Mollie dashboard: https://prnt.sc/re86oj
Creating a new subscription works as expected and the order has a paid payment status.
I noticed that swapping plans doesn't fire any PaymentPaid event (https://prnt.sc/re8j5s)
Is this a normal behavior or I'm missing something?
The text was updated successfully, but these errors were encountered: