# Transbank Webpay Plus

https://docs.wisecp.com/en/transbank-module

Collect card payments from clients in Chile on Transbank's Webpay Plus page, in Chilean pesos or US dollars.

## Reaching the Screen

Go to **Settings → Financial → Payment Gateways**, open **All Modules** and click the Transbank Webpay Plus card: `{admin}/modules/payment?module=Transbank`

Tick **Status** and save to list the method on the payment step as **Pay with Webpay**. Use [Payment Gateways](https://docs.wisecp.com/en/payment-modules) to order the methods clients see.

## What Is on the Screen

The card holds your commerce code, the secret key, the environment switch and the shared gateway settings.

On the payment step the client clicks **Continue to Webpay** and pays on Transbank's page. The payment is confirmed when the client returns to your site.

Webpay Plus has no saved cards and no subscriptions. Every invoice is paid on Transbank's page.

## Before You Configure It

- A Webpay Plus commerce code and its secret key from Transbank. Integration codes differ from production codes, and Transbank publishes them with test cards in its documentation.
- An invoice in Chilean pesos or US dollars. For any other currency, set **Converting Currency** to CLP.

## Fields

- **Status**: Turns the module on. While it is off the other fields stay locked and clients are never offered the method.
- **Commerce Code**: Required. The commerce code Transbank issued to you.
- **Secret Key**: Required. The secret key of that commerce code. It is not shown again after saving.
- **Integration Environment**: Sends payments to Transbank's integration environment instead of production. Off by default.

For commission, currency conversion, amount and country limits, see [Payment Configuration](https://docs.wisecp.com/en/payment-modules). **Callback URL**, **Success URL** and **Failed URL** cannot be edited. The client's return address travels with each payment, so there is nothing to register at Transbank.

## Tasks

### Connect your commerce code

1. Open the Transbank Webpay Plus card under **All Modules** and tick **Status**.
2. Enter an integration commerce code and its key in **Commerce Code** and **Secret Key**. Tick **Integration Environment**.
3. Click **Save Changes**. The method now appears on the payment step.

### Run a test payment

1. Place a small order in CLP as a client and choose **Pay with Webpay** on the payment step.
2. Click **Continue to Webpay** and pay with one of Transbank's test cards.
3. Return to the site. The payment is confirmed and the invoice is marked as paid.

### Switch to production

1. Replace **Commerce Code** and **Secret Key** with your production values.
2. Untick **Integration Environment** and save.
3. Repeat the test with a real low-value payment.

### Refund a payment

1. Open the invoice from [Invoice Detail](https://docs.wisecp.com/en/invoice-detail-overview).
2. Under **Summary → Change Status**, select **Refunded** and **Refund via payment gateway**. Click **Update Status**.
3. Transbank returns what is left of the payment, and the invoice is marked as refunded.

Transbank accepts refunds for up to 90 days after the payment.

## Things to Watch

> **A combined payment is refunded per invoice**
> 
> When one Webpay transaction paid several invoices, only the refunded invoice's share goes back. Pesos are refunded in whole numbers, dollars with two decimals. If the share cannot be worked out, nothing is sent and the panel says so. Version 5.0-beta.4 and earlier refund the whole transaction.

> **When a share refund is held back**
> 
> Transbank refunds a debit or prepaid card only in full, so a share of it is never sent. A share is also held back when Transbank holds less than the invoices not yet refunded here. In both cases, refund in the Transbank portal, then mark the invoices **Refunded** with **Add as expense**.

> **The return confirms the payment**
> 
> Transbank keeps a payment only after your site confirms it on the client's return. A payment left unconfirmed is dropped by Transbank, and the invoice stays open.

## Required Privileges

Settings require **Payment Gateways** (`MODULES_PAYMENT_SETTINGS`). Invoice changes require **Billing → Edit** (`INVOICES_OPERATION`).

## Related Articles

- [Payment Configuration](https://docs.wisecp.com/en/payment-modules)
- [Invoice Detail](https://docs.wisecp.com/en/invoice-detail-overview)
