At first, you need to install and activate AffiliateWP plugin. Then In WordPress admin, go to Smartpay > Integrations. You will find available list of extensions that can be integrated with WPSmartPay. Then Activate the AffiliateWP integration.

Then go to Smartpay > Settings. If multiple extension are enable then you will find AffiliateWP settings tab under Extensions tab.

- Click on the Extension tab.
- Enable referrals on all forms and products successful payment ( you can enable referral for form individually )
- Click on Save Changes button.
Now AffiliateWP integration is ready to use.
How to enable referral settings of a single form
In WordPress admin, go to Smartpay > Forms. then go to edit page of a form that you want to enable referral.

If you enable the option for both form and product referral settings from Smartpay > Settings > AffiliateWP settings, then enable/disable option of single form referral won’t work.
How AffiliateWP’s referral works with WPSmartPay
At first go to Affiliate Area page of AffiliateWP. If pretty URL permalink structure is set, then Affiliate Area page URL will be yoursitedomain.com/affiliate-area/
There you will see your all affiliate related information. Sample Affiliate Area page is given below

Next suppose you are taking payment using a form and your form URL is yoursitedomain.com/simple-form.

In Page URL input box paste the product or the form URL you want to enable for referral. Set Campaign name. Click on Generate URL button. Then you will find Referral URL input box. Here is a sample.

Now copy the Referral URL and share it to others. If a successful payment transaction is occurred using this Referral URL , Then a referral will be created in AffiliateWP.
You can check it by going in WordPress admin, Affiliates > Referrals.