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

Stripe payment cannot be captured #8074

Closed
silenaker opened this issue Jul 11, 2024 · 6 comments
Closed

Stripe payment cannot be captured #8074

silenaker opened this issue Jul 11, 2024 · 6 comments

Comments

@silenaker
Copy link
Contributor

Bug report

Describe the bug

We are using the @medusajs/payment-stripe provider for payments. However, after the cart is paid and the order is created, the payment cannot be captured, leading to state inconsistency.

The order status remains "Authorized" in such cases.

image

System information

Medusa version (including plugins): 2.0 preview
Node.js version: 20
Database: postgresql
Operating system: mac os
Browser (if relevant): chrome

Expected behavior

The following order status is "Captured," as expected.

image
@voxsar
Copy link

voxsar commented Jul 26, 2024

#6254

@420coupe
Copy link
Contributor

420coupe commented Aug 26, 2024

I want to bring this issue back up. As payments are being captured, but statuses are not being updated after payment capture and just being left on authorized. In addition the card_last4 is also not being stored anywhere nor is payment type credit card /visa. Only the payment provider is being logged.

@420coupe
Copy link
Contributor

to add some context here, looks like stripe webhook cant find pp_stripe. but payments are being processed on stripe's end.

image

payment_intent.succeeded

Resend

More options
Next retry
in an hour
Response
HTTP status code
502 (Bad Gateway)
error code: 502
Request
{
  "id": ["evt_3Ps5wgK6QjZA3FWk0XqtVyKB"](https://dashboard.stripe.com/test/events/evt_3Ps5wgK6QjZA3FWk0XqtVyKB),
  "object": "event",
  "api_version": "2024-06-20",
  "created": 1724690368,
  "data": {
    "object": {
      "id": ["pi_3Ps5wgK6QjZA3FWk0U1zZ9Vs"](https://dashboard.stripe.com/test/payments/pi_3Ps5wgK6QjZA3FWk0U1zZ9Vs),
      "object": "payment_intent",
      "amount": 267,
      "amount_capturable": 0,
      "amount_details": {
        "tip": {
        }
      },
      "amount_received": 267,
      "application": null,
      "application_fee_amount": null,
      "automatic_payment_methods": {
        "allow_redirects": "always",
        "enabled": true
      },
      "canceled_at": null,
      "cancellation_reason": null,
      "capture_method": "automatic",
      "client_secret": "pi_3Ps5wgK6QjZA3FWk0U1zZ9Vs_secret_KdxrR6WUoUc2bfRFNZUQUBflu",
      "confirmation_method": "automatic",
      "created": 1724690350,
      "currency": "usd",
      "customer": ["cus_QjZ4qsdc4Uwj0y"](https://dashboard.stripe.com/test/customers/cus_QjZ4qsdc4Uwj0y),
      "description": null,
      "invoice": null,
      "last_payment_error": null,
      "latest_charge": "ch_3Ps5wgK6QjZA3FWk0UpvxYRw",
      "livemode": false,
      "metadata": {
        "session_id": "payses_01J67RWFG55NNT428XD5J8G78J"
      },
      "next_action": null,
      "on_behalf_of": null,
      "payment_method": "pm_1Ps5wxK6QjZA3FWkrWX4Pyfl",
      "payment_method_configuration_details": {
        "id": "pmc_1PoE5nK6QjZA3FWk3b502P3b",
        "parent": null
      },
      "payment_method_options": {
        "amazon_pay": {
          "express_checkout_element_session_id": null
        },
        "card": {
          "installments": null,
          "mandate_options": null,
          "network": null,
          "request_three_d_secure": "automatic"
        },
        "cashapp": {
        },
        "klarna": {
          "preferred_locale": null
        },
        "link": {
          "persistent_token": null
        }
      },
      "payment_method_types": [
        "card",
        "klarna",
        "link",
        "cashapp",
        "amazon_pay"
      ],
      "processing": null,
      "receipt_email": null,
      "review": null,
      "setup_future_usage": null,
      "shipping": null,
      "source": null,
      "statement_descriptor": null,
      "statement_descriptor_suffix": null,
      "status": "succeeded",
      "transfer_data": null,
      "transfer_group": null
    }
  },
  "livemode": false,
  "pending_webhooks": 1,
  "request": {
    "id": "req_fXXX4uE7t747Wk",
    "idempotency_key": "ba0ed581-36ab-4a7b-ad24-3b2e962c1870"
  },
  "type": "payment_intent.succeeded"
}

@420coupe
Copy link
Contributor

reprocess failed response. got a 200, but backend still shows error.

payment_intent.succeeded

Resend

More options
Response
HTTP status code
200 (OK)
OK
Request
{
  "id": ["evt_3Ps5wgK6QjZA3FWk0XqtVyKB"](https://dashboard.stripe.com/test/events/evt_3Ps5wgK6QjZA3FWk0XqtVyKB),
  "object": "event",
  "api_version": "2024-06-20",
  "created": 1724690368,
  "data": {
    "object": {
      "id": ["pi_3Ps5wgK6QjZA3FWk0U1zZ9Vs"](https://dashboard.stripe.com/test/payments/pi_3Ps5wgK6QjZA3FWk0U1zZ9Vs),
      "object": "payment_intent",
      "amount": 267,
      "amount_capturable": 0,
      "amount_details": {
        "tip": {
        }
      },
      "amount_received": 267,
      "application": null,
      "application_fee_amount": null,
      "automatic_payment_methods": {
        "allow_redirects": "always",
        "enabled": true
      },
      "canceled_at": null,
      "cancellation_reason": null,
      "capture_method": "automatic",
      "client_secret": "pi_3Ps5wgK6QjZA3FWk0U1zZ9Vs_secret_KdxrR6WUoUc2bfRFNZUQUBflu",
      "confirmation_method": "automatic",
      "created": 1724690350,
      "currency": "usd",
      "customer": ["cus_QjZ4qsdc4Uwj0y"](https://dashboard.stripe.com/test/customers/cus_QjZ4qsdc4Uwj0y),
      "description": null,
      "invoice": null,
      "last_payment_error": null,
      "latest_charge": "ch_3Ps5wgK6QjZA3FWk0UpvxYRw",
      "livemode": false,
      "metadata": {
        "session_id": "payses_01J67RWFG55NNT428XD5J8G78J"
      },
      "next_action": null,
      "on_behalf_of": null,
      "payment_method": "pm_1Ps5wxK6QjZA3FWkrWX4Pyfl",
      "payment_method_configuration_details": {
        "id": "pmc_1PoE5nK6QjZA3FWk3b502P3b",
        "parent": null
      },
      "payment_method_options": {
        "amazon_pay": {
          "express_checkout_element_session_id": null
        },
        "card": {
          "installments": null,
          "mandate_options": null,
          "network": null,
          "request_three_d_secure": "automatic"
        },
        "cashapp": {
        },
        "klarna": {
          "preferred_locale": null
        },
        "link": {
          "persistent_token": null
        }
      },
      "payment_method_types": [
        "card",
        "klarna",
        "link",
        "cashapp",
        "amazon_pay"
      ],
      "processing": null,
      "receipt_email": null,
      "review": null,
      "setup_future_usage": null,
      "shipping": null,
      "source": null,
      "statement_descriptor": null,
      "statement_descriptor_suffix": null,
      "status": "succeeded",
      "transfer_data": null,
      "transfer_group": null
    }
  },
  "livemode": false,
  "pending_webhooks": 1,
  "request": {
    "id": "req_fXXX4uE7t747Wk",
    "idempotency_key": "ba0ed581-36ab-4a7b-ad24-3b2e962c1870"
  },
  "type": "payment_intent.succeeded"
}

image

Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.

@github-actions github-actions bot added the Stale label Sep 26, 2024
Copy link
Contributor

This issue was closed because it has been stalled for 3 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants