Pagtrust
Connect Pagtrust to your Cademí: the product ID or offer code, the webhook token and the version 2.0 webhook with the purchase and subscription events.
Connect Pagtrust to your Cademí so each approved purchase gives the student access on its own. You need the product ID (or the offer code), the webhook token of your Pagtrust account and a webhook pointing to Cademí.
1. Create the delivery in Cademí
- In the Cademí dashboard, open Sales → Deliveries and add a delivery.
- In Select a Gateway, pick Pagtrust. The screen shows the notice This gateway is in the beta implementation phase, but you can already use it: carry on as usual.
- In Delivery Name, enter a name that helps you recognize it later.
- In Sales Mode, choose One-time sale or Subscription, matching the product on Pagtrust.
- The Gateway connection section shows the Product ID and Webhook Token fields and the Postback URL.
Keep the delivery open: you come back to it in the next steps.
2. Find the product ID or the offer code
- In the Pagtrust dashboard, open Produtos (Products) and click the product.
- To use the whole product, copy the product ID under Informações gerais (General information).
- To use a specific offer, edit the product, open Ofertas (Offers), edit the offer and copy its code under Informações gerais.
- Paste the value into Product ID in the Cademí delivery.
Product or offer: when the sale carries both, Cademí first looks for a delivery with the product ID and, if there is none, uses the one with the offer code. To give one offer a different access, do not register the product ID in another delivery.
3. Copy the webhook token
If you already registered your Pagtrust token in another delivery, pick it in Use an already registered token and go to step 4.
- In the Pagtrust dashboard, open Integrações (Integrations) in the side bar and click Webhook.
- Click Copiar Token (Copy token).
- Paste the token into Webhook Token in the Cademí delivery.
4. Set up the webhook
- Still under Integrações → Webhook, click Adicionar (Add; the + button in the top left corner).
- In Nome do Webhook (Webhook name), enter "Cademí".
- In Produtos (Products), choose all of them or only the ones you deliver through Cademí.
- In URL, paste the Postback URL of the delivery.
- In Versão (Version), choose 2.0.
- Select the events: Compra aprovada, Compra reprovada, Compra cancelada, Compra reembolsada, Chargeback, Assinatura criada, Assinatura renovada, Assinatura cancelada and Acesso encerrado (approved, declined, canceled and refunded purchase, chargeback, subscription created, renewed and canceled, and access ended).
- Click Salvar (Save) and, in Cademí, save the delivery.
If you chose only some products: each time you start delivering a new product through Cademí, add it to this webhook configuration.