use of jp.ne.paypay.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PaymentApi method createPaymentWithHttpInfo.
/**
* Create a payment
* Create a direct debit payment and start the money transfer. **Timeout: 30s**
*
* @param body Payment (optional)
* @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> createPaymentWithHttpInfo(Object body, String agreeSimilarTransaction) throws ApiException {
Call call = createPaymentValidateBeforeCall(body, agreeSimilarTransaction);
Type localVarReturnType = new TypeToken<PaymentDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.CREATE_PAYMENT);
}
use of jp.ne.paypay.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PaymentApi method capturePaymentAuthWithHttpInfo.
/**
* Capture a payment authorization
* This api is used to capture the payment authorization for a payment **Timeout: 30s**
*
* @param body (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> capturePaymentAuthWithHttpInfo(Object body) throws ApiException {
Call call = capturePaymentAuthCall(body);
Type localVarReturnType = new TypeToken<PaymentDetails>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.CAPTURE_PAYMENT);
}
use of jp.ne.paypay.model.PaymentDetails 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.model.PaymentDetails 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.model.PaymentDetails in project paypayopa-sdk-java by paypay.
the class PendingPaymentApiExample 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("ASSUME_MERCHANT_ID");
String userAuthorizationId = "USER_AUTHORIZATION_ID";
PendingPaymentApi pendingPaymentApi = new PendingPaymentApi(apiClient);
PaymentApi paymentApi = new PaymentApi(apiClient);
PaymentDetails paymentDetails = pendingPayment(pendingPaymentApi, userAuthorizationId, 2);
if (paymentDetails != null && paymentDetails.getData() != null) {
String merchantPaymentId = paymentDetails.getData().getMerchantPaymentId();
getPendingPaymentDetails(pendingPaymentApi, merchantPaymentId);
// Cancel Pending Order
cancelPendingPayment(pendingPaymentApi, merchantPaymentId);
// Refund payment. Run this after payment is complete
refundPendingPayment(paymentApi, pendingPaymentApi, paymentDetails.getData().getPaymentId());
}
}
Aggregations