Implementing our payment solution is as simple as implementing our paywall solution! :)

To begin, you need to integrate the script basis:

<script src="https://assets.poool.fr/pay.min.js" async></script>
<script>
  document.addEventListener('DOMContentLoaded', function() {

    Pay.init('XXXX-XXXX-XXXX-XXXX')

Replace XXXX-XXXX-XXXX-XXXX by your app id.

Pay.config({ cookiesEnabled: <boolean> });

To be GDPR-compliant, we have put in place a configuration you MUST provide when implementing Poool's script. By default, this value is defined to "false" and prevents the user's session to be recorded.
 
⚠️ Important: you need to collect your users' consent first.

Replace <boolean> by the value of your user's consent.
After that, you can add configuration values according to your needs: https://dev.poool.fr/pay/configuration.

Display Poool Pay's button in your page

    Pay.createButton({
      target: '#pay-button',
      productType: 'premium-article',
      itemID: 'article-about-something-cool-12345',
    });
  }, false);

Add this code at the end of the script:
target: the CSS selector of the place where the button has to show
productType: the name of the product type, previously created in the Dashboard (see article)
itemID: the slug or identifier of the article/product sold

How to lock my content 

If you're already using Access, you know our masking methods: hide, excerpt and custom.

On Poool Pay, we did not implement any native masking method.

The reason for that is really simple: Poool Pay allows you to use our payment tool to sell any quality content as a pdf, an audio file, a premium article, a podcast, a special investigation... in other word a piece of content requiring a locking/unlocking method that totally fits it! The solution must be agnostic.

When the page is loading, the masking method must be managed on the publisher's side.

How to unlock my content 

You have to use the "onPurchase" Poool method.

Pay.on('onPurchase', function(event) {
    console.log('Article ' + event.itemID + ' acheté !');
    });

This event is triggered when the user validates their payment. You must implement the unlocking logic inside this function.

If you have a single-page application like a React one, get in touch with us!

At the end, your code should more or less look like the following one, depending on your configurations:

<script src="https://assets.poool.fr/pay.min.js" async></script>
<script>
  document.addEventListener('DOMContentLoaded', function() {

    Pay.init('XXXX-XXXX-XXXX-XXXX')
    Pay.config({ cookiesEnabled: <boolean> });
   
    // Pay.config({ debug: true })

    Pay.on('onPurchase', function(event) {
        console.log('Article ' + event.itemID + ' acheté !');
     });


    Pay.createButton({
      target: '#pay-button',
      productType: 'article-premium',
      itemID: 'article-a-propos-de-quelque-chose-de-cool-12345',
    });
  }, false);
</script>

Find the whole documentation at this address: https://dev.poool.fr/pay/quick-start

Of course, we are there to help you in any doubt, do don't hesitate to get in touch with us via Intercom!

Avez-vous trouvé votre réponse?