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.
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:
<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’].
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>
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>
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:
<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
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:
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 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.
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
- Stripe Review 2023: Is It The Best Payment Processor?
- Stripe 2023 Review: Pricing, Features & Alternatives
- Is Stripe Right For Your Business? 2023 Review
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:
- Square
- Stax Payments
- PayPal
- Clover
- Payment Depot
- Helcim
- Gravity Payments
- Merchant One
- Elavon
- Intuit QuickBooks Payments
Effortlessly integrate your e-commerce site with Post Affiliate Pro and boost your affiliate program's success. Our expert team ensures seamless integration with your payment processor, handling technical issues along the way. Enjoy a free trial and free integration service, saving you time and maximizing your ROI. Join now and experience top-notch affiliate management with over 500 integration options.
Integrate TrialPay with Post Affiliate Pro to boost your sales effortlessly. Activate the TrialPay plugin, set up your URL, and add essential code to buttons for seamless integration. Trusted by top e-commerce brands, this solution enhances your current traffic's monetization potential. Visit now to transform your sales strategy!