Skip to content

Commit

Permalink
feat: add build method for mall full transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarlic committed Aug 19, 2024
1 parent 12d4a40 commit f5b1615
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import cl.transbank.util.WebpayApiResource;
import cl.transbank.webpay.common.MallTransactionCaptureRequest;
import cl.transbank.webpay.common.MallTransactionRefundRequest;
import cl.transbank.webpay.common.WebpayOptions;
import cl.transbank.webpay.exception.*;
import cl.transbank.webpay.transaccioncompleta.model.*;
import cl.transbank.webpay.transaccioncompleta.requests.*;
Expand All @@ -29,6 +30,30 @@ public MallFullTransaction(Options options) {
super(options);
}

/**
* Creates and returns an instance of `MallFullTransaction` configured for the integration environment.
*
* @param commerceCode The commerce code.
* @param apiKey The API key used for authentication.
* @return A new instance of `MallFullTransaction` configured for the test environment (IntegrationType.TEST).
*/
public static MallFullTransaction buildForIntegration(String commerceCode, String apiKey)
{
return new MallFullTransaction(new WebpayOptions(commerceCode, apiKey, IntegrationType.TEST));
}

/**
* Creates and returns an instance of `MallFullTransaction` configured for the production environment.
*
* @param commerceCode The commerce code.
* @param apiKey The API key used for authentication.
* @return A new instance of `MallFullTransaction` configured for the production environment (IntegrationType.LIVE).
*/
public static MallFullTransaction buildForProduction(String commerceCode, String apiKey)
{
return new MallFullTransaction(new WebpayOptions(commerceCode, apiKey, IntegrationType.LIVE));
}

public MallFullTransactionCreateResponse create(
String buyOrder,
String sessionId,
Expand Down

0 comments on commit f5b1615

Please sign in to comment.