Sha256: f84fad1075a9d2744fbe9a3da537f86c59a0baa5f3034a6d12bc484c71584aa8

Contents?: true

Size: 1.33 KB

Versions: 6

Compression:

Stored size: 1.33 KB

Contents

<%
  stripe_payment_method = payment.source.stripe_payment_method

  # https://stripe.com/docs/api/payment_methods/object#payment_method_object-type
  partial_base = "checkouts/existing_payment/stripe"
  payment_type = stripe_payment_method.type

  # Fallback on the default partial if a specialized partial is not available.
  payment_type = 'default' if lookup_context.find_all("#{partial_base}/_#{payment_type}").none?
%>

<%= render(
  "#{partial_base}/#{payment_type}",
  stripe_payment_method: stripe_payment_method,
  partial_base: partial_base,
  payment_type: payment_type
) %>

<% if current_order&.confirm? %>
  <% stripe_intent =
    SolidusStripe::PaymentIntent.prepare_for_payment(payment).stripe_intent %>

  <input
    type="hidden"
    data-controller="solidus-stripe-confirm"
    data-solidus-stripe-confirm-publishable-key-value="<%= payment.payment_method.preferred_publishable_key %>"
    data-solidus-stripe-confirm-client-secret-value="<%= stripe_intent.client_secret %>"
    data-solidus-stripe-confirm-return-url-value="<%= solidus_stripe.after_confirmation_url(payment.payment_method.slug) %>"
    data-solidus-stripe-confirm-error-base-url-value="<%= solidus_stripe.after_confirmation_url(payment.payment_method.slug, payment_intent: stripe_intent.id) %>"
    data-action="submit@window->solidus-stripe-confirm#confirm"
  >
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
solidus_stripe-5.0.2 lib/generators/solidus_stripe/install/templates/app/views/orders/payment_info/_stripe.html.erb
solidus_stripe-5.0.1 lib/generators/solidus_stripe/install/templates/app/views/orders/payment_info/_stripe.html.erb
solidus_stripe-5.0.0 lib/generators/solidus_stripe/install/templates/app/views/orders/payment_info/_stripe.html.erb
solidus_stripe-5.0.0.rc.3 lib/generators/solidus_stripe/install/templates/app/views/orders/payment_info/_stripe.html.erb
solidus_stripe-5.0.0.rc.2 lib/generators/solidus_stripe/install/templates/app/views/orders/payment_info/_stripe.html.erb
solidus_stripe-5.0.0.rc.1 lib/generators/solidus_stripe/install/templates/app/views/orders/payment_info/_stripe.html.erb