Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support auto_capture for the Stripe payment method #260

Merged
merged 2 commits into from Mar 31, 2023

Commits on Mar 30, 2023

  1. Add auto-capture functionality to Stripe integration

    With this commit, the Solidus auto-capture feature has been incorporated into
    the Stripe integration through the use of the auto_capture flag in
    the Spree::PaymentMethod base model.
    Stripe `capture_method` is now auto configured during the intent creation with
     "manual" or "automatic" based on the auto_capture flag in the related
    payment method.
    
    More information can be found in the Stripe documentation:
    https://stripe.com/docs/api/payment_intents/object#payment_intent_object-capture_method
    rainerdema committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    ac222b7 View commit details
    Browse the repository at this point in the history
  2. Add captureMethod to Stripe Elements options

    - Update payment_element_options hash to include the `captureMethod` parameter
    - Ensure captureMethod value matches the capture_method provided when creating
    the Payment Intent
    
    Adding `captureMethod` improves security by ensuring that the capture_method
    value used during payment method creation matches the value provided when
    creating the Payment Intent. This helps prevent fraudulent activity and errors,
    such as a scenario where an admin changes the auto-capture mode after the
    Stripe Payment Method creation, causing the payment to fail.
    
    Reference: https://stripe.com/docs/js/elements_object/create_without_intent
    rainerdema committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    dcafcca View commit details
    Browse the repository at this point in the history