Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every payment creates a new product in Stripe #339

Open
tomfischerNL opened this issue Feb 7, 2023 · 18 comments
Open

Every payment creates a new product in Stripe #339

tomfischerNL opened this issue Feb 7, 2023 · 18 comments
Assignees

Comments

@tomfischerNL
Copy link

Hi @andrelopez, every time a paymentForm is submitted, in Stripe a new product is created. This is very unhandy to check statistics in Stripe about sales per product etc. Is it possible to link a paymentForm/Payment to a specific Stripe product?

Thanks in advance!

@andrelopez andrelopez self-assigned this Feb 8, 2023
@andrelopez andrelopez added the enhancement New feature or request label Feb 8, 2023
@tomfischerNL
Copy link
Author

Did you understand my problem? Let me know if it is something that you can fix? :)

@andrelopez
Copy link
Member

Yes, I identified the issue. I'll dig into it

@andrelopez
Copy link
Member

Hi @tomfischerNL Does this happens only on subscriptions?

@tomfischerNL
Copy link
Author

Hi @andrelopez, no, also to every paymentForm as well.

@tomfischerNL
Copy link
Author

Hi @andrelopez, what is the cuurent status?

@tomfischerNL
Copy link
Author

@andrelopez, can you please fix this?

@andrelopez
Copy link
Member

Hi @tomfischerNL I apologize for the delay in responding to your message. I understand that you are looking to attach a payment form with a Product (Price). I'd be happy to assist you with that.

Stripe Payments Pro will help you to achieve this you'll first need to synchronize your product and prices. You can refer to our documentation on how to sync your product and prices for detailed instructions.

Once you have synchronized your product and prices, you can use the Checkout Twig tag to create the payment form. We have provided various examples in our documentation to guide you through the process. You can find them here.

If you have any further questions or need additional assistance, please feel free to reach out. I am happy to help!

Also, you can find a video tutorial on how to use the new Checkout twig tag starting here at 01:10:00 and ending here at 01:26:00

@andrelopez andrelopez added need more info and removed enhancement New feature or request labels May 23, 2023
@tomfischerNL
Copy link
Author

tomfischerNL commented Aug 1, 2023

Hi @andrelopez, we use the Stripe Payments Pro, but not the checkout tag because we need a lot of extra data of the customer so that is why we use the form with the fields. But not synced with our products, because the plug-in created already hundreds of products.

Every time we render the {{ craft.enupalStripe.paymentForm('form', paymentOptions) }} , it creates a new product in. Stripe, but is is unnecessary, because we add the lineItems manually.

 lineItems : [
                {
                    "price": entry.stripePriceId,
                    "quantity": 2
                }
            ]

Why does it make a new product in stripe every time...

@tomfischerNL
Copy link
Author

@andrelopez , did you see my comment?

@andrelopez
Copy link
Member

@tomfischerNL I am looking into this now

@andrelopez
Copy link
Member

@tomfischerNL could you please share your plugin and craft cms version? also if you can share the full example of your paymentOptions variable on your templates?

@tomfischerNL
Copy link
Author

Hi @andrelopez,

Stripe Payments: 5.3.1
Craft version: 4.5.2

This is the code that i'm using:

       {% set paymentOptions = {
            checkoutImages: {0: entry.image is not empty ? entry.image[0].getUrl('image') },
            checkoutSuccessUrl: currentUrl ~ '/thanks?o={number}',
            checkoutCancelUrl: currentUrl ~ '?a=canceled',
            removeDefaultItem: true,
            lineItems : [
                {
                    "price": currentBook['stripePriceId'],
                    "quantity": 1
                }
            ]
        } %}

        {{ craft.enupalStripe.paymentForm('paymentFormBook', paymentOptions) }}

So nothing special. But after every payment there will be a new product in Stripe as mentioned before.

@andrelopez
Copy link
Member

andrelopez commented Oct 27, 2023

Hi @tomfischerNL I was unable to recreate your issue, I created a Product 2023 on Stripe with a one-time payment price, and this price_id looks correctly associated with the payment on Stripe. No new product created on my side.

Could you please send me a screenshot to see how it looks? you can use [email protected] if you want.

Also, what Stripe API version are you using? you can check this under the Stripe Dashboard -> Developers

Screenshot 2023-10-27 at 7 34 59 am

@andrelopez
Copy link
Member

Also, are you using Stripe Checkout ?

@andrelopez
Copy link
Member

Also, are you using the beforeCreateSession on a custom plugin? I remember you were trying to pass custom params a while ago here, may be worth checking any custom plugin or module. To start debugging I need to recreate the issue on my local dev

@tomfischerNL
Copy link
Author

hi @andrelopez ,

I will send you an email with more info ;) Better then here on github.

@tomfischerNL
Copy link
Author

tomfischerNL commented Nov 3, 2023 via email

@tomfischerNL
Copy link
Author

tomfischerNL commented Nov 17, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants