Skip to content
Digisys Alpha
Menu

Webpay Plus · Laravel · multi-tenant

Webpay Plus in a multi-tenant Laravel app

For Webpay Plus in a multi-tenant Laravel app, store each tenant's Transbank credentials separately, create the transaction, redirect the customer with the token, and always commit the transaction when they return before marking the order paid.

By Ahmed Memon · Published 2026-11-27 · Updated 2026-11-27 · 6 min read

Webpay Plus is a common card checkout in Chile, run by Transbank. The flow is simple for one shop and needs care when many tenants share one codebase.

The flow

  • Create a transaction with an amount, order ID and return URL. Transbank gives you a token and a URL.
  • Send the customer to that URL with the token.
  • When they return, commit the transaction with the token and read the response.
  • Mark the order paid only if the committed result says it was approved.

Multi-tenant specifics

  • Keep each tenant's commerce code and API key in encrypted storage, never in shared config.
  • Build the return URL from the tenant's own domain so customers land back on the right site.
  • Store the token against the order so a return can be matched to a tenant and an order.
  • Use the integration environment for tests and switch credentials per tenant when going live.

Edge cases

  • The customer closes the tab after paying: provide a way to look up the transaction later.
  • The customer cancels or the payment times out: the return arrives without a successful result.
  • The same return URL is opened twice.

Always follow Transbank's current developer documentation for field names and limits, since they change between SDK versions.

Questions

Do I need a different commerce code per tenant?

Each business that receives money normally has its own Transbank commerce code, so store them per tenant.

Is the redirect enough to mark an order paid?

No. Commit the transaction and check the result first.

Need this built or reviewed?

Book a 30-minute discovery call or message us on WhatsApp. We reply within one business day.