use of jp.ne.paypay.ApiClient in project paypayopa-sdk-java by paypay.
the class PaymentApiTest method setUp.
@BeforeEach
public void setUp() {
apiClient = Mockito.mock(ApiClient.class);
api.setApiClient(apiClient);
resultInfo = new ResultInfo();
resultInfo.setMessage("SUCCESS");
payment = new Payment();
payment.setAmount(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));
payment.merchantPaymentId("merchantPaymentId").userAuthorizationId("userAuthorizationId").requestedAt(Instant.now().getEpochSecond()).storeId(RandomStringUtils.randomAlphabetic(8)).terminalId(RandomStringUtils.randomAlphanumeric(8)).orderReceiptNumber(RandomStringUtils.randomAlphanumeric(8)).orderDescription("Payment for Order ID:" + UUID.randomUUID().toString());
MerchantOrderItem merchantOrderItem = new MerchantOrderItem().category("Dessert").name("Red Velvet Cake").productId(RandomStringUtils.randomAlphanumeric(8)).quantity(1).unitPrice(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));
List<MerchantOrderItem> merchantOrderItems = new ArrayList<>();
merchantOrderItems.add(merchantOrderItem);
payment.orderItems(merchantOrderItems);
}
use of jp.ne.paypay.ApiClient in project paypayopa-sdk-java by paypay.
the class PendingPaymentApiTest method setUp.
@BeforeEach
public void setUp() {
apiClient = Mockito.mock(ApiClient.class);
api.setApiClient(apiClient);
paymentApi.setApiClient(apiClient);
resultInfo = new ResultInfo();
resultInfo.setMessage("SUCCESS");
payment = new Payment();
payment.setAmount(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));
payment.merchantPaymentId("merchantPaymentId").userAuthorizationId("userAuthorizationId").requestedAt(Instant.now().getEpochSecond()).storeId(RandomStringUtils.randomAlphabetic(8)).terminalId(RandomStringUtils.randomAlphanumeric(8)).orderReceiptNumber(RandomStringUtils.randomAlphanumeric(8)).orderDescription("Payment for Order ID:" + UUID.randomUUID().toString());
MerchantOrderItem merchantOrderItem = new MerchantOrderItem().category("Dessert").name("Red Velvet Cake").productId(RandomStringUtils.randomAlphanumeric(8)).quantity(1).unitPrice(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));
List<MerchantOrderItem> merchantOrderItems = new ArrayList<>();
merchantOrderItems.add(merchantOrderItem);
payment.orderItems(merchantOrderItems);
}
use of jp.ne.paypay.ApiClient in project paypayopa-sdk-java by paypay.
the class UserApiTest method setUp.
@BeforeEach
public void setUp() {
apiClient = Mockito.mock(ApiClient.class);
api.setApiClient(apiClient);
resultInfo = new ResultInfo();
resultInfo.setMessage("SUCCESS");
}
use of jp.ne.paypay.ApiClient in project paypayopa-sdk-java by paypay.
the class WalletApiTest method setUp.
@BeforeEach
public void setUp() {
ApiClient apiClient = Mockito.mock(ApiClient.class);
api.setApiClient(apiClient);
resultInfo = new ResultInfo();
resultInfo.setMessage("SUCCESS");
}
use of jp.ne.paypay.ApiClient in project paypayopa-sdk-java by paypay.
the class CashbackApiExample method main.
public static void main(String[] args) throws ApiException {
ApiClient apiClient = new Configuration().getDefaultApiClient();
apiClient.setProductionMode(false);
apiClient.setApiKey("API_KEY");
apiClient.setApiSecretKey("API_SECRET_KEY");
apiClient.setAssumeMerchant("YOUR_MERCHANT_ID");
String userAuthorizationId = "USER_AUTHORIZATION_ID";
CashbackApi cashbackApi = new CashbackApi(apiClient);
CashbackDetails cashbackDetails = giveCashback(cashbackApi, userAuthorizationId, 1);
if (cashbackDetails != null && cashbackDetails.getData() != null) {
reverseCashback(cashbackApi, cashbackDetails.getData().getMerchantCashbackId(), 1);
}
}
Aggregations