Possible Issue with Stripe when Cancelling a Subscription from the Dashboard.

robdog

Well-known member
Affected version
2.3
The message I am getting in the AdminCP for the payment provider log is:
Error: Event data received from Stripe does not contain the expected values.

I looked in the Stripe developer dashboard and it sent the following data:
DELETE /v1/subscriptions/sub_[SUB_ID]

Response Body
JSON:
{
  "id": "sub_[SUB_ID]"
}

Request Query Parameters
JSON:
{
  "include_only": [
    "id"
  ],
  "prorate": "false",
  "invoice_now": "true"
}

One thing to note, the user ALREADY cancelled their subscription on our site, so that may play into this situation. However, this would allow them to continue with their paid version. If I cancel the subscription in the admin and issue a refund, I would expect the user to be downgraded.

Let me know if there is any other information you need to help debug. Thanks.
 
If you issue a refund, they should be downgraded as a result.

Cancelling a subscription doesn’t automatically imply the user upgrade should end. It should usually run until it expires, which happens naturally after the expiry date.

The “unexpected data” log sometimes just means we’ve received a webhook for something we don’t handle.

You would probably need to post the full log (removing any sensitive data) to ascertain.
 
Sorry, good point. I cancelled the subscription AND issued a refund at the same time.

The above information is the entire block(s) of information in the XenForo log. I can post what Stripe thinks was sent over.
 
Here is the payload that was sent to the callback:

JSON:
{
  "id": "[REMOVED]",
  "object": "event",
  "api_version": "2024-06-20",
  "created": 1740013651,
  "data": {
    "object": {
      "id": "[REMOVED]",
      "object": "charge",
      "amount": 2000,
      "amount_captured": 2000,
      "amount_refunded": 2000,
      "application": null,
      "application_fee": null,
      "application_fee_amount": null,
      "balance_transaction": "[REMOVED]",
      "billing_details": {
        "address": {
          "city": null,
          "country": "US",
          "line1": null,
          "line2": null,
          "postal_code": "[REMOVED]",
          "state": null
        },
        "email": "[REMOVED]",
        "name": "[REMOVED]",
        "phone": null
      },
      "calculated_statement_descriptor": "[REMOVED] APP",
      "captured": true,
      "created": 1740011720,
      "currency": "usd",
      "customer": "[REMOVED]",
      "description": "Subscription creation",
      "destination": null,
      "dispute": null,
      "disputed": false,
      "failure_balance_transaction": null,
      "failure_code": null,
      "failure_message": null,
      "fraud_details": {
      },
      "invoice": "[REMOVED]",
      "livemode": true,
      "metadata": {
      },
      "on_behalf_of": null,
      "order": null,
      "outcome": {
        "advice_code": null,
        "network_advice_code": null,
        "network_decline_code": null,
        "network_status": "approved_by_network",
        "reason": null,
        "risk_level": "normal",
        "seller_message": "Payment complete.",
        "type": "authorized"
      },
      "paid": true,
      "payment_intent": "[REMOVED]",
      "payment_method": "[REMOVED]",
      "payment_method_details": {
        "card": {
          "amount_authorized": 2000,
          "authorization_code": "[REMOVED]",
          "brand": "[REMOVED]",
          "checks": {
            "address_line1_check": null,
            "address_postal_code_check": "pass",
            "cvc_check": "pass"
          },
          "country": "US",
          "exp_month": 0,
          "exp_year": 0000,
          "extended_authorization": {
            "status": "disabled"
          },
          "fingerprint": "[REMOVED]",
          "funding": "credit",
          "incremental_authorization": {
            "status": "unavailable"
          },
          "installments": null,
          "last4": "[REMOVED]",
          "mandate": null,
          "multicapture": {
            "status": "unavailable"
          },
          "network": "[REMOVED]",
          "network_token": {
            "used": false
          },
          "network_transaction_id": "[REMOVED]",
          "overcapture": {
            "maximum_amount_capturable": 2000,
            "status": "unavailable"
          },
          "regulated_status": "unregulated",
          "three_d_secure": null,
          "wallet": null
        },
        "type": "card"
      },
      "radar_options": {
      },
      "receipt_email": "[REMOVED]",
      "receipt_number": "[REMOVED]",
      "receipt_url": "[REMOVED]",
      "refunded": true,
      "review": null,
      "shipping": null,
      "source": null,
      "source_transfer": null,
      "statement_descriptor": "[REMOVED] App",
      "statement_descriptor_suffix": null,
      "status": "succeeded",
      "transfer_data": null,
      "transfer_group": null
    },
    "previous_attributes": {
      "amount_refunded": 0,
      "receipt_url": "[REMOVED]",
      "refunded": false
    }
  },
  "livemode": true,
  "pending_webhooks": 1,
  "request": {
    "id": "[REMOVED]",
    "idempotency_key": "[REMOVED]"
  },
  "type": "charge.refunded"
}

@Chris D let me know if this info was helpful or if you need more details.
 
Back
Top Bottom