FLUX-SE / PayumStripe

Payum Stripe gateways (with SCA support)
MIT License
28 stars 15 forks source link

API version - migrating prices #35

Closed NOaMTL closed 1 year ago

NOaMTL commented 1 year ago

Hello,

I am using PayumStripe with PayumStripeBundle on a symfony 6 project. Payment gateway is configured in the database. During the capture I get this error :

You cannot use line_items.amount, line_items.currency, line_items.name, line_items.description, or line_items.images in this API version. Please use line_items.price or line_items.price_data. Please see https://stripe.com/docs/payments/checkout/migrating-prices for more information.

Is it a PayumStripeBundle related issue or PayumStripe issue or something I need to change on my config ? It looks like it is using by default latest API version of Stripe, but some changes occured since version 2022-08-01.

Thank you.

Prometee commented 1 year ago

Hello @NOaMTL !

This has been fixed for a while in this lib : https://github.com/FLUX-SE/PayumStripe/blob/master/src/Action/StripeCheckoutSession/ConvertPaymentAction.php#L46-L59

I think you are using CoreShop or the bundle provided by it, I can see there ConvertPaymentAction is still using the old format : https://github.com/coreshop/PayumStripeBundle/blob/master/src/CoreShop/Payum/StripeBundle/Provider/LineItemProvider.php#L52-L58.

If you are not using CoreShop but another lib or shop then check the override of the ConvertPaymentAction.

NOaMTL commented 1 year ago

Hello @NOaMTL !

This has been fixed for a while in this lib : https://github.com/FLUX-SE/PayumStripe/blob/master/src/Action/StripeCheckoutSession/ConvertPaymentAction.php#L46-L59

I think you are using CoreShop or the bundle provided by it, I can see there ConvertPaymentAction is still using the old format : https://github.com/coreshop/PayumStripeBundle/blob/master/src/CoreShop/Payum/StripeBundle/Provider/LineItemProvider.php#L52-L58.

If you are not using CoreShop but another lib or shop then check the override of the ConvertPaymentAction.

I am not using coreshop, only payumbundle on a symfony 6. Strange.

Prometee commented 1 year ago

@NOaMTL ok then check the version of the lib you are using :

composer show flux-se/payum-stripe

The last version is 2.0.11.

NOaMTL commented 1 year ago

@NOaMTL ok then check the version of the lib you are using :

composer show flux-se/payum-stripe

The last version is 2.0.11.

I had 2.0.7, because I had Payum/Stripe package in my composer too.

I removed Payum/Stripe package to only use flux-se/payum-stripe and it is now working well.

Thank you for your help.

Prometee commented 1 year ago

Good 👏

I wasn't remembering that I took a screenshot of the error when I released the fix : https://github.com/FLUX-SE/PayumStripe/releases/tag/v2.0.8

Normally it should not be a problem to have the legacy payum/stripe and this lib both installed, do you saw a specific issue keeping it installed all together ?