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

Fix pre-auth behavior #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 26, 2024

  1. Fix pre-auth behavior

    Before this change we were erroneously marking pre-auth'd charges as
    status=pending, when they're actually status=succeeded. We were (accidentally)
    working around this incorrect behavior in pre-auth'd PaymentIntents.
    
    To get this right we have to actually split the _trigger_payment method into
    two: a check for payment authorization (which we do on construction even for
    Charges created with capture=false), and a separate routine to actually capture
    the charge (which we do on construction for non-pre-auth'd charges, and on
    _api_capture for pre-auth'd charges). We then adjust the PaymentIntent wrapper
    to fit.
    
    This also fixes a tiny mistake in the Charge refund test; it was asserting the
    wrong variable.
    Ben Creech committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    d00c513 View commit details
    Browse the repository at this point in the history