#greg-wallet-metrics

1 messages · Page 1 of 1 (latest)

fleet chasmBOT
woven saddle
#

greg-wallet-metrics

#

@still lotus I would recommend not doing this

still lotus
#

I see, what are the implications of doing this and has a method been developed to get this information?

woven saddle
#

It's not a good idea to try to render PRB just to get that info. IMO you don't really need to mesure that. You use PaymentElement, we render this for you and we do a lot of analysis on this ourselves

still lotus
#

We are not rendering a PRB to get this info, we are pulling it like so

 useEffect(() => {
    if (stripe) {
      const paymentRequest = stripe.paymentRequest({
        country: 'US',
        currency: 'usd',
        total: {
          label: 'Demo total',
          amount: 1000,
        },
        requestPayerName: true,
        requestPayerEmail: true,
      });
      console.log(paymentRequest);
      paymentRequest.canMakePayment().then(result => {
        if (result) {
          console.log('result', result);
        }
      });
    }
  }, [stripe]);```
woven saddle
#

Yeah but if you call canMakePayment() at the same time as another one running you'll get different results, it's a bit weird. I guess you could do it upfront before even rendering PaymentElement, or after, that might work. Just be careful how you call that method

still lotus
#

This payment request would not be associated with the one that payment elements is using internally correct?

woven saddle
#

nothing is associated, they are entirely unrelated