Draft: Feat/minds plus affiliate #2547
Ticket(s) / Related Merge Requests
Summary of Changes
Added ability to attribute Minds Plus/Pro payment's affiliate to Minds Plus/Pro post owner.
Testing Considerations
Referrer cookie
1. Prerequisites
Before setting the referrer cookie, make sure you have added a payment method to your account on https://feat-affiliates-e2543.oke.minds.io/.
To set the referrer cookie with the name referrer
and the value <user_guid>
in Chrome, follow these steps:
- Open Google Chrome.
- Go to https://feat-affiliates-e2543.oke.minds.io/.
- Press F12 to open the developer tools.
- Click on the
Application
tab. - In the left-hand sidebar, expand the
Cookies
dropdown and selecthttps://feat-affiliates-e2543.oke.minds.io/
. - Click on the
Add
button in theCookies
section. - In the
Name
field, enter "referrer". - In the
Value
field, enter "<user_guid>". - Set the
Domain
field tofeat-affiliates-e2543.oke.minds.io
. - Set the
Path
field to/
. - Leave the
Expires
andMax-Age
fields blank. - Click the
Add
button to create the cookie.
2. Create a new boost
Now that the referrer cookie is set, you can create a new boost. Follow these steps:
- Select an activity from the newsfeed.
- Click the ellipsis in the top right corner of the activity.
- Select Boost Post from the dropdown menu that appears.
- Follow the on-screen instructions to create the boost.
Once the boost is successfully created, you should check that a new entry has been added to the minds_payments
table in Vitess. To do this, follow these steps:
- Follow the guide available here (https://developers.minds.com/docs/infrastructure/cloud-access/#oracle-cloud-oci) to gain access to the sandbox k8s cluster.
- Once access to the sandbox k8s cluster is acquired, set up a port forward for vtgate to access the Vitess database from your local machine.
- Run the following query:
SELECT * FROM minds_payments WHERE affiliate_user_guid='<user_guid>'
to verify that the boost payment details have been added to the database. 4. Make sure the affiliate_user_guid column in the database matches the referrer cookie value set at the start.
3. Subscribe to Minds+
Before proceeding any further, you must create a new account on Minds and associate a payment method to the newly created account. Follow these steps to subscribe to Minds+:
- Create a new account on Minds if you haven't already done so.
- Associate a payment method to your Minds account by following these steps:
- Go to the "Settings" page by clicking on the three dots in the top right corner of the page and selecting "Settings" from the dropdown menu.
- Select the "Billing" tab from the list of options on the left-hand side of the page.
- Click on the "Add Payment Method" button and follow the instructions provided to add a payment method.
- Once you have subscribed to Minds+, you must perform the same verification steps as described in the "Create a new boost" section to confirm that your subscription has been successfully processed.
- Check that a new entry has been added to the minds_payments table in Vitess.
- Verify that the boost payment details have been added to the database.
- Make sure the
affiliate_user_guid
column in the database matches the referrer cookie value set at the start.
If you encounter any issues while subscribing to Minds+, please contact the Minds support team for assistance.
Deployment Considerations
Create new table in db:
CREATE TABLE `minds_payments` (
`payment_guid` bigint NOT NULL,
`user_guid` bigint NOT NULL,
`affiliate_user_guid` bigint DEFAULT NULL,
`payment_type` int NOT NULL,
`payment_status` int DEFAULT NULL,
`payment_method` int NOT NULL,
`payment_amount_millis` int NOT NULL,
`refunded_amount_millis` int DEFAULT NULL,
`is_captured` tinyint(1) DEFAULT '0',
`payment_tx_id` text,
`created_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_timestamp` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`payment_guid`),
KEY `user_guid_idx` (`user_guid`),
KEY `affiliate_user_guid_idx` (`affiliate_user_guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE boosts
ADD payment_guid bigint DEFAULT NULL
AFTER payment_method;
In Cassadra apply this ddl changes
ALTER TABLE minds.wire ADD payment_guid bigint;
Regression Scope
Platform Affected (web, mobile, etc)
Developer Testing Completed
Screenshots / Screen Recording
Does this impact
-
Localization -
Dark/light mode -
Guest mode
Definition of Done Checklist
-
The Acceptance Criteria has been met -
Code is tested: Testing includes unit/spec, E2E/automated and manual testing -
Merge requests description has been filled out