#vgontier_api

1 messages ยท Page 1 of 1 (latest)

cosmic wyvernBOT
#

๐Ÿ‘‹ 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.

carmine ember
#

Also its on a test env.

vivid crest
#

also have the same issue with Alma

merry meadow
#

HI sorry for my late reply, checking..

#

Could you please share what guide are you following exactly, in order to try and reproduce?

carmine ember
merry meadow
#

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

cosmic wyvernBOT
vivid crest
#

then we get the autorization key which let us use the redirection

#

then we pass it to the front

carmine ember
#

We're using the payment pipeline method where we don't have to put the payment_metho_data at the confirmation.

merry meadow
#

Could you please share more details about "payment pipeline method"?

carmine ember
#
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'
merry meadow
#

@vivid crest I think you should open another thread via #help for your use case/issue

carmine ember
#

We're on the same problem actually

merry meadow
#

Ah ok you work together then..

#

Can you share how are you confirming the Payment Intent?

carmine ember
#

Yeah sorry lol

merry meadow
#

In particular how are you calling stripe.confirmPayment?

carmine ember
#

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

molten mauve
#

Hi, stepping in and catching up

carmine ember
#
"@stripe/react-stripe-js": "^2.4.0",
"@stripe/stripe-js": "^4.4.0",
...
molten mauve
#

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?

vivid crest
#
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'];

molten mauve
vivid crest
#

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

merry meadow
# carmine ember

Can you try ignore the typescript error (using @ts-ignore) and do the test again ?

carmine ember
#

well its working now ...

carmine ember
#

I dont get it

vivid crest
#

oh !

#

i have one last question i just check my test account how did the payment was achieved without the alma setting activated ?

merry meadow
#

But this is usually a miss configuration for your typescript linter..

#

It's just a typescript warning that can be ignored

carmine ember
#

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

merry meadow
vivid crest
carmine ember
# merry meadow But this is usually a miss configuration for your typescript linter..

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
vivid crest
#

modify features

molten mauve
#

Are you saying that Alma showed when you had not enabled it?

vivid crest
#

no no the payment successed even without Alma enabled

#

on both shop and account

molten mauve
#

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?

vivid crest
#

its been 24 hours the Alma feature was pending

molten mauve
#

In test mode, as long as you enabled it, it should just work. Can you confirm what mode that is on?

vivid crest
#

yes test mode but its not enabled

#

its pending ?

#

does pending mean enabled too in test mode ?

molten mauve
#

Let me test something on my end

carmine ember
#

sure, thanks for helping

molten mauve
#

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

vivid crest
#

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

molten mauve
#

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.

vivid crest
#

ok thanks a lot have a nice weekend โค๏ธ

carmine ember
#

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 ?

molten mauve
#

Is this blocking you in any way?

carmine ember
#

Yes, it will block my build and I dont want to override this

molten mauve
#

This is just a warning, how is that blocking? I thought you said it worked above

carmine ember
#

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

molten mauve
#

Let me ask a teammate who has a bit more expertise with Typescript, hang tight.

carmine ember
#

Okay thanks !

burnt jay
#

๐Ÿ‘‹

#

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?

carmine ember
#

its not working without it

#

I got the error I sent above

burnt jay
#

Oh is this a direct integration or are you using Payment Element?

carmine ember
#

API integration

vivid crest
#
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.
carmine ember
#

^

#

thats the error we have without the type prop

burnt jay
#

Ah okay you aren't using Payment Element -- sorry.

carmine ember
#

Its ok, I wasn't very clear too

burnt jay
#

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.

carmine ember
carmine ember
burnt jay
#

Yeah, not sure if we are just shifting to solely using confirmPayment() for newly integrated payment methods.

carmine ember
#

Okay do you know where and when I could have the information about this fix for Alma ?

burnt jay
#

And then you can stay updated on it via that issue.

carmine ember
#

Do you know if there is already some accounts that are integrating Alma in production like the way we are without Payment Elements ?

cosmic wyvernBOT
burnt jay
#

I don't know, sorry.

carmine ember
#

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.