//inicio sección de importación
import cl.transbank.common.IntegrationApiKeys;
import cl.transbank.common.IntegrationCommerceCodes;
import cl.transbank.common.IntegrationType;
import cl.transbank.model.MallTransactionCreateDetails;
import cl.transbank.webpay.common.WebpayOptions;
import cl.transbank.webpay.webpayplus.responses.*;
import cl.transbank.webpay.webpayplus.WebpayPlus;
//fin sección de importación
WebpayPlus.MallTransaction tx = new WebpayPlus.MallTransaction(new WebpayOptions(IntegrationCommerceCodes.WEBPAY_PLUS_MALL, IntegrationApiKeys.WEBPAY, IntegrationType.TEST));
String buyOrder = "buyOrder_" + getRandomNumber();
String buyOrderMallOne = "childBuyOrder_" + getRandomNumber();
String buyOrderMallTwo = "childBuyOrder_" + getRandomNumber();
String sessionId = "sessionId_" + getRandomNumber();
double amountMallOne = 1000;
double amountMallTwo = 1000;
String returnUrl = request.getRequestURL().toString().replace("create","commit");
String mallOneCommerceCode = IntegrationCommerceCodes.WEBPAY_PLUS_MALL_CHILD1;
String mallTwoCommerceCode = IntegrationCommerceCodes.WEBPAY_PLUS_MALL_CHILD2;
final MallTransactionCreateDetails mallDetails = MallTransactionCreateDetails.build()
.add(amountMallOne, mallOneCommerceCode, buyOrderMallOne)
.add(amountMallTwo, mallTwoCommerceCode, buyOrderMallTwo);
{
"token": "01ab6f4a85fc0e50d2fb770d940149567692aca15e75dce0e9ad781ec2c7c7fd",
"url": "https://webpay3gint.transbank.cl/webpayserver/initTransaction"
}
<form action="01ab6f4a85fc0e50d2fb770d940149567692aca15e75dce0e9ad781ec2c7c7fd" method="POST">
<input type="hidden" name="token_ws" value="01ab6f4a85fc0e50d2fb770d940149567692aca15e75dce0e9ad781ec2c7c7fd"/>
<input type="submit" value="Pagar"/>
</form>
| Campo | Valor |
|---|---|
| Orden de compra (buyOrder) | |
| ID de sesión (sessionid) | |
| Detalle 1 (details) |
Monto: 1000.0 Código de Comercio: 597055555536 Orden de Compra: childBuyOrder_1426855040 |
| Detalle 2 (details) |
Monto: 1000.0 Código de Comercio: 597055555537 Orden de Compra: childBuyOrder_499429222 |
| URL de retorno (returnUrl) |