Stripe

Integrate Stripe with Post Affiliate Pro using built-in plugins for notification handling, tracking codes, and webhooks. Supports orders, refunds, lifetime commissions, and coupon handling. Ensure seamless payment tracking with Stripe Checkout and payment links.

Stripe

Stripe integration

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.

How to integrate PostAffiliatePro with Stripe

The integration handles orders, recurring orders and refunds as well. It also supports lifetime commissions and coupon handling.

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:

<input type="hidden" name="pap_custom" value="" id="pap_tdx8v2s5a" />

<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
  PostAffTracker.writeCookieToCustomField('pap_tdx8v2s5a');
</script>

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’].

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>

This is how an integrated buttons would look like (the stripe button code gets added using JavaScript now):

<script async src="https://js.stripe.com/v3/buy-button.js">
</script>
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
  var papCookie = '';
  PostAffTracker.setAccountId('Account_ID');
  try {
    PostAffTracker.track();
  } catch (err) { }
  papCookie = PostAffTracker._getAccountId() + PostAffTracker._cmanager.getVisitorIdOrSaleCookieValue();
  document.write('<stripe-buy-button buy-button-id="_buy_btn_BBBBBBBBBBBBBB_ " publishable-key="_pk_test_XXXXXXXXXXXXXXXXXXX_ " **client-reference-id** ="' + papCookie + '"></stripe-buy-button>');
</script>

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:

<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
  try {
    PostAffTracker.setAccountId('Account_ID');
    PostAffTracker.track();
    PostAffTracker.writeCookieToLink('papCookie', 'client_reference_id');
  } catch (err) { }
</script>

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.

Sale tracking – webhook setup

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 (bottom left) and then navigate to Webhooks. Click Add endpoint and use the below URL as your endpoint for receiving webhooks. Enter this URL there for live notifications:

https://URL_TO_PostAffiliatePro/plugins/Stripe/stripe.php?AccountId=Account_ID

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 need checkout.session.completed event too.

As of API version make sure to choose the latest one. In case you have problems with an older webhook, you have to update your default API version of your account – navigate to your Workbench and update the API version from there. The other way round is to create a new webhook with the latest API version.

If you wish to track test payments as well set up the same webhook in the test mode too.

Plugin activation

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.

What is Stripe?

Stripe is a comprehensive payments platform designed to facilitate a broad range of transaction processing, allowing businesses to accept payments from customers globally. It supports various payment methods, including credit and debit cards, digital wallets, and localized options. With developer-friendly tools, Stripe supports custom payment solutions and streamlines businesses’ financial operations.

Founded by Patrick and John Collison in 2010, Stripe arose from the desire to solve complex online payment challenges. Initially launched in the United States, its ease of integration quickly gained popularity, especially among developers. Over the years, Stripe expanded globally and added numerous features like Atlas, Radar, and Instant Payouts. Strategic partnerships and acquisitions have continuously bolstered its position in the digital financial ecosystem.

Stripe serves a diverse customer base, including e-commerce businesses, SaaS platforms, and large enterprises. Its flexible API makes it ideal for developers and IT teams, while its robust security features attract companies needing trusted payment handling. Stripe simplifies complex payments and scales according to growing business needs.

Key Features of Stripe

  • Global Payments: Supports over 100 payment methods worldwide.
  • Fraud Prevention with Stripe Radar: Offers sophisticated tools for fraud detection.
  • Revenue Optimization: Provides comprehensive billing, invoicing, and taxation services.
  • Customization through Stripe APIs: Developer-friendly APIs and SDKs for tailored solutions.
  • Multi-party Payments via Stripe Connect: Supports intricate payment schemes for platforms.

Stripe’s Pricing Options

Stripe uses a pay-as-you-go model with standard fees for domestic and international cards, and offers custom pricing plans for larger volumes. Additional services like Radar and Terminal incur separate charges. Businesses can negotiate tailored pricing based on specific needs to optimize costs.

User Insights on Stripe

Users appreciate Stripe’s user-friendly interface, reliability, and strong API integration. However, some express concerns over reporting issues and customer support difficulties. On average, Stripe receives positive feedback but may need improvements in certain service areas to enhance user satisfaction.

YouTube Reviews on Stripe

These reviews provide visual insights into Stripe’s functionality, pricing, and how it compares to other payment processors, offering valuable perspectives for potential users.

Alternatives to Stripe

If you’re considering other options besides Stripe, here are some notable alternatives:

  1. Square
  2. Stax Payments
  3. PayPal
  4. Clover
  5. Payment Depot
  6. Helcim
  7. Gravity Payments
  8. Merchant One – Effortless credit card processing with next-day funding and no middlemen.
  9. Elavon – Innovative, secure payment solutions for global commerce.
  10. Intuit QuickBooks Payments – Integrated payment processing within QuickBooks for easy invoicing and payment management.

Frequently asked questions

What does integrating Stripe with Post Affiliate Pro enable?

Integrating Stripe with Post Affiliate Pro enables seamless credit card acceptance, automated order and refund tracking, and lifetime commissions for affiliates. It supports advanced cookie tracking, sale tracking via webhooks, and easy plugin activation for efficient affiliate management.

How do I track affiliate sales with Stripe?

Affiliate sales are tracked using cookies stored in custom Stripe fields or via client-reference-id in Stripe Checkout and payment links. Sale tracking is completed through Stripe webhooks that notify Post Affiliate Pro about successful, recurring, or refunded payments.

What events should I listen to in Stripe webhooks?

You should listen to events such as invoice.payment_succeeded, charge.succeeded, charge.refunded, and checkout.session.completed (if using Stripe Checkout or payment links) to ensure all transactions are tracked.

Is it possible to use restricted API keys with this integration?

Yes, you can use a Restricted API key for the Stripe plugin in Post Affiliate Pro. Make sure it has read access for Charges, Subscriptions, Checkout Sessions, Customers, and Invoices.

What are alternatives to Stripe for affiliate payments?

Notable alternatives to Stripe include Square, Stax Payments, PayPal, Clover, Payment Depot, Helcim, Gravity Payments, Merchant One, Elavon, and Intuit QuickBooks Payments.

Get Started with Stripe Integration

Enhance your affiliate program with Stripe and Post Affiliate Pro. Start tracking transactions and optimizing your payments today.

You will be in Good Hands!

Join our community of happy clients and provide excellent customer support with Post Affiliate Pro.

Capterra
G2 Crowd
GetApp
Post Affiliate Pro Dashboard - Campaign Manager Interface