A suite of APIs that powers commerce for businesses of all sizes.
Stripe makes it easy to start accepting credit cards on the web today. The integration method uses our built in plugin for notification handling.
The integration handles orders, recurring orders and refunds as well. It also supports lifetime commissions and coupon handling.
Cookie data – order form
Each customer account in stripe has an extra field called ‘description‘. In this integration method, we are using it. The task is to add the (tracking) cookie value into the description field found in your order form. The easiest way is to add this code to your payment form:
When the form is submitted (customer is ordering), you can process the form data the standard way and before creating a charge and a customer account (with Stripe_Customer::create), you have to use the pap_custom data from the submitted form and set the value as a customer description – “description” => $_POST[‘pap_custom’].
Cookie data – Stripe Checkout
If you are using the Stripe Checkout then instead of the step above you need to do this one. Essentially, what needs to be done is to add a tracking cookie value into the client-reference-id variable of Stripe’s session object. Take a look here on how to get the tracking cookie value (visitor ID).
Here is an example of a Stripe Checkout button:
<script async src="https://js.stripe.com/v3/buy-button.js"> </script> <stripe-buy-button buy-button-id="buy_btn_BBBBBBBBBBBBBB" publishable-key="pk_test_XXXXXXXXXXXXXXXXXXX" > </stripe-buy-button>
Cookie data – Stripe payment links
If you are using Stripe payment links then you need to pass the tracking cookie value as
client_reference_id query string parameter to the link. To be able to do that you need to assign an ID to the <a> link element, so for example you’d assign “papCookie” as the link ID so it would be:
<a id="papCookie" href="https://buy.stripe.com/2wM8yP31J6vF6wodQZ">Pay now</a>
Once you have the ID you need to execute the PostAffTracker.writeCookieToLink(‘papCookie‘, ‘
client_reference_id‘); function of the click tracking code with the link’s ID (in our example papCookie) and the name of the query string parameter which should be added (
client_reference_id), so for example like this:
Another category of Stripe payment tools are Stripe pricing tables. It supports the use of client-reference-id so the integration of it is possible as well.
The sale tracking will happen automatically, both for standard and for recurring charges. The last step is to set your Stripe to inform your Post Affiliate Pro about each charge. This is done by Stripe webhooks.
To set a webhook navigate to Developers menu section (top right) and then navigate to Webhooks. Clicking Add endpoint reveals a form to add a new URL for receiving webhooks. Enter this URL there for live notifications:
In case of events to listen to you can add invoice.payment_succeeded, charge.succeeded and charge.refunded. If you are using Stripe Checkout or Stripe payment links then you will also need checkout.session.completed event.
If you wish to track test payments as well set up the same webhook in the test mode too.
The last step is to activate the built-in plugin in your Post Affiliate Pro. Do not forget to configure it after activation by adding the Secret API key or a Restricted API key. In case you’d like to use a Restricted API key you need to allow read access for these resources: Charges, Subscriptions, Checkout Sessions, Customers and Invoices.
That’s it, you are done. All the transactions will now be tracked.
Do not forget to integrate your site with the click tracking code to make it all working.
Instamojo is a popular payment gateway in India for small businesses. To integrate it, get the API key and Auth Token, enable the tracking plugin, and add the sale tracking code.
Set up the PayWhirl integration with Post Affiliate Pro by installing the Custom Tracking Scripts app and creating a webhook for account events charge.succeeded and charge.refunded. Activate the PayWhirl webhook handling plugin in your Post Affiliate Pro account and configure it according to your preferences. Integrate your site with the click tracking code for complete functionality.
You can integrate Netsuite's business software suite for better management or start with one module and add functionality as needed. Use tracking codes and custom scripts to track sales and orders. Different integration methods and codes are provided based on the version and features you want to use.
To integrate Post Affiliate Pro into CS-cart, go to the File Editor and add the tracking code to the Complete.tpl or Index.tpl file.