#dash-reactnative-defaultpm
1 messages · Page 1 of 1 (latest)
@true cipher is this using our stripe-ios SDK or using React Native, or something else?
Can you share some exact code? Sorry I know nothing about React Native and no one on my team is around who knows anything about it so I want to make sure I have enough information before I can ping someone
yes, of course
dash-reactnative-defaultpm
const onUpdatePayment = useCallback(async () => {
setReady(false);
const response = await getStripeIntentKeys();
const stripeCustomer = await getStripeCustomer();
if (
stripeCustomer &&
stripeCustomer.id &&
response &&
response.setupIntent &&
response.ephemeralKey
) {
const { setupIntent, ephemeralKey } = response;
const { error } = a
wait initPaymentSheet({
customerId: stripeCustomer.id,
customerEphemeralKeySecret: ephemeralKey,
setupIntentClientSecret: setupIntent,
merchantDisplayName: "Tap Hero Inc.",
applePay: {
merchantCountryCode: "US",
},
});
if (error) {
Alert.alert(`Error code: ${error.code}`, error.message);
} else {
setReady(true);
}
} else {
console.log(":response", response);
}
}, [getStripeIntentKeys]);
const onPresentPaymentSheet = useCallback(async () => {
const { error, ...rest } = await presentPaymentSheet();
console.log(":rest", rest);
if (error) {
Alert.alert(`Failed to update payment method:`, error.message);
} else {
// refetch
getStripePaymentMethods();
}
}, [getStripePaymentMethods]);
thanks, I'll see if I can get someone to confirm. I'm 99% sure this is not something we support at all today because the concept of a "default PaymentMethod" only works for Billing/Invoicing and not normal payments
of course. I can adjust if this is no longer supported. I found this from the documentation. But i understand that through invoicing, by creating an invoice with this attribute: collection_method: "charge_automatically", that it will attempt to charge the default payment method
which unfortunately the Customer cannot set at all without the platform's intervention of having to do it for them through the Dashboard UI
yeah I am fairly confident you have to build your own UI for this really.
woof okay
that tracks then with how this is laid out if this is no longer supported
do you know when this was removed support?
I have never heard of this working before so I'm not sure why you call this no longer supported unfortunately but if you have more details I'm happy to look
I guess my question is more along the lines of outside of having to build your own UI or using the dashboard for collecting the payment information, what was the standard way of setting my default payment method as a customer since this widget only appends to your payment methods
yeah sorry I'm really lost now
why would you use the Dashboard to collect payment information?
Like the person entering payment details is the end customer, the human paying for a service right?
sorry for the confusion. I think you answered my question by saying i should just build the UI for accepting payments
I will just use the Stripe Mobile Elements which seems to be what you're referring to
Hum
I don't really get it, you can use PaymentSheet to let them control their PaymentMethod and add a new one or remove one
and then you can have your own UI component to just show their list of PaymentMethods and decide which one should be the default
right but it doesn't allow them to set the default payment method
right okay that's what i figured. It'll have to be two separate pages
thanks
yeah unfortunately we don't have a way to control this from withing PaymentSheet
one last thing: https://stripe.com/docs/elements/customer-sheet this documentation mentions that i am allowed to customize the underlying behavior of this widget
but does not provide the examples nor the link to the documentation. mind helping me out with that?
that is in beta and brand new so we don't really have docs for it, you'd have to ask our support team for help/access instead unfortunately https://support.stripe.com/contact