#wesleympg_unexpected

1 messages Β· Page 1 of 1 (latest)

near martenBOT
#

πŸ‘‹ 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/1350053915936296991

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

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.

spark cradleBOT
junior kite
#

I sent this yesterday, but I did't get the reply notification and the thread was closed, sorry about that.

analog bone
#

Hi there πŸ‘‹ you don't get feedback about why a wallet isn't available from canMakePayment. You'd have to review the common reasons for them to not be surfaced. Do you have a publicly accessible testsite where I can see this integration and poke around?

junior kite
#

Sure, just a second

#

Click on enter auction, chosse Avianca as airline, put this on booking code 9900100101, and fill the other fields as you please

#

oh, Sorry this environment seems to be under some issue

#

whoops I actually passed a bad booking code

#

99001001 this one is correct

analog bone
#

Do you have credentials I can use to get past the email form?

junior kite
#

Sure

#

you can select any flight to reach this screen. Then select instant purchase and you go to the payment section

analog bone
#

One thing standing out to me is that this domain isn't registered for your Stripe account.

junior kite
#

We changed the account on Monday trying to check if it was the problem

analog bone
#

It does look like Google Pay is enabled in the Payment Method Configuration for this account, so I don't suspect that to be a problem.

junior kite
#

I'll add the domain

analog bone
#

I may be missing it since the code on this site is heavily minified, but I'm not spotting a line to create a Payment Request Button.

junior kite
#

we are directly calling paymentRequest.show()

#

I mean we have a Google Pay button showing up depending on canMakePayment response

analog bone
junior kite
#

yes

#

We actually added the ExpressCheckoutElement as a way of debugging and we were able to see the Google Pay button there

near martenBOT
analog bone
#

Hm, sounds like an integration concern then.

tepid sequoia
#

πŸ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

junior kite
#

So, you are the one checking my problem from now on?

analog bone
#

Can you share your code for this?

junior kite
#

Sure

#
useEffect(() => {
    const createPaymentRequest = async () => {
      if (createPaymentRequestCount.current >= maxCreatePaymentRequestRetry)
        return;
      if (!stripe || paymentRequest) return;

      const toDisable = type == 'googlePay' ? 'applePay' : 'googlePay';
      const pr = stripe.paymentRequest({
        country: 'US',
        currency: paymentInfo.currency.toLocaleLowerCase(),
        total: {
          label: paymentInfo.description,
          amount: paymentInfo.amount,
        },
        requestPayerName: true,
        requestPayerEmail: true,
        requestPayerPhone: false,
        requestShipping: false,
        disableWallets: ['link', toDisable],
        applePay: {},
        displayItems: paymentInfo.summaryItems,
      });

      try {
        const result = await pr.canMakePayment();
        if (result && result[type]) {
          setPaymentRequest(pr);
          onPaymentAvailable();
          pr.on('paymentmethod', (event) => {
            event.complete('success');
            onPayment(event.paymentMethod);
          });
        } else {
          createPaymentRequestCount.current++;
        }
      } catch (error) {
        console.error('Error in canMakePayment:', error);
      }
    };

    createPaymentRequest();
  }, [
    onPayment,
    onPaymentAvailable,
    paymentInfo,
    paymentRequest,
    stripe,
    type,
  ]);
#

This integration also is about Apple Pay but it's working properly since we figured out we were missing the domain association files

tepid sequoia
#

will take a look give me a couple of minutes please

junior kite
#

No problem. onPaymentAvailable() only sets true a flag to show the wallet section if any of them is available

tepid sequoia
#

I'm just trying to wrap my head around this

#

why are you using the PRB and the ECE? you should migrate to ECE anyways

junior kite
#

This is on top of other apps. We have mobile apps for years now and we created this web app on top of this old flow

tepid sequoia
#

are you using this in a webview on a mobile app?

junior kite
#

I'm not sure because I did't work on them but they don't use stripe elements

tepid sequoia
#

my question is more about where are you using the PRB?

#

for a website or inside the mobile app using a webview?

junior kite
#

website

tepid sequoia
#

ok

junior kite
#

For what I could understand we are using this approach rather ECE is because our server handles the PaymentIntent related stuff and in the apps we just need to generate a payment source.

tepid sequoia
#

you can do that as well with the ECE

junior kite
#

Can you send me the docs?

#

I mean for this specific part

tepid sequoia
#

and then you can send it to the backend which can use it to confirm the Payment Intent

