@Test public void testGetUpdateSessionUrlWorksAsIntended() throws Exception { gateway.merchantId = "somemerchant"; gateway.region = Gateway.Region.NORTH_AMERICA; String expectedUrl = "https: String actualUrl = gateway.getUpdateSessionUrl("sess1234", String.valueOf(Gateway.MIN_API_VERSION)); assertEquals(expectedUrl, actualUrl); }
String getUpdateSessionUrl(String sessionId, String apiVersion) { if (sessionId == null) { throw new IllegalArgumentException("Session Id may not be null"); } if (merchantId == null) { throw new IllegalStateException("You must initialize the the Gateway instance with a Merchant Id before use"); } return getApiUrl(apiVersion) + "/merchant/" + merchantId + "/session/" + sessionId; }
Gateway { String getUpdateSessionUrl(String sessionId, String apiVersion) { if (sessionId == null) { throw new IllegalArgumentException("Session Id may not be null"); } if (merchantId == null) { throw new IllegalStateException("You must initialize the the Gateway instance with a Merchant Id before use"); } return getApiUrl(apiVersion) + "/merchant/" + merchantId + "/session/" + sessionId; } }
Gateway { String getUpdateSessionUrl(String sessionId, String apiVersion) { if (sessionId == null) { throw new IllegalArgumentException("Session Id may not be null"); } if (merchantId == null) { throw new IllegalStateException("You must initialize the the Gateway instance with a Merchant Id before use"); } return getApiUrl(apiVersion) + "/merchant/" + merchantId + "/session/" + sessionId; } Gateway(); }
Gateway { String getUpdateSessionUrl(String sessionId, String apiVersion) { if (sessionId == null) { throw new IllegalArgumentException("Session Id may not be null"); } if (merchantId == null) { throw new IllegalStateException("You must initialize the the Gateway instance with a Merchant Id before use"); } return getApiUrl(apiVersion) + "/merchant/" + merchantId + "/session/" + sessionId; } Gateway(); String getMerchantId(); Gateway setMerchantId(String merchantId); Region getRegion(); Gateway setRegion(Region region); void updateSession(String sessionId, String apiVersion, GatewayMap payload, GatewayCallback callback); Single<GatewayMap> updateSession(String sessionId, String apiVersion, GatewayMap payload); static void start3DSecureActivity(Activity activity, String html); static void start3DSecureActivity(Activity activity, String html, String title); static boolean handle3DSecureResult(int requestCode, int resultCode, Intent data, Gateway3DSecureCallback callback); static void requestGooglePayData(PaymentsClient paymentsClient, PaymentDataRequest request, Activity activity); static boolean handleGooglePayResult(int requestCode, int resultCode, Intent data, GatewayGooglePayCallback callback); }
Gateway { String getUpdateSessionUrl(String sessionId, String apiVersion) { if (sessionId == null) { throw new IllegalArgumentException("Session Id may not be null"); } if (merchantId == null) { throw new IllegalStateException("You must initialize the the Gateway instance with a Merchant Id before use"); } return getApiUrl(apiVersion) + "/merchant/" + merchantId + "/session/" + sessionId; } Gateway(); String getMerchantId(); Gateway setMerchantId(String merchantId); Region getRegion(); Gateway setRegion(Region region); void updateSession(String sessionId, String apiVersion, GatewayMap payload, GatewayCallback callback); Single<GatewayMap> updateSession(String sessionId, String apiVersion, GatewayMap payload); static void start3DSecureActivity(Activity activity, String html); static void start3DSecureActivity(Activity activity, String html, String title); static boolean handle3DSecureResult(int requestCode, int resultCode, Intent data, Gateway3DSecureCallback callback); static void requestGooglePayData(PaymentsClient paymentsClient, PaymentDataRequest request, Activity activity); static boolean handleGooglePayResult(int requestCode, int resultCode, Intent data, GatewayGooglePayCallback callback);  }