All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cl.transbank.webpay.wrapper.WSWebpayServiceWrapper Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show newest version
package cl.transbank.webpay.wrapper;

import cl.transbank.webpay.Webpay;
import cl.transbank.webpay.security.SoapSignature;
import com.transbank.webpay.wswebpay.service.*;

public class WSWebpayServiceWrapper extends ServiceWrapperBase {

    private WSWebpayService port;

    protected  WSWebpayServiceWrapper(Webpay.Environment environment, SoapSignature signature) throws Exception {
        super(environment, signature);
        this.port = initPort(
                WSWebpayService.class,
                WSWebpayServiceImplService.SERVICE,
                WSWebpayServiceImplService.WSWebpayServiceImplPort,
                "transbank-ws-webpay-service.wsdl"
        );
    }

    public WsInitTransactionOutput initTransaction(WsInitTransactionInput input){
        return port.initTransaction(input);
    }

    public TransactionResultOutput getTransactionResult(String token){
        TransactionResultOutput result = port.getTransactionResult(token);
        //Se realiza siempre un acknowledge luego de obtener el resultado de la transaccion
        this.acknowledgeTransaction(token);
        return result;
    }

    public void acknowledgeTransaction(String token){
        port.acknowledgeTransaction(token);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy