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 configurationpublic Config apiConfig()
MidtransSnapApiapiConfig in interface MidtransSnapApipublic org.json.JSONObject createTransaction(java.util.Map<java.lang.String,java.lang.Object> params)
throws MidtransError
MidtransSnapApicreateTransaction in interface MidtransSnapApiparams - {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
MidtransSnapApicreateTransactionToken in interface MidtransSnapApiparams - {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
MidtransSnapApicreateTransactionRedirectUrl in interface MidtransSnapApiparams - {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.