#alexandremotion_api

1 messages ยท Page 1 of 1 (latest)

visual loomBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1219633262947860619

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

jade hemlockBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

warm thorn
#

Hi there ๐Ÿ‘‹ no, that association can only be set up using the ID of the Product. If you're not sure what that is, you can retrieve your Products and iterate through the results until you find the ID you're looking for:
https://docs.stripe.com/api/products/list

Alternatively, you can try searching for the Product that you're looking for to locate its ID:
https://docs.stripe.com/api/products/search

runic crest
#

The issue is that products are created automatically when the checkout session is complete, so we can't reach his product_id

#

It's juste because Prestashop can't apply coupon code to delivery fees but Stripe applies their coupons to products + delivery fees, so we have a difference between the Prestashop price and the Stripe price

warm thorn
#

Hm, can you elaborate on that a bit, Products typically aren't created after the checkout is completed, but I don't know how Prestashop integrated with Stripe so they may be do something I haven't seen before.

Are they using price_data and product_data when creating the Checkout Sessions to create Prices and Products in an adhoc fashion?

runic crest
#

I didn't check all the plugin code but i think so

#

This is my Prestashop Checkout

#

And this is my Stripe Checkout

#

It's create two products : one for the real product and one for the delivery fees

warm thorn
#

And this is all being done by Prestashop's integration? They're showing you something in their UI that is different from the Checkout Session they then create for you?

runic crest
#

In the original plugin, we can't use Prestashop coupon to send it to Stripe Checkout
So we override the module so if the customer use a specific Prestashop coupon, we apply a specific Stripe coupon

#

We just want to offer 10% reduction for the first customer's subscription

warm thorn
#

I'm not sure if you'd be able to accomplish that while also leveraging the integration that Prestashop is providing you.

Are you looking to build your own integration to replace the prebuilt one you're using?

If not, I think this question may be better suited for Prestashop, I'd expect them to be able to provide more guidance regarding whether their plugin can support what you're trying to accomplish.

runic crest
#

We tried to override the initial plugin because it accomplish everything we want except for this 10% reduction for the first subscription

#

We tried to contact the plugin's developer but he can't do anything for us, so we wanted to try to override his plugin to do this

warm thorn
#

Gotcha. If you're replacing their solution, then it sounds like we can ignore the they're providing you as you won't use it.

Since you're going to take control of the flow, you should be able to create your Products as needed, create a Coupon using the ID of those Products, and then create Checkout Sessions using those Products and Coupons for your customers.

runic crest
#

Ok thanks for your time