You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/referral_service.rst
+54-13Lines changed: 54 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,10 @@ When a referred user purchases a subscription, the `ReferralService` updates the
26
26
27
27
ReferralService.handle_purchase_subscription(
28
28
user=user_instance,
29
-
amount_paid=10000,
30
-
invoice_external_id=12345
29
+
amount_paid=10000,# original paid amount in cents
30
+
invoice_external_id=12345# an optional external invoice ID (e.g. chargeebe_id).
31
31
)
32
32
33
-
.. note::
34
-
35
-
Field amount_paid must be in cents
36
33
37
34
The method updates the user's referral status and calculates the commission based on the amount paid.
38
35
@@ -47,16 +44,12 @@ If a referred user requests a refund, the service updates the referral status to
47
44
48
45
ReferralService.handle_user_refund(
49
46
user=user_instance,
50
-
amount_refunded=5000,
51
-
amount_paid=10000,
52
-
invoice_external_id=12345
47
+
amount_refunded=5000,# refunded amount in cents
48
+
amount_paid=10000,# original paid amount in cents
49
+
invoice_external_id=12345# an optional external invoice ID (e.g. chargeebe_id).
53
50
)
54
51
55
52
56
-
.. note::
57
-
58
-
Field amount_paid and amount_refunded must be in cents
59
-
60
53
The method sets the referral status to `Refund` and adjusts the commission accordingly.
61
54
62
55
Example refund scenario:
@@ -84,4 +77,52 @@ In this case, the promoter's final commission will be $5, reflecting the amount
84
77
85
78
.. note::
86
79
87
-
It is possible for a promoter to have a negative balance if multiple refunds are processed and the refunded amounts exceed the promoter’s total earned commissions. This can occur if the promoter has already been paid for referrals, but the referred users later request refunds.
80
+
It is possible for a promoter to have a negative balance if multiple refunds are processed and the refunded amounts exceed the promoter’s total earned commissions. This can occur if the promoter has already been paid for referrals, but the referred users later request refunds.
81
+
82
+
83
+
Sending Referral Invitation Emails
84
+
----------------------------------
85
+
86
+
The `send_referral_invitation_email` method allows promoters to send an email invitation containing a referral link.
0 commit comments