Home
Integration Methods
aMember v4
aMember version 4 uses new file structure and new code, so here is a new integration.
1
Getting cookie value
First, locate file:
application/default/views/_form.phtml
In this file, we will add a special code to the form, so visitor ID is read and sent to processing file. Change this line:
echo $form->render($renderer);
to this code:
Save your work and based on what do you want to integrate, continue in proper step.
2
Integration with PayPal within aMember - step 1
Now edit this file:
/amember/library/Am/Paysystem/PayProcessMediator.php
Find function process() and within this function, find line:
$this->callback($this->onAction);
Inset this code just below the mentioned line:
With this line, we've added a new parameter called 'custom' to array which will be used to create a request sent to PayPal. Thanks to this, we are sending visitor ID so we can use it later to determine who was the referring affiliate.
Save your work and proceed to step 3.
3
Integration with PayPal within aMember - step 2
The last step is to handle IPN notification sent from PayPal and to resend it to your Post Affiliate Pro. Locate this file:
/amember/library/Am/Paysystem/Transaction/Paypal.php
and find this line:
public function validateSource() {
Insert this code just below the mentioned line:
Save your work and that's it. Do not forget to activate your PayPal IPN
handling plugin in Post Affiliate Pro to make it all working.
4
Integration of aMember signup
If you want new users to become affiliate automatically, it is possible to synchronize aMember signup form with Post Affiliate Pro. The method uses API so you have to copy the API file (merchant panel Tools> Integration> API integration) and paste it to aMember directory application/default/controllers/
Now, open the file SignupController.php for edit, find the function process and find this line:
$this->user->insert();
Paste the below code right after the mentioned line:
Note there is a line (line 5) where merchant username and password is defined, please set the correct one there.