#vgontier_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1314595392457015359
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Also its on a test env.
also have the same issue with Alma
HI sorry for my late reply, checking..
Could you please share what guide are you following exactly, in order to try and reproduce?
No worries, I am following these guides from the doc :
https://docs.stripe.com/payments/alma/accept-a-payment
https://docs.stripe.com/payments/alma#supported-currencies
Which flow? Direct APi ?
If so, you are missing to send :
confirmParams: {
payment_method_data: {
type: 'alma',
},
// Return URL where the customer should be redirected after the authorization
return_url: ${window.location.href},
},
when you confirm the payment
we have a backend which create the payment intent with Alma as the only payment method
then we get the autorization key which let us use the redirection
then we pass it to the front
We're using the payment pipeline method where we don't have to put the payment_metho_data at the confirmation.
Could you please share more details about "payment pipeline method"?
No overload matches this call.
The last overload gave the following error.
Object literal may only specify known properties, and 'type' does not exist in type '{ billing_details?: BillingDetails; allow_redisplay?: "always" | "limited" | "unspecified"; }'.ts(2769)
payment-intents.d.ts(1453, 3): The expected type comes from property 'payment_method_data' which is declared here on type 'ConfirmPaymentData'
@vivid crest I think you should open another thread via #help for your use case/issue
We're on the same problem actually
Ah ok you work together then..
Can you share how are you confirming the Payment Intent?
Yeah sorry lol
In particular how are you calling stripe.confirmPayment?
I tried adding the payment_method_data as you mentionned but got the error above ^
Im working on React using directly the hook provided by Stripe library
Hi, stepping in and catching up
"@stripe/react-stripe-js": "^2.4.0",
"@stripe/stripe-js": "^4.4.0",
...
Stepping back here... The reason why you see this error on the confirmation call, https://dashboard.stripe.com/test/logs/req_yJbojIenooXlUV is because you have not added a payment method. We document how payment intents statuses work here: https://docs.stripe.com/payments/paymentintents/lifecycle
After you initialize the Elements, are you getting redirected: https://docs.stripe.com/payments/alma/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#submit-payment like it's shown here: https://docs.stripe.com/payments/alma#payment-flow?
You cannot confirm this PaymentIntent because it's missing a payment method. To confirm the PaymentIntent with cus_RLjhme6dasWN4s, specify a payment method attached to this customer along with the customer ID.
``` i have this error in the stripe logs
because Alma is removed from the payment method setup on the PI
$params['payment_method_types'] = ['alma'];
That is because there is not payment method attached to the customer. You can pass the customer id, and if you intend to save the payment method on the customer, you would want to pass this: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-setup_future_usage
Let's back up, what are you really trying to achieve here? Are you not following this guide, https://docs.stripe.com/payments/alma/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api?
we have done everything in this guide
on the PI creation we get alma
but on the confirmation we still have the payment method Alma but we get the error i sent above
Can you try ignore the typescript error (using @ts-ignore) and do the test again ?
sure lemme see
well its working now ...
are our versions of @stripe librairies outdated ?
I dont get it
oh !
i have one last question i just check my test account how did the payment was achieved without the alma setting activated ?
So the latest version of React JS Stripe SDK is v3.0.0
https://github.com/stripe/react-stripe-js
But this is usually a miss configuration for your typescript linter..
It's just a typescript warning that can be ignored
I've never had this problem before, cause I've already integrated apple_pay, google_pay and even bancontact that is alsmost similar in the config
What you mean exactly by "activated"?
on the settings of the account we have added the payment options alma but its pending activation but the test payment successed even with the Alma payment options not activated
I dont think so since the *type * props doesnt even exist in the type here :
* An object to attach additional billing_details to the PaymentMethod created via Elements.
*
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data
*/
payment_method_data?: {
/**
* The customer's billing details. Details collected by Elements will override values passed here.
* Billing fields that are omitted in the Payment Element via the `fields` option required.
*
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data-billing_details
*/
billing_details?: PaymentMethodCreateParams.BillingDetails;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
*/
allow_redisplay?: 'always' | 'limited' | 'unspecified';
};```
Edit : the type comes from the stripe-js library not the react-stripe-js one
Are you saying that Alma showed when you had not enabled it?
if you had not enable Alma it should not work. I'm surprised by this behavior. Are you sure you someone had not disabled it/ enabled it on the same account?
its been 24 hours the Alma feature was pending
In test mode, as long as you enabled it, it should just work. Can you confirm what mode that is on?
yes test mode but its not enabled
its pending ?
does pending mean enabled too in test mode ?
Let me test something on my end
sure, thanks for helping
From my test, in test mode it just becomes Active right away
As soon as you enable it in Test mode, it would work right away
However, in Live mode it's expected to take some time
If you tried tha same request in Live mode, it should not work
okay and on the shop ?
is it mandatory to have Alma activated on each shop and account ?
or is it just for the live mode
It needs to be enabled on each account, in whichever mode you're attempting to accept the payment method id. If it's live mode, then yes in live mode. If it's in test mode, then in test mode.
ok thanks a lot have a nice weekend โค๏ธ
Thanks for that, but I Still need to understand the type issue
do you have any information on when the type props has been implemented on the interface ConfirmPaymentData -> payment_method_data object for stripe-js library ?
Is this blocking you in any way?
Yes, it will block my build and I dont want to override this
This is just a warning, how is that blocking? I thought you said it worked above
There is a reason if the props is not on my stripe js version and I need to understand why
Yes its a warning but have a CI CD pipeline that check for typescript issues that are legit in that case
And I wont override this for good reasons
the type seems to be missing
even on the last version of stripejs
or there s something that I dont understand
Let me ask a teammate who has a bit more expertise with Typescript, hang tight.
Okay thanks !
๐
Yeah Alma is a new payment method type so I assume the Stripe.JS types just haven't been updated to include it yet.
But checking
Hmm wait why are you passing type there at all? That should not be required here
What happens if you just omit type from payment_method_data?
Oh is this a direct integration or are you using Payment Element?
API integration
payment_intent_unexpected_state
You cannot confirm this PaymentIntent because it's missing a payment method. To confirm the PaymentIntent with cus_RLjhme6dasWN4s, specify a payment method attached to this customer along with the customer ID.
Ah okay you aren't using Payment Element -- sorry.
Its ok, I wasn't very clear too
Hmm seems we built Alma differently here for some reason -- I haven't tested integrating it myself actually. But I would have expected there to be a confirmAlmaPayment() method here like we have with our other payment method types when you integrate them directly.
Overall, this is a gap in our types right now.
So I'll flag that internally.
But for now you have to ignore the error.
I was expecting that too cause they were a confirmBancontactPayment for my other integration and I was expecting to find the same for alma
Okay we'll wait then until you fix this
Yeah, not sure if we are just shifting to solely using confirmPayment() for newly integrated payment methods.
Okay do you know where and when I could have the information about this fix for Alma ?
I'd recommend filing an issue at https://github.com/stripe/stripe-js about this. That will also help the team to prioritize fixing this.
And then you can stay updated on it via that issue.
Do you know if there is already some accounts that are integrating Alma in production like the way we are without Payment Elements ?
I don't know, sorry.
I will do that thanks
Thanks for the help too, if you need more information about the issue don't hesitate to contact me on discord or directly by mail : vivien.gontier@paygreen.fr.
Have a peaceful rest of your day.