#ya.ilya

1 messages · Page 1 of 1 (latest)

agile pathBOT
potent shuttle
#

Hello, good questions. Checking in to whether there is a way to do this

#

Is that $0 a value that you provided somewhere? Or is it the default when you are using SetupIntents?

ruby relic
#
    const cartItems = [{
      paymentType: 'Immediate',
      label: 'Company name',
      amount: '0.00',
      isPending: false,
    }];

    const { error } = await initPaymentSheet({
      merchantDisplayName: 'Company name',
      customerId: customer,
      customerEphemeralKeySecret: ephemeralKey,
      setupIntentClientSecret: clientSecret,
      applePay: {
        merchantCountryCode: 'GB',
        currencyCode: 'GBP',
        cartItems,
      },
      style: 'automatic',
      googlePay: {
        merchantCountryCode: 'GB',
        testEnv: true,
      },
      returnURL: Linking.createURL('/'),
      allowsDelayedPaymentMethods: true,
    });
#

So I am using setup intent to collect the user's payment method, which is why it's a 0 value, but I've set it to use GBP everywhere I could and still it shows $

potent shuttle
#

Gotcha. Thanks for the code. Checking in to how to set this on the RN PaymentSheet

ruby relic
#

Okay, let me know how it goes

potent shuttle
ruby relic
#

Do you know what the issue with merchantDisplayName not doing anyhting could be caused by?

#

As it was one of the reasons I ditched my platformPay implementation, because it didn't include this attribute

agile pathBOT
potent shuttle
#

Not sure on that one, looking in to what may be happening with merchantDisplayName

#

Is the name displaying properly for Google Pay?

#

This may just be part of how Apple Pay displays though I am still figuring out what is expected here

ruby relic
potent shuttle
#

Also in your screenshot, I assume the second red blob is covering up your account's name? And here we are trying to set it up to be a different string that more accurrately describes your business?

ruby relic
# potent shuttle Also in your screenshot, I assume the second red blob is covering up your accoun...

So the bottom red blob is the cart label, from what I understand it's supposed to contain the name of the product you're purchasing as you can see here https://github.com/stripe/stripe-react-native/blob/0cbf9fc1cc74d1739b8bed2a0e28e881c9150c97/example/src/screens/PaymentSheetWithSetupIntent.tsx#L71C13-L71C13

GitHub

React Native library for Stripe. Contribute to stripe/stripe-react-native development by creating an account on GitHub.

potent shuttle
#

Gotcha, still looking in tot his

ruby relic
#

But I've seen a couple of people use it to show the merchant name to get Apple's approval

potent shuttle
#

As in merchantDisplayName

#

What version of the library are you on? There may be a bug in the version you are using, I can look at the changelog to see if there was a fix at some point

ruby relic
#

@stripe/stripe-react-native": "0.27.0

potent shuttle
#

It looks like that user was likely using that same version or an earlier one based on when they posted

#

I will consult my colleagues on this, it really looks like this should be exactly how this parameter is used. Not sure why it isn't working for you

ruby relic
#

Thank you

potent shuttle
#

As far as I can see that merchantDisplayName really should be exactly way shows in that second red blob in your screenshot

#

I am a bit confused, it looks like you are setting the merchant display name and cart label to "Company name" but it looks like the string in the screenshot starts with a W

#

Do you recognize that string that begins with a W? Do you know where it is coming from if not your code?

ruby relic
#

But what's showing there is the name I've put in cartItems.label

potent shuttle
#

Totally fine, just trying to get a better idea of what is happening

#

If you don't include a cart label do we use the string that you provide for merchantDisplayName?

#

This is sounding like it may be a bug in how these settings interact, if the cart label overrides the merchant name, I think it would be best to open an issue on our GH with example code so our RN devs can reproduce and address

ruby relic
#

Let me try removing the label quickly

#

You are right

#

Without just the label, it doesn't show anything at all

#

But removing cartItems makes it show up like this

#

Where Company abc is set with merchantDisplayName

#

I think we'll need to submit the app to the app store and see what Apple have to say about this

potent shuttle
#

Gotcha, at least we got a bit more clarity on how this behavior works. Thanks for your patience and for testing this to confirm

ruby relic
#

If you still have time can I bring up another issue please?, Or would I need to do that separately?

gray hinge
#

I can help 👋

ruby relic
#

Thank you, I'll need a couple of minutes to reproduce the issue I am having

#

So, I'm using PaymentSheet for Apple Pay and I am not able to retrieve the paymentOption from Apple Pay, even though I can see in the payment seheet that a new card was added

#
  const openPaymentSheet = async () => {
    if (!clientSecret) {
      return;
    }
    setLoading(true);
    const output = await presentPaymentSheet();
    const { error } = output;
    console.log(output);
    if (!error) {
      console.log('Success', 'The payment was confirmed successfully');
      showMessage({
        message: 'Added new payment method',
        type: 'default',
      });
    } else if (error.code === PaymentSheetError.Failed) {
      console.log(
        `PaymentSheet present failed with error code: ${error.code}`,
        error.message
      );
    } else if (error.code === PaymentSheetError.Canceled) {
      console.log(
        `PaymentSheet present was canceled with code: ${error.code}`,
        error.message
      );
    }
    setPaymentSheetEnabled(false);
    setLoading(false);
  };
#

The output results to {"paymentOption": undefined}

#

Same with when I am adding a card through the payment sheet

gray hinge
#

any docs you're following for this?

gray hinge
#

So when you go through setup successfully, is it invoking any PaymentSheetError conditions or just the success one?

ruby relic
gray hinge
#

I see. does it return anything for other test cards (non-Apple Pay cards)

ruby relic
#

I am using real cards though as I am not able to change our Stripe to test environment currently

gray hinge
#

What's the usecase here? Is there anything specific you're looking for in paymentOption param?

ruby relic
agile pathBOT
ruby relic
#

Using a disposable virtual card though I get an error in my bank app saying that "Your disposable virtual card can't be used for recurring payments" though I haven't used recurring payment anywhere in my implementation

gray hinge
ruby relic
#

So I need it in the front end

#

What's interesting is that I am not seeing anything in the Stripe dashboard for the user I am testing this with

#

No new logs, nothing

gray hinge
ruby relic
#

It also shows only one payment method in the dashboard, while in the payment sheet on my phone I'm seeing a dozen of them that I've added while testing

gray hinge
#

Do you have multiple test accounts?
Could also be test mode / live mode switch

ruby relic
#

No, I am testing in the live mode as I am not able to switch our Stripe integration to test mode

ruby relic
modest drum
#

HI 👋

I'm jumping in as @gray hinge needs to go. So you want to display information about the payment method about to be charged to the user?

ruby relic
#

Yes

ruby relic
modest drum
#

This is the result.paymentOption that my colleague linked to?

modest drum
#

That won't contain payment method information, based on the documentation that I am seeing

ruby relic
#

What information would it contain?

modest drum
#

A label string and an image string

ruby relic
#

And why is it returning undefined?

modest drum
#

That I not sure about.

ruby relic
#

Have a good rest of your day