public interface MidtransCoreApi
Modifier and Type | Method and Description |
---|---|
Config |
apiConfig()
Do re-set config Class like clientKey, serverKey, isProduction
|
org.json.JSONObject |
approveTransaction(java.lang.String orderId)
Do `/{orderId}/approve` API request to Core API
|
org.json.JSONObject |
cancelTransaction(java.lang.String orderId)
Do `/{orderId}/cancel` API request to Core API
|
org.json.JSONObject |
captureTransaction(java.util.Map<java.lang.String,java.lang.String> params)
Do `/capture API` request to Core API
|
org.json.JSONObject |
cardPointInquiry(java.lang.String tokenId)
Do `/point_inquiry/{tokenId}` API request to Core API
|
org.json.JSONObject |
cardToken(java.util.Map<java.lang.String,java.lang.String> params)
Do `/token` API request to Core API
|
org.json.JSONObject |
chargeTransaction(java.util.Map<java.lang.String,java.lang.Object> params)
Do /charge API request to Core API
|
org.json.JSONObject |
checkTransaction(java.lang.String orderId)
Do /{orderId}/status API request to Core API
|
org.json.JSONObject |
createSubscription(java.util.Map<java.lang.String,java.lang.Object> subscriptionReq)
Do `v1/subscriptions` API request to Core API for Create subscription.
|
org.json.JSONObject |
denyTransaction(java.lang.String orderId)
Do `/{orderId}/deny` API request to Core API
|
org.json.JSONObject |
directRefundTransaction(java.lang.String orderId,
java.util.Map<java.lang.String,java.lang.String> params)
Do `/{orderId}/status/b2b` API request to Core API
|
org.json.JSONObject |
disableSubscription(java.lang.String subscriptionId)
Do `v1/subscriptions/{subscription_id}/disable` Make the subscription inactive (the subscription will not create transaction anymore)s.
|
org.json.JSONObject |
enableSubscription(java.lang.String subscriptionId)
Do `v1/subscriptions/{subscription_id}/enable` Make the subscription active (the subscription will create periodic transaction) (more detail refer to: http://api-docs.midtrans.com/#enable-subscription)
|
org.json.JSONObject |
expireTransaction(java.lang.String orderId)
Do `/{orderId}/expire` API request to Core API
|
org.json.JSONObject |
getBIN(java.lang.String binNumber)
Do `v1/bins/{bin}` API request to Core API
|
org.json.JSONObject |
getPaymentAccount(java.lang.String accountId)
Do `v2/pay/account/{account_id}` find account by id to see the customer account details (more detail refer to: http://api-docs.midtrans.com/#get-pay-account)
|
org.json.JSONObject |
getSubscription(java.lang.String subscriptionId)
Do `v1/subscriptions/{subscription_id}` Find subscription by id to see the subscription details.
|
org.json.JSONObject |
getTransactionStatusB2B(java.lang.String orderId)
Do `/point_inquiry/{tokenId}` API request to Core API
|
org.json.JSONObject |
linkPaymentAccount(java.util.Map<java.lang.String,java.lang.Object> accountRequest)
Do `/v2/pay/account` to link customer account to be used for specific payment channels (more detail refer to: http://api-docs.midtrans.com/#create-pay-account)
|
org.json.JSONObject |
refundTransaction(java.lang.String orderId,
java.util.Map<java.lang.String,java.lang.String> params)
Do `/{orderId}/refund` API request to Core API
|
org.json.JSONObject |
registerCard(java.util.Map<java.lang.String,java.lang.String> params)
Do `/card/register` API request to Core API
|
org.json.JSONObject |
unlinkPaymentAccount(java.lang.String accountId)
Do `v2/pay/account/{account_id}/unbind` to unbind a linked customer account (more detail refer to: http://api-docs.midtrans.com/#unbind-pay-account)
|
org.json.JSONObject |
updateSubscription(java.lang.String subscriptionId,
java.util.Map<java.lang.String,java.lang.Object> subscriptionReq)
Do `v1/subscriptions/{subscription_id}` Update existing subscription details.
|
Config apiConfig()
org.json.JSONObject chargeTransaction(java.util.Map<java.lang.String,java.lang.Object> params) throws MidtransError
params
- Map Object parameter, object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject checkTransaction(java.lang.String orderId) throws MidtransError
orderId
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#get-transaction-status)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject approveTransaction(java.lang.String orderId) throws MidtransError
orderId
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#approve-transaction)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject cancelTransaction(java.lang.String orderId) throws MidtransError
orderId
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#cancel-transaction)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject expireTransaction(java.lang.String orderId) throws MidtransError
orderId
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#expire-transaction)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject refundTransaction(java.lang.String orderId, java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
orderId
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#refund-transaction)params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSONMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject cardToken(java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com/#get-token)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject registerCard(java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com/#register-card)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject cardPointInquiry(java.lang.String tokenId) throws MidtransError
tokenId
- {String} of credit card (more detail refer to: https://api-docs.midtrans.com/#point-inquiry)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject captureTransaction(java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com/#capture-transaction)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject getTransactionStatusB2B(java.lang.String orderId) throws MidtransError
orderId
- {String} of credit card (more detail refer to: https://api-docs.midtrans.com/#get-transaction-status-b2b)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject directRefundTransaction(java.lang.String orderId, java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
orderId
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#direct-refund-transaction)params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSONMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject denyTransaction(java.lang.String orderId) throws MidtransError
orderId
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#deny-transaction)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject getBIN(java.lang.String binNumber) throws MidtransError
binNumber
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#bin-api)MidtransError
- when an exception was occurred during executing the request.org.json.JSONObject createSubscription(java.util.Map<java.lang.String,java.lang.Object> subscriptionReq) throws MidtransError
subscriptionReq
- {Map Object} object of Subscription request bodyMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject getSubscription(java.lang.String subscriptionId) throws MidtransError
subscriptionId
- {String} Subscription ID given by MidtransMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject disableSubscription(java.lang.String subscriptionId) throws MidtransError
subscriptionId
- {String} Subscription ID given by MidtransMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject enableSubscription(java.lang.String subscriptionId) throws MidtransError
subscriptionId
- {String} Subscription ID given by MidtransMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject updateSubscription(java.lang.String subscriptionId, java.util.Map<java.lang.String,java.lang.Object> subscriptionReq) throws MidtransError
subscriptionId
- {String} Subscription ID given by MidtranssubscriptionReq
- {Map Object} object of Subscription request bodyMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject linkPaymentAccount(java.util.Map<java.lang.String,java.lang.Object> accountRequest) throws MidtransError
accountRequest
- {Map Object} object of create payment account request bodyMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject getPaymentAccount(java.lang.String accountId) throws MidtransError
accountId
- {String} Customer account id to be used for paymentMidtransError
- when an exception was occurred during executing the request.org.json.JSONObject unlinkPaymentAccount(java.lang.String accountId) throws MidtransError
accountId
- {String} Customer account id to be used for paymentMidtransError
- when an exception was occurred during executing the request.