feat(billing): restrict Rewardful commissions to KiloClaw purchases#1037
Open
jeanduplessis wants to merge 3 commits intomainfrom
Open
feat(billing): restrict Rewardful commissions to KiloClaw purchases#1037jeanduplessis wants to merge 3 commits intomainfrom
jeanduplessis wants to merge 3 commits intomainfrom
Conversation
Add rewardful: 'false' metadata to all non-KiloClaw Stripe checkout sessions (top-ups, auto top-ups, seats, Kilo Pass, org auto top-ups) so Rewardful skips commission on those payments. Also fix cookie max-age to 60 days (5184000s) matching the affiliate program T&Cs.
Contributor
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)No new inline issues on diff lines. Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (5 files)
Reviewed by gpt-5.4-20260305 · 924,513 tokens |
Rewardful checks Customer, Subscription, Invoice, or Charge metadata for the rewardful=false flag — not PaymentIntent metadata. For payment-mode checkout sessions, move the flag from payment_intent_data.metadata to invoice_creation.invoice_data.metadata so it lands on the Invoice object that Rewardful actually inspects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restricts Rewardful affiliate commissions to KiloClaw purchases only by adding
rewardful: 'false'to Stripe metadata on all non-KiloClaw checkout sessions. Also fixes the referral cookiemax-ageto 60 days (5184000s) to match the affiliate program T&Cs.Changes:
max-agecorrected from 90 days to 60 days in the Rewardful inline script (layout.tsx)rewardful: 'false'topayment_intent_data.metadata(payment-mode) orsubscription_data.metadata(subscription-mode) on 5 checkout flows: credit top-ups, auto top-up setup, org auto top-up setup, org seat subscriptions, and Kilo Pass subscriptionsrewardfulas an optional field toStripeTopupMetadatato satisfy the existingsatisfiescheckVerification
pnpm typecheck— passesVisual Changes
N/A
Reviewer Notes
rewardful: 'false'in Stripe metadata on Customer, Subscription, Invoice, or Charge causes Rewardful to skip commission. For payment-mode checkouts,payment_intent_data.metadataflows to the Charge; for subscription-mode,subscription_data.metadataflows to both Subscription and Invoices.client_reference_idis still passed on all checkouts (including non-KiloClaw ones) so Rewardful can link the customer to the affiliate for attribution tracking — the metadata flag only suppresses the commission payout.