#ya.ilya
1 messages · Page 1 of 1 (latest)
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?
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 $
Gotcha. Thanks for the code. Checking in to how to set this on the RN PaymentSheet
Okay, let me know how it goes
Looks like this is not supported yet but is being worked on https://github.com/stripe/stripe-react-native/issues/1333
I was told some time ago by another member of the Discord support staff to switch to using payment sheet from platform pay, and I was really hoping it was in a better state that platform pay, but I guess it has the same issues
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
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
Haven't tested Android yet tbh, so not sure. I assumed this attribute was specifically needed for iOS as Apple turns down all app store submissions that don't show merchant name to the user
Interestingly the code lists it as required on Android but not iOS https://github.com/stripe/stripe-react-native/blob/0cbf9fc/src/types/PaymentSheet.ts#L11-L12
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?
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
Gotcha, still looking in tot his
But I've seen a couple of people use it to show the merchant name to get Apple's approval
A user on our GH reported that setting working for them https://github.com/stripe/stripe-react-native/issues/1379#issuecomment-1542801307
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
@stripe/stripe-react-native": "0.27.0
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
Thank you
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?
Yeah sorry for that, I just didn't want to put my company's legal name anywhere in Discord so I changed it in the code
But what's showing there is the name I've put in cartItems.label
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
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
Gotcha, at least we got a bit more clarity on how this behavior works. Thanks for your patience and for testing this to confirm
If you still have time can I bring up another issue please?, Or would I need to do that separately?
I can help 👋
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
any docs you're following for this?
So when you go through setup successfully, is it invoking any PaymentSheetError conditions or just the success one?
No, it only returns this
I see. does it return anything for other test cards (non-Apple Pay cards)
No, same issue with other cards
I am using real cards though as I am not able to change our Stripe to test environment currently
What's the usecase here? Is there anything specific you're looking for in paymentOption param?
I need to get the payment method that the user added so I can charge it later, once their payment request was approved by the second party (we have a marketplace-like app)
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
I need to get the payment method that the user added so I can charge it later, once their payment request was approved by the second party (we have a marketplace-like app)
You don't need it client-side though right? Merchants typically handle this server-side
https://stripe.com/docs/payments/save-and-reuse?platform=react-native&ui=payment-sheet#charge-saved-payment-method
I do, I am changing our existing integration (which uses custom UI to capture bank card) to payment sheet, so I must do it with minimum changes to other parts of our app
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
Looking at the paymentOption interface here
https://stripe.dev/stripe-react-native/api-reference/interfaces/PaymentSheet.PaymentOption.html
I don't think it'd have the PaymentMethod object in the result.paymentOption.
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
Do you have multiple test accounts?
Could also be test mode / live mode switch
No, I am testing in the live mode as I am not able to switch our Stripe integration to test mode
I want it to return at least something so I can show user which card is being charged
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?
Yes
I want the return to not be undefined
This is the result.paymentOption that my colleague linked to?
That won't contain payment method information, based on the documentation that I am seeing
What information would it contain?
A label string and an image string
And why is it returning undefined?
That I not sure about.
Have a good rest of your day