use of jp.ne.paypay.api.PaymentApi in project paypayopa-sdk-java by paypay.
the class PaymentApiExample 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";
PaymentApi paymentApi = new PaymentApi(apiClient);
WalletApi walletApiInstance = new WalletApi(apiClient);
createAccountLinkQrCode(paymentApi);
preAuthCaptureFlow(walletApiInstance, paymentApi, userAuthorizationId);
preAuthRevertAuthFlow(walletApiInstance, paymentApi, userAuthorizationId);
directDebitFlow(walletApiInstance, paymentApi, userAuthorizationId, false);
// Continuous payment flow
directDebitFlow(walletApiInstance, paymentApi, userAuthorizationId, true);
appInvokeFlow(paymentApi, walletApiInstance, userAuthorizationId);
}
use of jp.ne.paypay.api.PaymentApi 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