Skip to content

Commit

Permalink
2.4.5 (#101)
Browse files Browse the repository at this point in the history
Co-authored-by: Unknown <[email protected]>
  • Loading branch information
magnomoreira and samuelleitemundipagg authored Jun 19, 2023
1 parent 5611083 commit 2c7507b
Show file tree
Hide file tree
Showing 15 changed files with 292 additions and 40 deletions.
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ In order to setup authentication and initialization of the API client, you need

| Parameter | Description |
|-----------|-------------|
| serviceRefererName | TODO: add a description |
| basicAuthUserName | The username to use with basic authentication |
| basicAuthPassword | The password to use with basic authentication |

Expand All @@ -94,10 +95,11 @@ API client can be initialized as following.

```java
// Configuration parameters and credentials
String serviceRefererName = "serviceRefererName";
String basicAuthUserName = "basicAuthUserName"; // The username to use with basic authentication
String basicAuthPassword = "basicAuthPassword"; // The password to use with basic authentication

MundiAPIClient client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);
MundiAPIClient client = new MundiAPIClient(serviceRefererName, basicAuthUserName, basicAuthPassword);
```


Expand Down Expand Up @@ -874,8 +876,8 @@ void getSubscriptionsAsync(
#### Example Usage

```java
Integer page = 234;
Integer size = 234;
Integer page = 42;
Integer size = 42;
String code = "code";
String billingType = "billing_type";
String customerId = "customer_id";
Expand Down Expand Up @@ -944,8 +946,8 @@ void getUsagesDetailsAsync(
```java
String subscriptionId = "subscription_id";
String cycleId = "cycle_id";
Integer size = 234;
Integer page = 234;
Integer size = 42;
Integer page = 42;
String itemId = "item_id";
String group = "group";
// Invoking the API call with sample inputs
Expand Down Expand Up @@ -1166,8 +1168,8 @@ void getUsagesAsync(
```java
String subscriptionId = "subscription_id";
String itemId = "item_id";
Integer page = 234;
Integer size = 234;
Integer page = 42;
Integer size = 42;
String code = "code";
String group = "group";
DateTime usedSince = new Date();
Expand Down Expand Up @@ -1276,8 +1278,8 @@ void getIncrementsAsync(

```java
String subscriptionId = "subscription_id";
Integer page = 234;
Integer size = 234;
Integer page = 42;
Integer size = 42;
// Invoking the API call with sample inputs
subscriptions.getIncrementsAsync(subscriptionId, page, size, new APICallBack<ListIncrementsResponse>() {
public void onSuccess(HttpContext context, ListIncrementsResponse response) {
Expand Down Expand Up @@ -1398,8 +1400,8 @@ void getSubscriptionItemsAsync(

```java
String subscriptionId = "subscription_id";
Integer page = 234;
Integer size = 234;
Integer page = 42;
Integer size = 42;
String name = "name";
String code = "code";
String status = "status";
Expand Down Expand Up @@ -1852,8 +1854,8 @@ void getDiscountsAsync(

```java
String subscriptionId = "subscription_id";
int page = 70;
int size = 70;
int page = 134;
int size = 134;
// Invoking the API call with sample inputs
subscriptions.getDiscountsAsync(subscriptionId, page, size, new APICallBack<ListDiscountsResponse>() {
public void onSuccess(HttpContext context, ListDiscountsResponse response) {
Expand Down Expand Up @@ -2413,8 +2415,8 @@ void getOrdersAsync(
#### Example Usage

```java
Integer page = 70;
Integer size = 70;
Integer page = 134;
Integer size = 134;
String code = "code";
String status = "status";
DateTime createdSince = new Date();
Expand Down Expand Up @@ -2974,8 +2976,8 @@ void getPlansAsync(
#### Example Usage

```java
Integer page = 70;
Integer size = 70;
Integer page = 134;
Integer size = 134;
String name = "name";
String status = "status";
String billingType = "billing_type";
Expand Down Expand Up @@ -3642,8 +3644,8 @@ void getInvoicesAsync(
#### Example Usage

```java
Integer page = 70;
Integer size = 70;
Integer page = 134;
Integer size = 134;
String code = "code";
String customerId = "customer_id";
String subscriptionId = "subscription_id";
Expand Down Expand Up @@ -3773,8 +3775,8 @@ void getAccessTokensAsync(

```java
String customerId = "customer_id";
Integer page = 70;
Integer size = 70;
Integer page = 134;
Integer size = 134;
// Invoking the API call with sample inputs
customers.getAccessTokensAsync(customerId, page, size, new APICallBack<CustomersAccessTokensResponse1>() {
public void onSuccess(HttpContext context, CustomersAccessTokensResponse1 response) {
Expand Down Expand Up @@ -3977,8 +3979,8 @@ void getAddressesAsync(

```java
String customerId = "customer_id";
Integer page = 70;
Integer size = 70;
Integer page = 134;
Integer size = 134;
// Invoking the API call with sample inputs
customers.getAddressesAsync(customerId, page, size, new APICallBack<CustomersAddressesResponse>() {
public void onSuccess(HttpContext context, CustomersAddressesResponse response) {
Expand Down Expand Up @@ -4410,8 +4412,8 @@ void getCardsAsync(

```java
String customerId = "customer_id";
Integer page = 70;
Integer size = 70;
Integer page = 92;
Integer size = 92;
// Invoking the API call with sample inputs
customers.getCardsAsync(customerId, page, size, new APICallBack<CustomersCardsResponse1>() {
public void onSuccess(HttpContext context, CustomersCardsResponse1 response) {
Expand Down Expand Up @@ -5093,8 +5095,8 @@ void getChargesAsync(
#### Example Usage

```java
Integer page = 162;
Integer size = 162;
Integer page = 92;
Integer size = 92;
String code = "code";
String status = "status";
String paymentMethod = "payment_method";
Expand Down Expand Up @@ -5485,8 +5487,8 @@ void getChargeTransactionsAsync(

```java
String chargeId = "charge_id";
Integer page = 162;
Integer size = 162;
Integer page = 92;
Integer size = 92;
// Invoking the API call with sample inputs
charges.getChargeTransactionsAsync(chargeId, page, size, new APICallBack<ChargesTransactionsResponse>() {
public void onSuccess(HttpContext context, ChargesTransactionsResponse response) {
Expand Down Expand Up @@ -5764,8 +5766,8 @@ void getRecipientsAsync(
#### Example Usage

```java
Integer page = 162;
Integer size = 162;
Integer page = 92;
Integer size = 92;
// Invoking the API call with sample inputs
recipients.getRecipientsAsync(page, size, new APICallBack<RecipientsResponse>() {
public void onSuccess(HttpContext context, RecipientsResponse response) {
Expand Down Expand Up @@ -5930,8 +5932,8 @@ void getAnticipationsAsync(

```java
String recipientId = "recipient_id";
Integer page = 162;
Integer size = 162;
Integer page = 92;
Integer size = 92;
String status = "status";
String timeframe = "timeframe";
DateTime paymentDateSince = new Date();
Expand Down Expand Up @@ -6263,8 +6265,8 @@ void getTransfersAsync(

```java
String recipientId = "recipient_id";
Integer page = 162;
Integer size = 162;
Integer page = 92;
Integer size = 92;
String status = "status";
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
Expand Down Expand Up @@ -6489,8 +6491,8 @@ void getWithdrawalsAsync(

```java
String recipientId = "recipient_id";
Integer page = 162;
Integer size = 162;
Integer page = 92;
Integer size = 92;
String status = "status";
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>MundiAPILib</groupId>
<artifactId>mundi-apilib</artifactId>
<version>2.4.4</version>
<version>2.4.5</version>
<packaging>jar</packaging>

<name>MundiAPILib</name>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/mundipagg/api/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class Configuration {
//The base Uri for API calls
public static String baseUri = "https://api.mundipagg.com/core/v1";

//TODO: Replace the serviceRefererName with an appropriate value
public static String serviceRefererName = "";

//The username to use with basic authentication
//TODO: Replace the basicAuthUserName with an appropriate value
public static String basicAuthUserName = "TODO: Replace";
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/mundipagg/api/MundiAPIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ public MundiAPIClient() {
/**
* Client initialization constructor
*/
public MundiAPIClient(String basicAuthUserName, String basicAuthPassword) {
public MundiAPIClient(String serviceRefererName, String basicAuthUserName, String basicAuthPassword) {
this();
Configuration.serviceRefererName = serviceRefererName;
Configuration.basicAuthUserName = basicAuthUserName;
Configuration.basicAuthPassword = basicAuthPassword;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class BaseController {
*/
private static HttpClient clientInstance = null;
private static final Object syncObject = new Object();
protected static final String userAgent = "MundiSDK - Java 2.4.4";
protected static final String userAgent = "MundiSDK - Java 2.4.5";

/**
* Protected variable to keep reference of httpCallBack instance if user provides any
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/mundipagg/api/controllers/ChargesController.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ private HttpRequest _buildGetChargeRequest(

//load all headers for the outgoing API request
Map<String, String> _headers = new HashMap<String, String>();
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -274,6 +276,8 @@ private HttpRequest _buildCancelChargeRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -427,6 +431,8 @@ private HttpRequest _buildConfirmPaymentRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -580,6 +586,8 @@ private HttpRequest _buildUpdateChargeCardRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -785,6 +793,8 @@ private HttpRequest _buildGetChargesRequest(

//load all headers for the outgoing API request
Map<String, String> _headers = new HashMap<String, String>();
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -932,6 +942,8 @@ private HttpRequest _buildRetryChargeRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -1085,6 +1097,8 @@ private HttpRequest _buildUpdateChargePaymentMethodRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -1238,6 +1252,8 @@ private HttpRequest _buildUpdateChargeMetadataRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -1391,6 +1407,8 @@ private HttpRequest _buildCaptureChargeRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -1544,6 +1562,8 @@ private HttpRequest _buildUpdateChargeDueDateRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -1687,6 +1707,8 @@ private HttpRequest _buildCreateChargeRequest(
if (idempotencyKey != null) {
_headers.put("idempotency-key", idempotencyKey);
}
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -1846,6 +1868,8 @@ private HttpRequest _buildGetChargeTransactionsRequest(

//load all headers for the outgoing API request
Map<String, String> _headers = new HashMap<String, String>();
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down Expand Up @@ -2001,6 +2025,8 @@ private HttpRequest _buildGetChargesSummaryRequest(

//load all headers for the outgoing API request
Map<String, String> _headers = new HashMap<String, String>();
_headers.put("ServiceRefererName", Configuration.serviceRefererName);

_headers.put("user-agent", BaseController.userAgent);
_headers.put("accept", "application/json");

Expand Down
Loading

0 comments on commit 2c7507b

Please sign in to comment.