public class MidtransSnapApiImpl extends java.lang.Object implements MidtransSnapApi
MidtransSnapApi
Constructor and Description |
---|
MidtransSnapApiImpl(Config config)
SnapAPI constructor
|
Modifier and Type | Method and Description |
---|---|
Config |
apiConfig()
Do re-set config Class like clientKey, serverKey, isProduction
|
org.json.JSONObject |
createTransaction(java.util.Map<java.lang.String,java.lang.Object> params)
Do `/transactions` API request to SNAP API return RAW JSON with JSONObject
|
java.lang.String |
createTransactionRedirectUrl(java.util.Map<java.lang.String,java.lang.Object> params)
Do `/transactions` API request to SNAP API return String redirectURL
|
java.lang.String |
createTransactionToken(java.util.Map<java.lang.String,java.lang.Object> params)
Do `/transactions` API request to SNAP API return String token
|
public MidtransSnapApiImpl(Config config)
config
- Midtrans configuration
public Config apiConfig()
MidtransSnapApi
apiConfig
in interface MidtransSnapApi
public org.json.JSONObject createTransaction(java.util.Map<java.lang.String,java.lang.Object> params) throws MidtransError
MidtransSnapApi
createTransaction
in interface MidtransSnapApi
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more detail refer to: https://snap-docs.midtrans.com)MidtransError
- when an exception was occurred during executing the request.public java.lang.String createTransactionToken(java.util.Map<java.lang.String,java.lang.Object> params) throws MidtransError
MidtransSnapApi
createTransactionToken
in interface MidtransSnapApi
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more detail refer to: https://snap-docs.midtrans.com)MidtransError
- when an exception was occurred during executing the request.public java.lang.String createTransactionRedirectUrl(java.util.Map<java.lang.String,java.lang.Object> params) throws MidtransError
MidtransSnapApi
createTransactionRedirectUrl
in interface MidtransSnapApi
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more detail refer to: https://snap-docs.midtrans.com)MidtransError
- when an exception was occurred during executing the request.