Skip to content

Draft: Feat/minds plus affiliate #2547

Fausto Arcidiacono requested to merge feat/minds-plus-affiliate-e2547 into master

Ticket(s) / Related Merge Requests

#2547 (closed)

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:

  1. Open Google Chrome.
  2. Go to https://feat-affiliates-e2543.oke.minds.io/.
  3. Press F12 to open the developer tools.
  4. Click on the Application tab.
  5. In the left-hand sidebar, expand the Cookies dropdown and select https://feat-affiliates-e2543.oke.minds.io/.
  6. Click on the Add button in the Cookies section.
  7. In the Name field, enter "referrer".
  8. In the Value field, enter "<user_guid>".
  9. Set the Domain field to feat-affiliates-e2543.oke.minds.io.
  10. Set the Path field to /.
  11. Leave the Expires and Max-Age fields blank.
  12. 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:

  1. Select an activity from the newsfeed.
  2. Click the ellipsis in the top right corner of the activity.
  3. Select Boost Post from the dropdown menu that appears.
  4. 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:

  1. Follow the guide available here (https://developers.minds.com/docs/infrastructure/cloud-access/#oracle-cloud-oci) to gain access to the sandbox k8s cluster.
  2. 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.
  3. 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+:

  1. Create a new account on Minds if you haven't already done so.
  2. 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.
  3. 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
Edited by Fausto Arcidiacono

Merge request reports