ruby-on-railsstripe-payments

Stripe payment element not showing payment options


I'm on Rails. I have successfully created an embedded Stripe payment element, but it doesn't display the payment options above the card number. It should look like this: correct element But it looks like this: my element

As you can see in my code I do have automatic payment methods enabled. I have a few different payment methods enabled in my Stripe dashboard. Where am I going wrong?

controller.rb:

    # Create a PaymentIntent:
    @intent = Stripe::PaymentIntent.create({
      amount: 100,
      currency: 'gbp',
      automatic_payment_methods: {enabled: true},
      transfer_group: 'group1',
    })

client_view.html.erb

        <script type="text/javascript">
              const stripe = Stripe('pk_test_.....');
              const options = {
                clientSecret: secret,
                appearance: {
                  theme: 'stripe'
                },
              };
              const elements = stripe.elements(options);
              const paymentElement = elements.create('payment');
              paymentElement.mount('#payment-element');
        </script>

Solution

  • The presentment of Apple Pay and Google Pay are dependent on the browser you're using meeting Stripe's prerequisites for those to be displayed. The most common reason for those to not be displayed is that a card was not added to the associated wallet prior to the Payment Element being displayed. To test Google Pay, you'll want to make sure you add a card to your Google Pay wallet. To test Apple Pay, you'll need to add a card to your Apple Pay wallet. Supporting Apple Pay also requires that you register the domain, where you will be displaying your Payment Element integration, with Apple, instructions to do so are provided in this Support article.

    The other payment method types you referenced aren't being displayed because they don't support the presentment currency that your code is setting. When creating the Payment Intent you're passing gbp for currency, but Bancontact, EPS, giropay, and iDEAL require a presentment currency of eur. To see those options, you will need to adjust the currency that is being used.

    There is a page available for each type of payment method showing what currencies and processes it supports. Below are the ones for the payment method types you mentioned:

    You can also find those details for all payment method options consolidated on a single page here:
    https://stripe.com/guides/payment-methods-guide#payment-methods-fact-sheets