use of jp.ne.paypay.ApiException in project paypayopa-sdk-java by paypay.
the class CashbackApiExample method getCashbackDetails.
private static CashbackDetails getCashbackDetails(final CashbackApi apiInstance, String merchantCashbackId) {
CashbackDetails result = null;
try {
result = apiInstance.getCashbackDetails(merchantCashbackId);
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;
}
use of jp.ne.paypay.ApiException in project paypayopa-sdk-java by paypay.
the class PaymentApiExample method capturePayment.
private static void capturePayment(final PaymentApi apiInstance, String merchantPaymentId, int amount) {
try {
CaptureObject captureObject = new CaptureObject();
captureObject.setMerchantCaptureId(UUID.randomUUID().toString());
captureObject.setMerchantPaymentId(merchantPaymentId);
captureObject.setAmount(new MoneyAmount().amount(amount).currency(MoneyAmount.CurrencyEnum.JPY));
captureObject.setOrderDescription("new Order");
PaymentDetails paymentDetails = apiInstance.capturePaymentAuth(captureObject);
System.out.println(paymentDetails);
} catch (ApiException e) {
e.printStackTrace();
System.out.println(e.getResponseBody());
}
}
use of jp.ne.paypay.ApiException in project paypayopa-sdk-java by paypay.
the class PaymentApiExample method createContinuousPayment.
private static PaymentDetails createContinuousPayment(final PaymentApi apiInstance, Payment payment) {
PaymentDetails result = null;
try {
result = apiInstance.createContinuousPayment(payment);
System.out.println("\nAPI RESPONSE\n------------------\n");
System.out.println(result.getResultInfo().getCode());
} catch (ApiException e) {
System.err.println(e.getResponseBody());
}
return result;
}
use of jp.ne.paypay.ApiException in project paypayopa-sdk-java by paypay.
the class PaymentApiExample method createRefund.
private static void createRefund(final PaymentApi apiInstance, String paymentId, String refundId) {
try {
Refund refund = getRefundObject(paymentId, refundId);
RefundDetails result = apiInstance.refundPayment(refund);
System.out.println("\nAPI RESPONSE\n------------------\n");
System.out.println(result);
} catch (ApiException e) {
System.err.println(e.getResponseBody());
}
}
use of jp.ne.paypay.ApiException in project paypayopa-sdk-java by paypay.
the class PaymentApiExample method getRefundDetails.
protected static void getRefundDetails(final PaymentApi apiInstance, final String merchantRefundId) {
try {
RefundDetails result = apiInstance.getRefundDetails(merchantRefundId);
System.out.println("\nAPI RESPONSE\n------------------\n");
System.out.println(result);
} catch (ApiException e) {
System.err.println(e.getResponseBody());
}
}
Aggregations