DEV Community

Venvaukt MachineOne
Venvaukt MachineOne

Posted on

Need Help with Recharging Customers After Initial Payment

Hello Stripe Developer Support,

I’m working on a PrestaShop module for a client and need help implementing an after-sale charge. The goal is to automatically charge a customer again on the thank-you page, using the same payment method from their last order.

🔹 What I’ve Tried:
Retrieved the PaymentIntent ID from the last order.
Attempted to reuse the same PaymentMethod but got this error:
❌ "This PaymentMethod was used without being attached to a Customer and may not be used again."
Also tried fetching the customer’s saved PaymentMethod, but sometimes it doesn’t exist.
❓ My Questions:
1️⃣ What are the necessary parameters I should save when processing the first payment?
2️⃣ How can I correctly charge the customer again using the same payment method?
3️⃣ Should I use SetupIntents to store payment details upfront for future payments?

I’d really appreciate any guidance or best practices for handling this! Thanks in advance.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️