com.midtrans.service.impl.MidtransSnapApiImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-library Show documentation
Show all versions of java-library Show documentation
This is the Official Java API client/library for Midtrans Payment API. Visit https://midtrans.com. More information about the product and see documentation at http://docs.midtrans.com for more technical details. This library used java version 1.8
package com.midtrans.service.impl;
import com.midtrans.Config;
import com.midtrans.httpclient.SnapApi;
import com.midtrans.httpclient.error.MidtransError;
import com.midtrans.service.MidtransSnapApi;
import org.json.JSONObject;
import java.util.Map;
/**
* Implements from {@link MidtransSnapApi MidtransSnapApi}
*/
public class MidtransSnapApiImpl implements MidtransSnapApi {
private Config config;
/**
* SnapAPI constructor
*
* @param config Midtrans {@link Config configuration}
*/
public MidtransSnapApiImpl(Config config) {
this.config = config;
}
@Override
public Config apiConfig() {
return config;
}
@Override
public JSONObject createTransaction(Map params) throws MidtransError {
return SnapApi.createTransaction(params, config);
}
@Override
public String createTransactionToken(Map params) throws MidtransError {
return SnapApi.createTransactionToken(params, config);
}
@Override
public String createTransactionRedirectUrl(Map params) throws MidtransError {
return SnapApi.createTransactionRedirectUrl(params, config);
}
}