I use commerce for subscriptions. We design a twig page to show subscriber's payment history.
For some reasons, the very last purchase don't show as we need to perform a "refresh-payments" (From commerce\controllers\SubscriptionsController actionRefreshPayments function) exactly like the one on CP. (See image).
But obviously, we want the user to see immediately his latest purchase without adding such a button. I don't understand where are actual data located and what makes the refresh button to get the latest purchase available from now on, but at least I'd like to perform the refresh before the page is shown.
So before searching any deeper, I wonder if there's a way I can perform that call in twig. (I'm a back-end php guy, learning how to reproduce behavior in twig).
name="action" value="commerce/subscriptions/refresh-payments"
). If I look at the controller, what it does, it find the Gateway and perform a refreshPaymentHistory to this Gateway. I want to perform it before I show the page, the get the latest lines from Stripe.refreshPayments
that the expected transaction will be posted yet. 😔{% do subscription.gateway.refreshPaymentHistory(subscription) %}