#juan_givestar

1 messages · Page 1 of 1 (latest)

toxic oxideBOT
normal spear
#

👋 happy to help

#

so basically you want to test this out?

rugged stream
#

Hello, I've tested adding ,02 to the final amount to charge, in order to trigger the specific offlie_pin_code

#

but when I get the API response, I only get a generic DeclineByStripeAPI which is not helpfull, as I need to know speifically when is an offline_pin_codeerror

normal spear
#

would you mind sharing the request ID?

gentle river
#

Hey, I work with Juan as well.

#

This flow is still in development so we do not have a request ID

#

We could trigger one in staging (test mode)? Would that help?

#

As it is a physical card test we have been using the .02 issue as Juan has said.

#

But the error that generate is DeclineByStripeAPI which i am not sure will work in production?

normal spear
#

each request to the Stripe API has a request ID

normal spear
gentle river
normal spear
#

where exactly?

rugged stream
#

We're using the SDK from the react native

normal spear
#

tap to pay is only available with our Android and iOS SDKs

rugged stream
#

on the iOS side is using the native sdk 2.23.1'

#

we are focusing now on the iOS side of it as we need to sort out this specific offline_pin_code flow with Apple ASAP.

normal spear
#

ok I'm having trouble understanding though where are you getting the error from

rugged stream
#

sure that error will come after the app process the tap to pay payment

#

when the payment is successful or not

normal spear
#

would you mind sharing your code?

rugged stream
#

sure, give me 2 secs

#
    const { paymentIntent, error } = await processPayment(paymentIntentId);

    if (error) {
      recordError(error, 'useStripeToPay:::_processPayment');
      console.log({ error });
      if (
        error.code === 'DeclinedByStripeAPI' &&
        error.message.includes('This transaction requires chip and PIN')
      ) {
        setAlertTitle('Offline PIN code error');
        onFailedPaymentCallback(error);

        return;
      }
      setAlertTitle('Transaction Failed');
      if (setConfirmationText) {
        setConfirmationText('Try Again');
      }
      extraInfo.current = error;
      setShowAlert(true);

      onFailedPaymentCallback(error);
      return;
    }

    if (!paymentIntent) {
      setAlertTitle('Something went wrong');
      setAlertMessage('Tap on Phone error');
      if (setConfirmationText) {
        setConfirmationText('Okay');
      }
      extraInfo.current = {
        code: CommonError.Failed,
        message: 'No paymentIntent',
      };
      setShowAlert(true);

      return;
    }
    if (paymentIntent?.status === 'succeeded') {
      setAlertTitle('Payment Success');
      setAlertMessage('');
      extraInfo.current = {
        code: CommonError.Unknown,
        message: '',
      };
      setShowAlert(true);

      onSuccessPaymentCallback();
    }
  };
#

the method processPayment come from the oficial Stripe hook useStripeTerminal

#

rigth now we're filtring the error when is an offline_pin_code scenario with the specific message This transaction requires chip and PIN which I dont think is ideal one

eternal oak
#

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

#

Could you print the whole error object for me please?

rugged stream
#

sure give me 2 sec

#
    "message": "This transaction requires chip and PIN. In testmode, using a physical test card with designated amount ending values produce specific decline responses. See https://stripe.com/docs/terminal/references/testing#physical-test-cards for details.",
    "code": "DeclinedByStripeAPI"
}```
eternal oak
#

I see what you mean. It might be a bug, or just a test mode issue. I will report this to the responsible team, but for now that's what seems to be a limitation.

rugged stream
#

Thanks to understand.

#

In anyways, do you know which error throws same scenario. on production?>

eternal oak
#

Test mode is supposed to work the same way as Live, so I think it's the same.

rugged stream
#

ok thanks

eternal oak
#

Happy to help.