#leedurrant_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1276149356118151168
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
Link can be deisabled in the dashboard settings. are you using Direct Charge, Destination Charges, or Separate Charges & Transfer?
Not sure I understand any of the options: Direct Charge, Destination Charges, or Separate Charges & Transfer
It creates a payment_intent or a setup_intent
can you share a PaymentIntent ID (pi_xxx) so I can check myself?
One sec, I will create one.
I created pi_3PqZloClzVKheoWn195rfzJd. It didn't show the "Save with link" in that one though.
this is a Direct Charge, so it should be the settings of the connect account that applies. so you need to make sure the connected account disabled Link in their settings.
I have two accounts. One that owns the third part integration, and one that uses the integration (in live) in the same way that all the connected accounts use the integration. I never see the "Save with link" functionality. But I wasnt sure which off switch controlled it.
Is there anyway that I can override it to make sure that no connected account will ever have the "save with link" functionality showing?
that's the page with all Link settings: https://dashboard.stripe.com/settings/link
Is there anyway that I can override it to make sure that no connected account will ever have the "save with link" functionality showing?
not when using Direct Charges, no.
We pointed to the user that complained about this to the page you mention and they said that it made no difference!
can you share a PaymentIntent ID where you saw this issue?
Not sure I have that infor but will take a look at the email
wait, if you are using the Card Element there seems to be a way to disable Link programatically: https://docs.stripe.com/js/elements_object/create_element?type=card#elements_create-options-disableLink
sorry for the confusion
That could be the answer. Let me grab the code
It's been a few years since I did this code!
function procInit(stripepk, stripeaccount, piSecret, motoNotEnabledLbl, legendCaptionLbl, buttonSubmitLbl, buttonEnterCardDetailsLbl) {
var stripe = Stripe(stripepk, { stripeAccount: stripeaccount });
var paymentIntentSecret = piSecret;
var motoNotEnabledMsg = motoNotEnabledLbl;
var buttonEnterCardDetailsText = buttonEnterCardDetailsLbl;
var legendCreditOrDebitCardText = legendCaptionLbl;
var buttonSubmitText = buttonSubmitLbl;
var elements = stripe.elements();
var style = {
base: {
color: "#32325D",
fontWeight: 500,
fontFamily: "Inter UI, Open Sans, Segoe UI, sans-serif",
fontSize: "16px",
fontSmoothing: "antialiased",
"::placeholder": {
color: "#CFD7DF"
}
},
invalid: {
color: "#E25950"
}
};
var options = {
style: style
};
// Create an instance of the card UI component
var cardElement = elements.create('card',options);
cardElement.on('ready', function(event) {
var button = document.getElementById('callSubmit');
if (button){
button.disabled = false; //The button can be enabled once the card number is visible and has some data
button.innerText = buttonEnterCardDetailsText;
}
var legend = document.getElementById('legend');
if (legend){
legend.innerText = legendCreditOrDebitCardText;
}
});
// Mount the UI card component into the `card-element` <div>
cardElement.mount('#card-element');
So the important part is:
var options = {
style: style
};
Do I change it to the following?
var options = {
style: style,
didablelink: true
};
it's disableLink (you have a typo and missing an uppercase). but yes that loosk correct
Mybad!
BUt that is superb.
That's the once and for all solutiopn that I need.
Another question about card elements if I may?
sure!
Another customer has asked if I can prefill the PostalCode.
So it would be as follows?
var options = {
style: style,
disableLink: true,
value: { postalCode: '94110' }
};
correct
Again, that is excellent. Thank you so much.
happy to help ๐
One thin soma. I can pass in postalCode, but it there any sort of validation that I can do on the value beforehand to make sure that it doesnt error the card element?
Hi, stepping in and catching up
No, that is not possible. I just tested this to confirm and if you pass an expired card expiry for instance, the date will become red letting you know that somwthing is wrong with the input
So are you saying that if I pass in a value of "there is no way that this could possibly be a valid postalCode but lets have some fun and see what happens", it won't error, but will just show the value in red?
You can actually listen to change events: https://docs.stripe.com/js/element/input_validation and display the errors.
I am doing that already. So it sounds like I dont need to worry about validation. Just pass through what ever value we have and let the current code take care of it using the card-errors.