#leedurrant_api

1 messages ยท Page 1 of 1 (latest)

marble orbitBOT
#

๐Ÿ‘‹ 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.

mild spoke
#

hi there!

#

Link can be deisabled in the dashboard settings. are you using Direct Charge, Destination Charges, or Separate Charges & Transfer?

thin crypt
#

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

mild spoke
#

can you share a PaymentIntent ID (pi_xxx) so I can check myself?

thin crypt
#

One sec, I will create one.

#

I created pi_3PqZloClzVKheoWn195rfzJd. It didn't show the "Save with link" in that one though.

mild spoke
#

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.

thin crypt
#

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?

mild spoke
#

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.

thin crypt
#

We pointed to the user that complained about this to the page you mention and they said that it made no difference!

mild spoke
#

can you share a PaymentIntent ID where you saw this issue?

thin crypt
#

Not sure I have that infor but will take a look at the email

mild spoke
#

sorry for the confusion

thin crypt
#

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
};
mild spoke
#

it's disableLink (you have a typo and missing an uppercase). but yes that loosk correct

thin crypt
#

Mybad!

#

BUt that is superb.

#

That's the once and for all solutiopn that I need.

#

Another question about card elements if I may?

mild spoke
#

sure!

thin crypt
#

Another customer has asked if I can prefill the PostalCode.

thin crypt
#

So it would be as follows?

var options = {
    style: style,
    disableLink: true,
    value: { postalCode: '94110' }
};
mild spoke
#

correct

thin crypt
#

Again, that is excellent. Thank you so much.

mild spoke
#

happy to help ๐Ÿ™‚

thin crypt
#

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?

marble orbitBOT
dense veldt
#

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

thin crypt
#

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?

dense veldt
thin crypt
#

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.