I’m using Stripe’s PHP SDK to create a Payment Intent and then handling the payment on the frontend using Stripe.js. Here’s a brief overview of my implementation:
-
Payment Intent Creation: In my PHP backend, I’m creating a Payment Intent with automatic payment methods enabled:
$paymentIntent = $stripe->paymentIntents->create([ 'automatic_payment_methods' => ['enabled' => true], 'amount' => $_POST['amt'] * 100, // Amount in cents 'currency' => 'usd', 'metadata' => ['customer_email' => $customerEmail], 'phone_number_collection' => ['enabled' => true], ]);
-
Frontend Setup: I’m using Stripe Elements on the frontend to collect card details:
const cardElement = elements.create('card'); cardElement.mount('#card-element'); form.addEventListener('submit', async (event) => { event.preventDefault(); // Fetch client secret and handle payment confirmation... });
Issue:
Despite having the automatic payment methods enabled, the autofill button does not appear in the credit card input box. I have checked the following:
-
The customer’s email is being sent correctly and is associated with saved payment methods in Stripe.
-
I am using the latest version of Stripe.js.
-
The payment methods
card
andlink
are both enabled in my Stripe dashboard settings.
-
I expected the autofill button to appear in the credit card input box when the card element is focused, allowing users to quickly fill in their saved payment details. The button should be visible when users enter an email that is associated with saved payment methods in Stripe Link.
you should visit your Dashboard Payment Methods settings page, and confirm Link is enabled for CardElement.
1