Skip to content

Commit

Permalink
feat: add build method for patpass
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarlic committed Aug 19, 2024
1 parent f5b1615 commit 932a2d7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/java/cl/transbank/patpass/PatpassComercio.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package cl.transbank.patpass;

import cl.transbank.common.IntegrationType;
import cl.transbank.model.Options;
import cl.transbank.patpass.model.PatpassOptions;
import cl.transbank.webpay.common.WebpayOptions;
import cl.transbank.webpay.webpayplus.WebpayPlus;

/**
* This class represents the details of a MallTransactionCommit.
Expand All @@ -21,4 +25,28 @@ public Inscription(Options options) {
}
}

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

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

}

0 comments on commit 932a2d7

Please sign in to comment.