Payments Overview
This section provides an overview of the different payment methods supported by our platform, including gateways (MercadoPago, Stripe, and PayU), coupons, and manual payments, as well as a description of the different payment flows:
Coupons
Coupons are a tool to offer discounts and promotions to users on our platform. They can be configured while logged in as an administrator in the control panel.
Coupon Configuration Options
- The coupon discount is managed as a percentage, ranging from 1% to 100%.
- You can set a usage limit, for example, 100 uses or 1 use for single-use coupons.
- A validity or expiration date can be set for the coupon.
- A coupon can be applied to both one-time product purchases and subscriptions.
- You can limit a user to use a coupon only once.
- The number of uses per publication can be limited.
- You can set the coupon so that once it is redeemed, the discount is valid until the end of the month in which it was redeemed.
Manual Payments
Manual payments allow for the registration of charges that occur outside the platform. These can be done from the dashboard, bulk import, orders API, or an integration that assigns content (LTI or SAML)
Gateways
We currently support the following payment gateways. Payments through Gateways can be made using either Publica.la credentials or the Tenant's own credentials.
| Gateway | MercadoPago | Stripe | PayU |
|---|---|---|---|
| One Off Payment | YES | YES | YES |
| Recurring Payment | YES | YES | NO |
| Publica.la Credentials | YES | YES | NO |
| Income Webhook | YES | YES | NO |
| Priority Order | 1 | 10 in case Stripe BR, 100 in other case | 1 |
| Currency supported | ARS,MXN,COP,PEN,CLP,UYU | for more detail see https://docs.stripe.com/currencies | ARS,COP,MXN,USD,PEN,CLP] |
MercadoPago
MercadoPago is a gateway commonly used by tenants in Latin America, mainly in Argentina. It can be used with our own credentials for Argentina or with the Tenant's credentials. Our platform integrates with MercadoPago to support one-time payments for single purchases, whether physical or electronic, and recurring payments for different subscription plans.
Resources
- Api reference: https://www.mercadopago.com.ar/developers/en/reference
- Test cards: https://www.mercadopago.com.ar/developers/es/docs/your-integrations/test/cards
- webhook docs: https://www.mercadopago.com.ar/developers/es/docs/your-integrations/notifications/webhooks
Test cards
Argentina:
- Visa: 4509 9535 6623 3704
- Mastercard: 5031 7557 3453 0604
- American Express: 3711 803032 57522
Argentina MP keys
{
"client_id" : "3138507210604323",
"client_secret": "9n2flgTDCYcW0uZX7IrZIjKI0kc8AUOK"
}
Chile MP keys
{
"client_id" : "5415687431195607",
"client_secret": "kLmbmVqLTgqat5H62LI0zrTF6qAaP4bM"
}
Stripe
Stripe is a gateway that supports most currencies. It has special handling for charges in Brazilian Reals, as it uses special credentials from Publica.la and requires the CPF code (https://en.wikipedia.org/wiki/CPF_number). Our integration with Stripe supports both one-time and recurring payments.
- Api reference: https://docs.stripe.com/
- Test cards: https://stripe.com/docs/testing
Sandbox Credentials
- 4242424242424242
{
"client_id" : "pk_test_2kkNJfpYnJC9zcrA97GtW3VO",
"client_secret": "sk_test_Zx4gw65D058Mmw0VxJZpEpVu"
}
PayU
PayU is a gateway used by some of our Tenants, and we do not have credentials from Publica.la. Our platform supports PayU for handling transactions, but it is currently limited to one-time payments.
- Api reference: https://corporate.payu.com/developer-documentation/
Sandbox Credentials
-
http://developers.payulatam.com/es/web_checkout/sandbox.html
-
Credit Card Type Credit Card Number
-
MasterCard 5555555555554444
-
MasterCard 5105105105105100
-
Visa 4111111111111111
-
Visa 4012888888881881
merchantId API Login API Key accountId País
508029 pRRXKOl8ikMmt9u 4Vj8eK4rloUd272L48hsrarnUA 512322 Argentina
512325 Chile
512321 Colombia
512324 México
512326 Panamá
512323 Perú
512327 Brasil
Webhooks
Webhooks are implemented for Mercado Pago and Stripe. At the time of each operation, or any subsequent modification of it, we should receive an update notification via webhooks. With that notification, we retrieve the updated data from the gateway and synchronize it with the order. These updates can be: Payment accreditations where we need to approve an order that was pending. Subscription approvals (with or without payments) where we also approve a recurring order. Subscription cancellations. Payment refunds. In Mercado Pago, there is a possibility that a subscription becomes unlinked from an order when the user does not return to the store, and we cannot update the order's gateway_key. For these cases, when the webhooks system receives a subscription for which it does not find an order, it tries to find the unlinked order by searching for a similar order that is pending, without a gateway_key, from a user with the same email as the one who paid in Mercado Pago. If there is a match, it links the order. If there is no match, it notifies via Slack to the # channel and marks it as pending manual linkage. The support team can then identify them either manually or through a user's claim, and link the order with a pre-approval from an action in Nova.
Payment Flow
Common Payment Flow:
- A user arrives at a publication page.
- They can either buy individually or add items to the cart.
- When the cart is complete, they proceed to checkout.
- The customer can apply a coupon if necessary.
- If it's a physical book, they enter the shipping address.
- If the purchase is in Brazilian Reals, the CPF field is mandatory.
- Depending on the currency, a gateway that supports it is offered based on the priority defined in the gateways table.
- A pending order is created for that product.
- The checkout process starts at the gateway for that cart or product.
Mercado Pago Case
Individual
- A payment intent is created.
- The user is redirected to the init_point of that payment.
- The user completes the operation on Mercado Pago and returns to the store.
- Upon returning to the store, we update the order status based on the status received from Mercado Pago.
Subscription
- The preapprovalPlan for that subscription is searched.
- If not found, it is created.
- The order ID that was created is stored in session to link it later.
- The user is redirected to the preapprovalPlan URL.
- The user completes the operation on Mercado Pago and has a button to return to the store, which they must click to link the order with the payment.
- If they press the button and return to the store, we search for the order number in the session and update the gateway_key of that order. The gateway_key is the ID of the preapproval created in that preapprovalPlan.
- The order status is updated based on the status received from Mercado Pago.
Stripe Case
Individual
- A payment intent is created.
- The user is redirected to the init_point of that payment.
- The user completes the operation on Stripe and returns to the store.
- Upon returning to the store, we update the order status based on the status received from Stripe.
Subscription
- The preapprovalPlan for that subscription is searched.
- If not found, it is created.
- The order ID that was created is stored in session to link it later.
- The user is redirected to the preapprovalPlan URL.
- The user completes the operation on Stripe and returns to the store.
- Upon returning to the store, we search for the order number in the session and update the gateway_key of that order. The gateway_key is the ID of the preapproval created in that preapprovalPlan.
- The order status is updated based on the status received from Stripe.
PayU Case
Only Individual
- A payment intent is created.
- The user is redirected to the init_point of that payment.
- The user completes the operation on PayU and returns to the store.
- Upon returning to the store, we update the order status based on the status received from PayU.
Additional Notes
All gateways have a return URL. When the user returns to the store after checkout, we receive the operation data and, depending on the case, we can update the order status based on the checkout result.
If the order is approved, the user gains access to the content.
If the user does not return to the store, the order will remain approved until processed by an "async payment process."
Payment Synchronization
For detailed information about how payments are synchronized between gateways and publica.la, including automated jobs and processes, please see the Payment Synchronization documentation.