diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml
new file mode 100644
index 00000000..d91a9b13
--- /dev/null
+++ b/.github/workflows/maven-publish.yml
@@ -0,0 +1,34 @@
+# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
+# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
+
+name: Maven Package
+
+on:
+ release:
+ types: [created]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
+ settings-path: ${{ github.workspace }} # location for the settings.xml file
+
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ - name: Publish to GitHub Packages Apache Maven
+ run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
diff --git a/README.md b/README.md
index cc9b8048..97b4e02d 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,7 @@
+**THIS IS UNOFFICIAL UPDATED CODEBASE OF RAZORPAY JAVA SDK.**
+The codebase has been updated with Java 17 with sourcecode and compile version with all dependencies with latest versions
+The codebase is free from any security checked with checkmarx and sonarlint
+
# Razorpay Java SDK
Official java bindings for the [Razorpay API](https://docs.razorpay.com/docs/payments).
diff --git a/pom.xml b/pom.xml
index a81a4c69..10cdb5bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,8 +36,8 @@
UTF-8
- 1.8
- 1.8
+ 17
+ 17
@@ -54,7 +54,7 @@
org.mockito
mockito-inline
- 2.13.0
+ 5.2.0
test
@@ -66,7 +66,7 @@
com.fasterxml.jackson.core
jackson-databind
- 2.13.1
+ 2.14.2
test
@@ -89,13 +89,13 @@
org.json
json
- 20180130
+ 20220320
commons-codec
commons-codec
- 1.11
+ 1.15
diff --git a/src/main/java/com/razorpay/AddonClient.java b/src/main/java/com/razorpay/AddonClient.java
index d5cafcea..522ca60f 100644
--- a/src/main/java/com/razorpay/AddonClient.java
+++ b/src/main/java/com/razorpay/AddonClient.java
@@ -18,7 +18,8 @@ public Addon fetch(String id) throws RazorpayException {
/**
* It is wrapper of fetchAll with parameter here sending null defines fetchAll
* with a default values without filteration
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @return List of AddOns
*/
public List fetchAll() throws RazorpayException {
return fetchAll(null);
@@ -26,7 +27,9 @@ public List fetchAll() throws RazorpayException {
/**
* This method get list of Addons filtered by parameters @request
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @param request JSONObject request
+ * @return List of AddOns
*/
public List fetchAll(JSONObject request) throws RazorpayException {
return getCollection(Constants.ADDON_LIST, request);
diff --git a/src/main/java/com/razorpay/ApiClient.java b/src/main/java/com/razorpay/ApiClient.java
index 319ec3c0..502de72b 100755
--- a/src/main/java/com/razorpay/ApiClient.java
+++ b/src/main/java/com/razorpay/ApiClient.java
@@ -2,9 +2,7 @@
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
-import java.util.List;
import org.apache.commons.text.WordUtils;
import org.json.JSONArray;
@@ -13,23 +11,23 @@
import okhttp3.HttpUrl;
import okhttp3.Response;
+import static com.razorpay.Constants.INVALID_RESPONSE_FROM_SERVER;
+
class ApiClient {
String auth;
- private final String ENTITY = "entity";
-
- private final String COLLECTION = "collection";
+ private static final String ENTITY = "entity";
- private final String ERROR = "error";
+ private static final String ERROR = "error";
- private final String DESCRIPTION = "description";
+ private static final String DESCRIPTION = "description";
- private final String STATUS_CODE = "code";
+ private static final String STATUS_CODE = "code";
- private final int STATUS_OK = 200;
+ private static final int STATUS_OK = 200;
- private final int STATUS_MULTIPLE_CHOICE = 300;
+ private static final int STATUS_MULTIPLE_CHOICE = 300;
ApiClient(String auth) {
this.auth = auth;
@@ -69,7 +67,7 @@ public T delete(String path, JSONObject requestObject) throws RazorpayExcept
private T processDeleteResponse(Response response) throws RazorpayException {
if (response == null) {
- throw new RazorpayException("Invalid Response from server");
+ throw new RazorpayException(INVALID_RESPONSE_FROM_SERVER);
}
int statusCode = response.code();
@@ -99,21 +97,22 @@ else if(response.code()==204){
private T parseResponse(JSONObject jsonObject, String entity) throws RazorpayException {
if (entity != null) {
- Class cls = getClass(entity);
- try {
- return cls.getConstructor(JSONObject.class).newInstance(jsonObject);
- } catch (Exception e) {
- throw new RazorpayException("Unable to parse response because of " + e.getMessage());
+ Class cls = (Class) getClass(entity);
+ if (cls != null) {
+ try {
+ return cls.getConstructor(JSONObject.class).newInstance(jsonObject);
+ } catch (Exception e) {
+ throw new RazorpayException("Unable to parse response because of " + e.getMessage());
+ }
}
}
-
throw new RazorpayException("Unable to parse response");
}
private ArrayList parseCollectionResponse(JSONArray jsonArray, HttpUrl requestUrl)
throws RazorpayException {
- ArrayList modelList = new ArrayList();
+ ArrayList modelList = new ArrayList<>();
try {
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObj = jsonArray.getJSONObject(i);
@@ -138,7 +137,7 @@ private String getEntityNameFromURL(HttpUrl url) {
T processResponse(Response response) throws RazorpayException {
if (response == null) {
- throw new RazorpayException("Invalid Response from server");
+ throw new RazorpayException(INVALID_RESPONSE_FROM_SERVER);
}
int statusCode = response.code();
@@ -162,7 +161,7 @@ T processResponse(Response response) throws RazorpayException
ArrayList processCollectionResponse(Response response)
throws RazorpayException {
if (response == null) {
- throw new RazorpayException("Invalid Response from server");
+ throw new RazorpayException(INVALID_RESPONSE_FROM_SERVER);
}
int statusCode = response.code();
@@ -185,13 +184,13 @@ ArrayList processCollectionResponse(Response response)
}
throwException(statusCode, responseJson);
- return null;
+ return (ArrayList)Collections.emptyList();
}
private String getEntity(JSONObject jsonObj, HttpUrl url) {
if(!jsonObj.has(ENTITY)) {
return getEntityNameFromURL(url);
- }else if(jsonObj.get("entity").toString().equals("settlement.ondemand")){
+ }else if(jsonObj.get(ENTITY).toString().equals("settlement.ondemand")){
return "settlement";
}else{
return jsonObj.getString(ENTITY);
@@ -215,10 +214,10 @@ private void throwServerException(int statusCode, String responseBody) throws Ra
throw new RazorpayException(sb.toString());
}
- private Class getClass(String entity) {
+ private Class getClass(String entity) {
try {
- String entityClass = "com.razorpay." + WordUtils.capitalize(entity, '_').replaceAll("_", "");
- return Class.forName(entityClass);
+ String entityClass = "com.razorpay." + WordUtils.capitalize(entity, '_').replace("_", "");
+ return (Class) Class.forName(entityClass);
} catch (ClassNotFoundException e) {
return null;
}
diff --git a/src/main/java/com/razorpay/ApiUtils.java b/src/main/java/com/razorpay/ApiUtils.java
index 0dcc73da..31d4563a 100755
--- a/src/main/java/com/razorpay/ApiUtils.java
+++ b/src/main/java/com/razorpay/ApiUtils.java
@@ -27,7 +27,7 @@
class ApiUtils {
private static OkHttpClient client;
- private static Map headers = new HashMap();
+ private static Map headers = new HashMap<>();
private static String version = null;
@@ -173,7 +173,6 @@ private static X509TrustManager createDefaultTrustManager() throws NoSuchAlgorit
if (trustManagers.length != 1 || !(trustManagers[0] instanceof X509TrustManager)) {
throw new IllegalStateException("Unexpected default trust managers:" + Arrays.toString(trustManagers));
}
- X509TrustManager trustManager = (X509TrustManager) trustManagers[0];
- return trustManager;
+ return (X509TrustManager) trustManagers[0];
}
}
diff --git a/src/main/java/com/razorpay/Constants.java b/src/main/java/com/razorpay/Constants.java
index 748d58db..7067c7db 100755
--- a/src/main/java/com/razorpay/Constants.java
+++ b/src/main/java/com/razorpay/Constants.java
@@ -4,6 +4,10 @@
public class Constants {
+ private Constants(){
+
+ }
+
// API constants
static final String SCHEME = "https";
static final String HOSTNAME = "api.razorpay.com";
@@ -133,4 +137,10 @@ public class Constants {
static final String VIRTUAL_ACCOUNT_RECEIVERS = "virtual_accounts/%s/receivers";
static final String VIRTUAL_ACCOUNT_ALLOWEDPAYERS = "virtual_accounts/%s/allowed_payers";
static final String VIRTUAL_ACCOUNT_DELETE_ALLOWEDPAYERS = "virtual_accounts/%s/allowed_payers/%s";
+
+ static final String INVALID_RESPONSE_FROM_SERVER = "Invalid Response from server";
+
+ static final String RAZORPAY_SIGNATURE = "razorpay_signature";
+
+ static final String RAZORPAY_PAYMENT_ID = "razorpay_payment_id";
}
diff --git a/src/main/java/com/razorpay/CustomTLSSocketFactory.java b/src/main/java/com/razorpay/CustomTLSSocketFactory.java
index 756126ab..9e23e11b 100644
--- a/src/main/java/com/razorpay/CustomTLSSocketFactory.java
+++ b/src/main/java/com/razorpay/CustomTLSSocketFactory.java
@@ -3,7 +3,6 @@
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
-import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
@@ -43,13 +42,13 @@ public Socket createSocket(Socket s, String host, int port, boolean autoClose)
}
@Override
- public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
+ public Socket createSocket(String host, int port) throws IOException {
return enableTLSOnSocket(internalSSLSocketFactory.createSocket(host, port));
}
@Override
public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
- throws IOException, UnknownHostException {
+ throws IOException {
return enableTLSOnSocket(
internalSSLSocketFactory.createSocket(host, port, localHost, localPort));
}
@@ -67,7 +66,7 @@ public Socket createSocket(InetAddress address, int port, InetAddress localAddre
}
private Socket enableTLSOnSocket(Socket socket) {
- if (socket != null && (socket instanceof SSLSocket)) {
+ if ( socket instanceof SSLSocket) {
((SSLSocket) socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"});
}
return socket;
diff --git a/src/main/java/com/razorpay/CustomerClient.java b/src/main/java/com/razorpay/CustomerClient.java
index b9531cdb..dfbdd660 100644
--- a/src/main/java/com/razorpay/CustomerClient.java
+++ b/src/main/java/com/razorpay/CustomerClient.java
@@ -25,7 +25,8 @@ public Customer edit(String id, JSONObject request) throws RazorpayException {
/**
* It is wrapper of fetchAll with parameter here sending null defines fetchAll
* with a default values without filteration
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @return list of customers
*/
public List fetchAll() throws RazorpayException {
return fetchAll(null);
@@ -33,7 +34,9 @@ public List fetchAll() throws RazorpayException {
/**
* This method get list of customers filtered by parameters @request
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @param request JSONObject request
+ * @return list of customers
*/
public List fetchAll(JSONObject request) throws RazorpayException {
return getCollection(Constants.CUSTOMER_LIST, request);
diff --git a/src/main/java/com/razorpay/Entity.java b/src/main/java/com/razorpay/Entity.java
index ec46e474..a6353064 100644
--- a/src/main/java/com/razorpay/Entity.java
+++ b/src/main/java/com/razorpay/Entity.java
@@ -8,8 +8,8 @@ public abstract class Entity {
private JSONObject modelJson;
- private final String CREATED_AT = "created_at";
- private final String CAPTURED_AT = "captured_at";
+ private static final String CREATED_AT = "created_at";
+ private static final String CAPTURED_AT = "captured_at";
Entity(JSONObject jsonObject) {
this.modelJson = jsonObject;
diff --git a/src/main/java/com/razorpay/FundAccountClient.java b/src/main/java/com/razorpay/FundAccountClient.java
index 2e04fb53..33446ab1 100644
--- a/src/main/java/com/razorpay/FundAccountClient.java
+++ b/src/main/java/com/razorpay/FundAccountClient.java
@@ -24,7 +24,9 @@ public List fetchAll() throws RazorpayException {
/**
* This method get list of fundaccounts filtered by parameters @request
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @param request in JSONObject request
+ * @return List of fund accounts
*/
public List fetchAll(JSONObject request) throws RazorpayException {
return getCollection(Constants.FUND_ACCOUNT_LIST, request);
diff --git a/src/main/java/com/razorpay/PaymentLinkClient.java b/src/main/java/com/razorpay/PaymentLinkClient.java
index f09a7c01..e518bdbe 100644
--- a/src/main/java/com/razorpay/PaymentLinkClient.java
+++ b/src/main/java/com/razorpay/PaymentLinkClient.java
@@ -4,7 +4,6 @@
import org.json.JSONObject;
-import okhttp3.Response;
public class PaymentLinkClient extends ApiClient {
diff --git a/src/main/java/com/razorpay/QrCodeClient.java b/src/main/java/com/razorpay/QrCodeClient.java
index 4251944b..22be287b 100644
--- a/src/main/java/com/razorpay/QrCodeClient.java
+++ b/src/main/java/com/razorpay/QrCodeClient.java
@@ -4,7 +4,6 @@
import org.json.JSONObject;
-import okhttp3.Response;
public class QrCodeClient extends ApiClient {
@@ -23,7 +22,8 @@ public QrCode fetch(String id) throws RazorpayException {
/**
* It is wrapper of fetchAll with parameter here sending null defines fetchAll
* with a default values without filteration
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @return List of QR Codes
*/
public List fetchAll() throws RazorpayException {
return fetchAll(null);
@@ -31,7 +31,9 @@ public List fetchAll() throws RazorpayException {
/**
* This method get list of QrCodes filtered by parameters @request
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @param request JSONObject request
+ * @return list of QR Codes
*/
public List fetchAll(JSONObject request) throws RazorpayException {
return getCollection(Constants.QRCODE_LIST, request);
diff --git a/src/main/java/com/razorpay/RazorpayClient.java b/src/main/java/com/razorpay/RazorpayClient.java
index a42bbcdd..f754e63c 100755
--- a/src/main/java/com/razorpay/RazorpayClient.java
+++ b/src/main/java/com/razorpay/RazorpayClient.java
@@ -6,22 +6,44 @@
public class RazorpayClient {
- public PaymentClient payments;
- public RefundClient refunds;
- public OrderClient orders;
- public InvoiceClient invoices;
- public CardClient cards;
- public CustomerClient customers;
- public TransferClient transfers;
- public SubscriptionClient subscriptions;
- public AddonClient addons;
- public PlanClient plans;
- public SettlementClient settlement;
- public QrCodeClient qrCode;
- public PaymentLinkClient paymentLink;
- public ItemClient items;
- public FundAccountClient fundAccount;
- public VirtualAccountClient virtualAccounts;
+ @Override
+ public String toString() {
+ return "RazorpayClient{" +
+ "payments=" + payments +
+ ", refunds=" + refunds +
+ ", orders=" + orders +
+ ", invoices=" + invoices +
+ ", cards=" + cards +
+ ", customers=" + customers +
+ ", transfers=" + transfers +
+ ", subscriptions=" + subscriptions +
+ ", addons=" + addons +
+ ", plans=" + plans +
+ ", settlement=" + settlement +
+ ", qrCode=" + qrCode +
+ ", paymentLink=" + paymentLink +
+ ", items=" + items +
+ ", fundAccount=" + fundAccount +
+ ", virtualAccounts=" + virtualAccounts +
+ '}';
+ }
+
+ private PaymentClient payments;
+ private RefundClient refunds;
+ private OrderClient orders;
+ private InvoiceClient invoices;
+ private CardClient cards;
+ private CustomerClient customers;
+ private TransferClient transfers;
+ private SubscriptionClient subscriptions;
+ private AddonClient addons;
+ private PlanClient plans;
+ private SettlementClient settlement;
+ private QrCodeClient qrCode;
+ private PaymentLinkClient paymentLink;
+ private ItemClient items;
+ private FundAccountClient fundAccount;
+ private VirtualAccountClient virtualAccounts;
public RazorpayClient(String key, String secret) throws RazorpayException {
this(key, secret, false);
diff --git a/src/main/java/com/razorpay/SettlementClient.java b/src/main/java/com/razorpay/SettlementClient.java
index e8f9bf40..c91f084d 100644
--- a/src/main/java/com/razorpay/SettlementClient.java
+++ b/src/main/java/com/razorpay/SettlementClient.java
@@ -13,7 +13,8 @@ public class SettlementClient extends ApiClient {
/**
* It is wrapper of fetchAll with parameter here sending null defines fetchAll
* with a default values without filteration
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @return list of settlements
*/
public List fetchAll() throws RazorpayException {
return fetchAll(null);
@@ -21,7 +22,9 @@ public List fetchAll() throws RazorpayException {
/**
* This method get list of Settlements filtered by parameters @request
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @param request JSONObject request
+ * @return list of settlements
*/
public List fetchAll(JSONObject request) throws RazorpayException {
return getCollection(Constants.SETTLEMENTS, request);
@@ -46,7 +49,9 @@ public Settlement create(JSONObject request) throws RazorpayException {
/**
* It is wrapper of fetchAllDemand with parameter here sending null defines fetchAllDemand
* with a default values without filteration
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @return list of settlements
+
*/
public List fetchAllDemand() throws RazorpayException {
return fetchAllDemand(null);
@@ -54,7 +59,9 @@ public List fetchAllDemand() throws RazorpayException {
/**
* This method get list of demand Settlements filtered by parameters @request
- * @throws RazorpayException
+ * @throws RazorpayException RazorpayException
+ * @param request JSONObject request
+ * @return List of Settlements
*/
public List fetchAllDemand(JSONObject request) throws RazorpayException {
return getCollection(Constants.SETTLEMENTS_INSTANT, request);
diff --git a/src/main/java/com/razorpay/TokenClient.java b/src/main/java/com/razorpay/TokenClient.java
index a5a3d80e..36369182 100644
--- a/src/main/java/com/razorpay/TokenClient.java
+++ b/src/main/java/com/razorpay/TokenClient.java
@@ -1,2 +1,2 @@
-package com.razorpay;public class TokenClient {
+package com.razorpay;public interface TokenClient {
}
diff --git a/src/main/java/com/razorpay/Utils.java b/src/main/java/com/razorpay/Utils.java
index b6d28c68..f1fb296b 100644
--- a/src/main/java/com/razorpay/Utils.java
+++ b/src/main/java/com/razorpay/Utils.java
@@ -6,33 +6,42 @@
import org.apache.commons.codec.binary.Hex;
import org.json.JSONObject;
+import java.nio.charset.StandardCharsets;
+
+import static com.razorpay.Constants.RAZORPAY_PAYMENT_ID;
+import static com.razorpay.Constants.RAZORPAY_SIGNATURE;
+
public class Utils {
+ private Utils(){
+
+ }
+
public static boolean verifyPaymentSignature(JSONObject attributes, String apiSecret)
throws RazorpayException {
- String expectedSignature = attributes.getString("razorpay_signature");
+ String expectedSignature = attributes.getString(RAZORPAY_SIGNATURE);
String orderId = attributes.getString("razorpay_order_id");
- String paymentId = attributes.getString("razorpay_payment_id");
+ String paymentId = attributes.getString(RAZORPAY_PAYMENT_ID);
String payload = orderId + '|' + paymentId;
return verifySignature(payload, expectedSignature, apiSecret);
}
public static boolean verifySubscription(JSONObject attributes, String apiSecret)
throws RazorpayException {
- String expectedSignature = attributes.getString("razorpay_signature");
+ String expectedSignature = attributes.getString(RAZORPAY_SIGNATURE);
String subscriptionId = attributes.getString("razorpay_subscription_id");
- String paymentId = attributes.getString("razorpay_payment_id");
+ String paymentId = attributes.getString(RAZORPAY_PAYMENT_ID);
String payload = paymentId + '|' + subscriptionId;
return verifySignature(payload, expectedSignature, apiSecret);
}
public static boolean verifyPaymentLink(JSONObject attributes, String apiSecret)
throws RazorpayException {
- String expectedSignature = attributes.getString("razorpay_signature");
+ String expectedSignature = attributes.getString(RAZORPAY_SIGNATURE);
String paymentLinkStatus = attributes.getString("payment_link_status");
String paymentLinkId = attributes.getString("payment_link_id");
String paymentLinkRefId = attributes.getString("payment_link_reference_id");
- String paymentId = attributes.getString("razorpay_payment_id");
+ String paymentId = attributes.getString(RAZORPAY_PAYMENT_ID);
String payload = paymentLinkId + '|' + paymentLinkRefId + '|' + paymentLinkStatus + '|' + paymentId;
return verifySignature(payload, expectedSignature, apiSecret);
}
@@ -49,12 +58,12 @@ public static boolean verifySignature(String payload, String expectedSignature,
}
public static String getHash(String payload, String secret) throws RazorpayException {
- Mac sha256_HMAC;
+ Mac sha256HMAC;
try {
- sha256_HMAC = Mac.getInstance("HmacSHA256");
- SecretKeySpec secret_key = new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256");
- sha256_HMAC.init(secret_key);
- byte[] hash = sha256_HMAC.doFinal(payload.getBytes());
+ sha256HMAC = Mac.getInstance("HmacSHA256");
+ SecretKeySpec secretKey = new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256");
+ sha256HMAC.init(secretKey);
+ byte[] hash = sha256HMAC.doFinal(payload.getBytes());
return new String(Hex.encodeHex(hash));
} catch (Exception e) {
throw new RazorpayException(e.getMessage());
diff --git a/src/main/java/com/razorpay/VirtualAccountClient.java b/src/main/java/com/razorpay/VirtualAccountClient.java
index 9ff9a7a0..4989166e 100644
--- a/src/main/java/com/razorpay/VirtualAccountClient.java
+++ b/src/main/java/com/razorpay/VirtualAccountClient.java
@@ -50,7 +50,7 @@ public VirtualAccount addAllowedPayers(String id, JSONObject request) throws Raz
return post(String.format(Constants.VIRTUAL_ACCOUNT_ALLOWEDPAYERS, id), request);
}
- public VirtualAccount deleteAllowedPayer(String virtual_id, String payer_id) throws RazorpayException {
- return delete(String.format(Constants.VIRTUAL_ACCOUNT_DELETE_ALLOWEDPAYERS, virtual_id, payer_id), null);
+ public VirtualAccount deleteAllowedPayer(String virtualId, String payerId) throws RazorpayException {
+ return delete(String.format(Constants.VIRTUAL_ACCOUNT_DELETE_ALLOWEDPAYERS, virtualId, payerId), null);
}
}
diff --git a/src/test/java/com/razorpay/BaseTest.java b/src/test/java/com/razorpay/BaseTest.java
index 926364c8..9ff66e5d 100644
--- a/src/test/java/com/razorpay/BaseTest.java
+++ b/src/test/java/com/razorpay/BaseTest.java
@@ -15,7 +15,7 @@
import java.util.List;
import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -43,7 +43,7 @@ private void mockGetCall() throws IOException, IllegalAccessException {
Call call = mock(Call.class);
when(call.execute()).thenReturn(mockedResponse);
- when(okHttpClient.newCall(anyObject())).thenReturn(call);
+ when(okHttpClient.newCall(any())).thenReturn(call);
}