What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

VisEntities

Active Member
When a user buys multiple resources in a single cart transaction, and I later issue a partial refund (Stripe allows this, not sure if PayPal does), the addon shows the entire payment as refunded and revokes all licenses.

Not sure how this could be handled properly, but maybe the addon could compare the refund amount to the items in the cart and only deactivate the matching ones? Could also introduce a new prefix like “Partial Refund” instead of marking everything as “Refunded”
 
The license revoking/inactivation part isn't the main problem, that’s minor. The real issue is how partial refunds mess with the stats and payment totals. That part really needs to be handled properly

For example, if someone makes a $50 purchase and I refund $25, the site currently deducts the full $50 from the stats, which gives inaccurate info. The refund amounts should be reflected correctly in the numbers, that’s the important part

Licenses we can manage manually if needed, but the financial data needs to be accurate
 
I don't think that the XenForo payment information provide that level of detail.
The issue is that if multiple articles are inside that cart with same amount it might be impossible to mitigate.

I think at least I could indeed detect the refund amount.

Do you have the data of such a refund from the XenForo payment log please ?
 
I don't think that the XenForo payment information provide that level of detail.
The issue is that if multiple articles are inside that cart with same amount it might be impossible to mitigate.
Yeah handling the resources manually is no problem, we can micromanage that ourselves. But syncing the refund amount correctly is more important.


Do you have the data of such a refund from the XenForo payment log please ?
Here are the log details (please remove any sensitive info if you spot any)

Code:
array(49) {
  ["id"] => string(27) "py_3SV28mDPgQg0qWsQ05rRSFgH"
  ["object"] => string(6) "charge"
  ["amount"] => int(3498)
  ["amount_captured"] => int(3498)
  ["amount_refunded"] => int(1499)
  ["application"] => NULL
  ["application_fee"] => NULL
  ["application_fee_amount"] => NULL
  ["balance_transaction"] => string(28) "txn_3SV28mDPgQg0qWsQ0yhYDw1A"
  ["billing_details"] => array(5) {
    ["address"] => array(6) {
      ["city"] => NULL
      ["country"] => "AR"
      ["line1"] => NULL
      ["line2"] => NULL
      ["postal_code"] => NULL
      ["state"] => NULL
    }
    ["email"] => "[REDACTED_EMAIL]"
    ["name"] => "[REDACTED_NAME]"
    ["phone"] => NULL
    ["tax_id"] => NULL
  }
  ["calculated_statement_descriptor"] => string(10) "GAME4FREAK"
  ["captured"] => bool(true)
  ["created"] => int(1763523191)
  ["currency"] => string(3) "usd"
  ["customer"] => string(18) "cus_TRvzJfbP3wVbUq"
  ["description"] => NULL
  ["destination"] => NULL
  ["dispute"] => NULL
  ["disputed"] => bool(false)
  ["failure_balance_transaction"] => NULL
  ["failure_code"] => NULL
  ["failure_message"] => NULL
  ["fraud_details"] => array(0) {
  }
  ["invoice"] => NULL
  ["livemode"] => bool(true)
  ["metadata"] => array(4) {
    ["user_id"] => "1700"
    ["email"] => "[REDACTED_EMAIL]"
    ["username"] => "[REDACTED_USERNAME]"
    ["request_key"] => "[REDACTED_KEY]"
  }
  ["on_behalf_of"] => NULL
  ["order"] => NULL
  ["outcome"] => array(8) {
    ["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"] => bool(true)
  ["payment_intent"] => "pi_3SV28mDPgQg0qWsQ09saeofe"
  ["payment_method"] => "pm_1SV28lDPgQg0qWsQo7hTvfTW"
  ["payment_method_details"] => array(2) {
    ["link"] => array(1) {
      ["country"] => "AR"
    }
    ["type"] => "link"
  }
  ["radar_options"] => array(0) {
  }
  ["receipt_email"] => NULL
  ["receipt_number"] => NULL
  ["receipt_url"] => "[REDACTED_RECEIPT_URL]"
  ["refunded"] => bool(false)
  ["review"] => NULL
  ["shipping"] => NULL
  ["source"] => NULL
  ["source_transfer"] => NULL
  ["statement_descriptor"] => NULL
  ["statement_descriptor_suffix"] => NULL
  ["status"] => "succeeded"
  ["transfer_data"] => NULL
  ["transfer_group"] => NULL
  ["apiVersion"] => "2025-01-27.acacia"
  ["eventType"] => "charge.refunded"
}
 
Yeah unfortunately I checked the info is in that log but the log is dependent of the payment profile...
Do you mean it’s not solvable for Stripe but maybe possible for PayPal? Or are you saying it’s not possible with XenForo’s built-in payment processing, but it is possible for the addon custom?
 
It might be possible but on a case per case basis for a given payment profile.
Typically for this one the info seems here so I would have to see if it is here in the refund function not just in the final log.

Which payment method are you using ?

If it's Stripe, I won't be able to test it.
 

From bespoke add-on development to complex integrations and specialized enhancements, we offer a range of XenForo development services designed to help your community thrive.

Start discussing your needs
Back
Top
Cart