junior kite
#

I will present the alternative to my boss. Do you have some clue about what we did wrong in this approach?

tepid sequoia
#

why are you manually disabling Apple Pay and Google Pay

#

normally you shouldn't see both

junior kite
#

Yeah but we needed to make sure to have the option to disable it manually

tepid sequoia
#

I really recommend you start by replacing this with the ECE and once it's there we can take a look whether it's functioning or still causing issues

#

can you create a new link and send it to me so I could check why the issue is still there in the meantime?

tepid sequoia
#

and you want me to check google pay or apple pay?

junior kite
#

Google Pay. Apple Pay is working

tepid sequoia
#

ok

#

where are you testing this from?

#

the link expired?

junior kite
#

I'm testing from latest Chrome from my PC, but also tested in different Android devices with Google Pay wallet set up

#

the link is working

tepid sequoia
#

I meant which country?

junior kite
#

Oh, Brazil

#

I don't recall if people in US tested it

tepid sequoia
junior kite
#

Just a second then

tepid sequoia
#

thanks and take your time

junior kite
#

so you are redirected to that URL but you are not logged in?

#

You should be redirected logged in

tepid sequoia
#

I am logged in

junior kite
#

oh

tepid sequoia
#

but where can I test the PRB?

junior kite
#

Click on enter auction, chosse Avianca as airline, put this on booking code 99001001, and fill the other fields as you please

#

select a flight, click continue, choose Instant upgrade purchase and continue again

tepid sequoia
#

done

#

I can see now the cardElement

junior kite
#

Above the card element should be the wallet buttons

#

But as Google Pay is not available, it's empty

tepid sequoia
#

I can't find the createPaymentRequest in your source code

junior kite
#

just a second

tepid sequoia
#

oh never mind

#

I found it

junior kite
#

Okay

near martenBOT
tepid sequoia
#

the paymentRequest.canMakePayment() is returning null

junior kite
#

Yes

tepid sequoia
#

hmmm ok

#

I don't see you mounting the PRB though

junior kite
#

we directly call paymentRequest.show()

tepid sequoia
#
  paymentRequest: paymentRequest,
});
paymentRequestButton.mount("#payment-request-button");
junior kite
#

We call paymentRequest.show()

tepid sequoia
#

you're somehow disabling GooglePay as well

junior kite
#

We have a button for Apple Pay and other for Google Pay

#

is the same button but we disable the other one

tepid sequoia
#

that's not how you should be doing it

#

PRB is one component

#

not multiple

junior kite
#

We can fix that, but removing the apple pay button also didn't solve this

tepid sequoia
#

and do this const elements = stripe.elements(); const prButton = elements.create('paymentRequestButton', { paymentRequest, });

#

you need to review the way you're implementing this

junior kite
#

We tried removing Apple Pay and letting just Google Pay but it also didn't fix the problem

tepid sequoia
#

I think what you should do is the following

#

on the main page add the code from the link I sent you just for testing

#

without the cards element

#

just the PRB

#

and let's test it there

junior kite
#

Okay

tepid sequoia
#

once you do please ping @cosmic plinth who will take over from there

junior kite
#

Sure

tepid sequoia
#

don't add anything in the disableWallets for now

#

and let's see how it goes

junior kite
#

@cosmic plinth I can see the Link payment button but still no Google Pay

cosmic plinth
#

Hi. I'm taking over from my colleague. Please, give me a moment to catch up.

#

Could you please share a screenshot?

junior kite
cosmic plinth
#

Or share the link ou have there?

junior kite
#

I did't push this changes to the stage environment but I could do it, but if you can easily open chrome with --disable-web-security (needed to avoid CORS issues) I could send you this link which is running on my machine

#

So, which one?

cosmic plinth
#

Could you send me the local link?

junior kite
#

Click on enter auction, chosse Avianca as airline, put this on booking code 99001001, and fill the other fields as you please

#

select a flight, click continue, choose Instant upgrade purchase and continue again

cosmic plinth
#

Ok, still running into issues. I guess it will be easier if you deploy on staging.

junior kite
#

Okay

#

It will be up in about 15 minutes

cosmic plinth
#

I will need to step away. I actually think it makes more sense to turn this into a support case, since this coversation was going on for a while. This way we won't loose context:

near martenBOT
#

Hello @junior kite, we have sent you a direct message, please check it at https://discord.com/channels/@me/1350091156750467247

  • πŸ”—The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
junior kite
#

Okay