use of jp.ne.paypay.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PaymentApiExample method appInvokeFlow.
private static void appInvokeFlow(final PaymentApi paymentApi, final WalletApi walletApiInstance, final String userAuthorizationId) {
int amount = 1;
QRCodeDetails qrCodeDetails = createQRCode(paymentApi, amount);
String merchantPaymentId = qrCodeDetails != null ? qrCodeDetails.getData().getMerchantPaymentId() : null;
WalletBalance walletBalance = getWalletBalance(walletApiInstance, userAuthorizationId);
if (merchantPaymentId != null && walletBalance != null && walletBalance.getData().isHasEnoughBalance()) {
System.out.println("The QR Code can be used as a deeplink to invoke PayPay app and receive Payments. The user " + "can makes the payment using PayPay App");
System.out.println("For this example, we will create payment using the API...");
Payment payment = getPaymentObject(merchantPaymentId, userAuthorizationId, amount);
PaymentDetails paymentDetails = createPayment(paymentApi, payment, false);
if (paymentDetails != null) {
System.out.println("Payment created successfully, Now calling the API to get payment details for payment " + "ID:" + merchantPaymentId);
String refundId = UUID.randomUUID().toString();
paymentDetails = getPaymentDetails(paymentApi, merchantPaymentId);
if (paymentDetails != null) {
System.out.println("Creating Refund for the payment:" + paymentDetails.getData().getPaymentId());
createRefund(paymentApi, paymentDetails.getData().getPaymentId(), refundId);
System.out.println("Get refund details:" + refundId);
getRefundDetails(paymentApi, refundId);
System.out.println("Finally cancel the payment");
cancelPayment(paymentApi, merchantPaymentId);
}
}
}
if (qrCodeDetails != null) {
System.out.println("Delete the QR Code: " + qrCodeDetails.getData().getCodeId());
deleteQrCode(paymentApi, qrCodeDetails.getData().getCodeId());
}
}
use of jp.ne.paypay.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PaymentApi method createPaymentAuthorizationWithHttpInfo.
/**
* Create a payment authorization
* Create a payment authorization to block the money. **Timeout: 30s**
*
* @param body Payment
* @param agreeSimilarTransaction (Optional) If the parameter is set to \"true\", the payment duplication check will be bypassed. (optional)
* @return ApiResponse<PaymentDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<PaymentDetails> createPaymentAuthorizationWithHttpInfo(Object body, String agreeSimilarTransaction) throws ApiException {
Call call = ApiUtil.postCallObject(apiClient, "/v2/payments/preauthorize", body, agreeSimilarTransaction);
Type localVarReturnType = new TypeToken<PaymentDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.PREAUTHORIZE_PAYMENT);
}
use of jp.ne.paypay.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PaymentApi method getPaymentDetailsWithHttpInfo.
/**
* Get payment details
* Get payment details. **Timeout: 15s**
*
* @param merchantPaymentId (required)
* @return ApiResponse<PaymentDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<PaymentDetails> getPaymentDetailsWithHttpInfo(String merchantPaymentId) throws ApiException {
Call call = getPaymentDetailsValidateBeforeCall(merchantPaymentId);
Type localVarReturnType = new TypeToken<PaymentDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.GET_PAYMENT);
}
use of jp.ne.paypay.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PaymentApi method createContinuousPaymentWithHttpInfo.
/**
* Create a continuous payment
* Create a continuous payment and start the money transfer. **Timeout: 30s**
*
* @param body Payment
* @return ApiResponse<PaymentDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<PaymentDetails> createContinuousPaymentWithHttpInfo(Object body) throws ApiException {
Call call = createContinuousPaymentCall(body);
Type localVarReturnType = new TypeToken<PaymentDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.CREATE_CONTINUOUS_PAYMENT);
}
use of jp.ne.paypay.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PendingPaymentApi method getPendingPaymentDetailsWithHttpInfo.
/**
* Get payment details for pending payments
* Get payment details for pending payments. **Timeout: 15s**
*
* @param merchantPaymentId (required)
* @return ApiResponse<PaymentDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<PaymentDetails> getPendingPaymentDetailsWithHttpInfo(String merchantPaymentId) throws ApiException {
Call call = getPaymentDetailsValidateBeforeCall(merchantPaymentId);
Type localVarReturnType = new TypeToken<PaymentDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.GET_REQUEST_ORDER);
}
Aggregations