use of jp.ne.paypay.model.CashbackDetails in project paypayopa-sdk-java by paypay.
the class CashbackApiTest method createCashbackRequestTest.
/**
* Create cashback request
*
* Transfer money from merchants campaign wallet to user wallet.
*
* @throws ApiException if the Api call fails
*/
@Test
public void createCashbackRequestTest() throws ApiException {
CashbackDetails cashbackDetails = new CashbackDetails();
cashbackDetails.resultInfo(resultInfo);
cashback.setStatus("REQUEST_ACCEPTED").setCashbackId("cashbackId");
cashbackDetails.data(cashback);
Assert.assertNotNull(cashback.toString());
ApiResponse<CashbackDetails> cashbackDetailsApiResponse = new ApiResponse<>(8100001, null, cashbackDetails);
Mockito.when(api.createCashbackRequestWithHttpInfo(cashback)).thenReturn(cashbackDetailsApiResponse);
CashbackDetails response = api.createCashbackRequest(cashback);
Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
}
use of jp.ne.paypay.model.CashbackDetails in project paypayopa-sdk-java by paypay.
the class CashbackApiExample method createCashbackRequest.
private static CashbackDetails createCashbackRequest(final CashbackApi apiInstance, Cashback cashback) {
CashbackDetails result = null;
try {
result = apiInstance.createCashbackRequest(cashback);
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