Stripe Trial Conversions Not Recording In Numok: The Fix
Hey guys, we've got a bit of a sticky situation here regarding conversion tracking with Stripe and Numok, specifically when it comes to trial subscriptions. Let's dive into the details and see if we can figure this out together!
The Issue: Conversion Amounts Not Updating After Stripe Trial Ends
The main issue we're seeing is that the conversion amount isn't being recorded correctly in Numok after a customer's free trial period on a Stripe subscription ends. This is a pretty crucial problem, as it directly impacts how affiliate partners are credited and how commissions are calculated. We need to ensure accurate tracking for everyone involved!
Scenario Breakdown
Let's break down the exact scenario where this issue pops up:
- A customer signs up for a subscription plan that includes a free trial period. This is a common way to get people hooked, offering them a chance to try before they buy.
- At the time of the initial subscription, the sale amount recorded is understandably
$0
. After all, it's a free trial! - Now, here's where things get tricky. Once the trial period wraps up, Stripe does its thing and generates an
invoice.paid
event when the first actual payment goes through. This is the signal we should be looking for. - But, despite this payment being successful and Stripe doing its part, Numok isn't showing any updated conversion amount. Even worse, there's no activity logged in the partner dashboard related to this payment. It's like the payment vanished into thin air!
Impact of the Problem
This isn't just a minor hiccup; it has some serious implications:
- Affiliate partners are left in the dark: They don't see the real sale amount after the trial period ends, which is a huge issue for transparency and trust.
- Commission calculations go haywire: If the sale amount isn't recorded, commissions aren't triggered for these post-trial payments. This means partners aren't getting paid what they're owed!
- Reporting and payouts become inaccurate: This throws a wrench into the entire system, making it difficult to get a clear picture of sales performance and ensure accurate payouts.
Expected vs. Actual Behavior
To make it crystal clear, here's what should happen versus what is happening:
Expected Behavior:
When the trial ends and Stripe sends that sweet invoice.paid
webhook, we should see the following:
- The conversion record should be updated with the actual sale amount – the amount the customer actually paid.
- The partner dashboard should reflect this activity, giving partners a clear view of their earnings.
Actual Behavior:
- The sale stubbornly remains at
$0
. It's like it's stuck in trial mode forever! - No activity is logged after the trial period ends. This makes it impossible to track the success of trial conversions.
Steps to Reproduce the Issue
Want to see this in action for yourself? Here's how to reproduce the problem:
- Kick off a subscription with a free trial via Stripe. This is the starting point for the whole scenario.
- Now, the waiting game begins. Wait until the trial period completes and the first payment is successfully processed by Stripe.
- Head over to the partner dashboard in Numok and check the conversion amount. You'll likely see that it's still stuck at
$0
, even though a payment has been made.
Important Notes
- This issue seems to be isolated to trial-based subscriptions. So, if you're not using trials, you're probably in the clear.
- Regular one-time payments or subscriptions without trials are working just fine. This narrows down the problem to the specific interaction between trials and conversion tracking.
Visual Evidence: Screenshots
To really drive the point home, let's take a look at some screenshots that illustrate the issue:
-
Stripe Subscription Details After Trial Payment:
This screenshot shows the subscription details in Stripe after the trial payment has been processed. You can see that the payment went through successfully, confirming that Stripe is doing its job.
-
Numok Partner Dashboard Showing $0 Conversion:
This is the real kicker. This screenshot of the Numok partner dashboard clearly shows the conversion amount stuck at
$0
after the trial has ended and a payment has been made. This is the core of the problem. -
Stripe Event Log Showing
invoice.paid
Event:This screenshot provides further confirmation that the
invoice.paid
event is being generated by Stripe after the trial, which should trigger a conversion update in Numok. -
One-Time Subscription (Working Correctly):
Just to highlight the contrast, this screenshot shows a one-time subscription without a trial period, which is working as expected. This helps us isolate the issue to trial-based subscriptions.
Digging Deeper: Potential Causes and Solutions
So, what could be causing this discrepancy? Here are a few potential areas to investigate:
- Webhook Handling: Is Numok correctly processing the
invoice.paid
webhook from Stripe? Perhaps there's an issue with the webhook configuration or the code that handles the event. - Data Mapping: Is the data from the
invoice.paid
event being correctly mapped to the conversion record in Numok? There might be a mismatch in the data fields or a bug in the mapping logic. - Trial Logic: Is there a specific piece of logic in Numok that's preventing conversion amounts from being updated after a trial period? This could be an intentional feature that's not working as expected, or a simple oversight.
To solve this, we might need to:
- Review the webhook implementation: Double-check that the
invoice.paid
webhook is being received and processed correctly. - Examine the data mapping: Ensure that the correct data from the webhook is being used to update the conversion record.
- Debug the trial logic: Look for any code that might be interfering with conversion updates after a trial period.
Let's Get This Fixed!
This is a critical issue that needs to be addressed ASAP. Inaccurate conversion tracking can lead to frustrated partners, lost revenue, and a whole lot of headaches. By working together and diving deep into the code, we can hopefully find the root cause and get this fixed for good!