use of jp.ne.paypay.model.ReverseCashbackDetails in project paypayopa-sdk-java by paypay.
the class CashbackApiTest method getReversedCashbackDetailsTest.
/**
* Check Reversed Cashback Details
*
* Check the reversed cashback details of the cashback given
*
* @throws ApiException if the Api call fails
*/
@Test
public void getReversedCashbackDetailsTest() throws ApiException {
String merchantCashbackId = "merchantCashbackId";
String merchantCashbackReversalId = "merchantCashbackReversalId";
ReverseCashbackDetails reverseCashbackDetails = new ReverseCashbackDetails();
reverseCashbackDetails.setResultInfo(resultInfo);
reverseCashback.setStatus("SUCCESS");
reverseCashbackDetails.data(reverseCashback);
ApiResponse<ReverseCashbackDetails> reverseCashbackDetailsApiResponse = new ApiResponse<>(00001, null, reverseCashbackDetails);
Mockito.when(apiClient.escapeString(merchantCashbackId)).thenReturn(merchantCashbackId);
Mockito.when(apiClient.escapeString(merchantCashbackReversalId)).thenReturn(merchantCashbackReversalId);
Mockito.when(api.getReversedCashbackDetailsWithHttpInfo(merchantCashbackReversalId, merchantCashbackId)).thenReturn(reverseCashbackDetailsApiResponse);
ReverseCashbackDetails response = api.getReversedCashbackDetails(merchantCashbackReversalId, merchantCashbackId);
Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
}
use of jp.ne.paypay.model.ReverseCashbackDetails in project paypayopa-sdk-java by paypay.
the class CashbackApi method createReverseCashbackRequestWithHttpInfo.
/**
* Reverse a given cashback
* Transfer money back from user wallet to merchants campaign wallet. **Timeout: 30s**
*
* @param reverseCashback ReverseCashback
* @return ApiResponse<ReverseCashbackDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<ReverseCashbackDetails> createReverseCashbackRequestWithHttpInfo(ReverseCashback reverseCashback) throws ApiException {
Call call = ApiUtil.postCallObject(apiClient, "/v2/cashback_reversal", reverseCashback, null);
Type localVarReturnType = new TypeToken<ReverseCashbackDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.CREATE_REVERSE_CASHBACK_REQUEST);
}
use of jp.ne.paypay.model.ReverseCashbackDetails in project paypayopa-sdk-java by paypay.
the class CashbackApi method getReversedCashbackDetailsWithHttpInfo.
/**
* Check Cashback Reversal Details
* Check the cashback reversal details of the cashback reversed **Timeout: 15s**
*
* @param merchantCashbackReversalId (required)
* @param merchantCashbackId (required)
* @return ApiResponse<ReverseCashbackDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<ReverseCashbackDetails> getReversedCashbackDetailsWithHttpInfo(String merchantCashbackReversalId, String merchantCashbackId) throws ApiException {
if (StringUtils.isEmpty(merchantCashbackReversalId)) {
throw new IllegalArgumentException("Missing the required parameter merchantCashbackReversalId");
}
Call call = ApiUtil.getCallObject(apiClient, "/v2/cashback_reversal/" + apiClient.escapeString(merchantCashbackReversalId) + "/{merchantCashbackId}", new Pair(ApiConstants.MERCHANT_CASHBACK_ID, merchantCashbackId), "GET");
Type localVarReturnType = new TypeToken<ReverseCashbackDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.GET_REVERSED_CASHBACK_DETAILS);
}
use of jp.ne.paypay.model.ReverseCashbackDetails in project paypayopa-sdk-java by paypay.
the class CashbackApiTest method reverseCashbackTest.
/**
* Create reverse cashback request
*
* Transfer money back from user wallet to merchants campaign wallet
*
* @throws ApiException if the Api call fails
*/
@Test
public void reverseCashbackTest() throws ApiException {
ReverseCashbackDetails reverseCashbackDetails = new ReverseCashbackDetails();
reverseCashbackDetails.resultInfo(resultInfo);
reverseCashback.setStatus("REQUEST_ACCEPTED");
reverseCashbackDetails.data(reverseCashback);
Assert.assertNotNull(reverseCashback.toString());
ApiResponse<ReverseCashbackDetails> cashbackDetailsApiResponse = new ApiResponse<>(8100001, null, reverseCashbackDetails);
Mockito.when(api.createReverseCashbackRequestWithHttpInfo(reverseCashback)).thenReturn(cashbackDetailsApiResponse);
ReverseCashbackDetails response = api.createReverseCashbackRequest(reverseCashback);
Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
}
use of jp.ne.paypay.model.ReverseCashbackDetails in project paypayopa-sdk-java by paypay.
the class CashbackApiExample method createReverseCashbackRequest.
private static ReverseCashbackDetails createReverseCashbackRequest(final CashbackApi apiInstance, ReverseCashback reverseCashback) {
ReverseCashbackDetails result = null;
try {
result = apiInstance.createReverseCashbackRequest(reverseCashback);
System.out.println("\nAPI RESPONSE\n------------------\n");
System.out.println(result.getResultInfo().getCode());
System.out.println(result);
} catch (ApiException e) {
System.err.println(e.getResponseBody());
}
return result;
}
Aggregations