I am new to Android.
I want to know how can I integrate the ATOM payment gateway mobile checkout page in my application?
I want it so that the user should fill his credit card details and pay on-line.
If I use other payment gateways, like Paytm or Payu they provide an SDK, but Atom doesn't
Any help would be appreciated
According to this,no java and/or android SDK is provided by them. You can still click the "contact us" button(in the bottom of the webpage) and ask them directly weather they provide any SDK for java/android or not.
Update: Android SDK is now provided by ATOM Payment gateway.Click this to get the same.
Update: Android SDK is now provided by ATOM Payment gateway.Click this to get the SDK for various platform.
As we know ATOM Dosen't Provide SDK After many resarch i had found solution
Call this asynctask on Payment button click
private class StartPayment extends AsyncTask { String Atom2Request; @Override protected String doInBackground(String... params) { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); String CurrDateTime = sdf.format(new Date()).toString(); vVenderURL = "https://paynetzuat.atomtech.in/paynetz/epi/fts?login=160&pass=Test@123&ttype=NBFundTransfer&prodid=NSE&amt=50&txncurr=INR&txnscamt=0&clientcode=TkFWSU4%3d&txnid=123&date=03/07/2015&custacc=1234567890&udf1=Customer&udf2=rajtufan@gmail.com&udf3=8485835654&udf4=pune&ru=http://example.webservice/response.aspx?"; Log.d("Vvendor URL", vVenderURL); XMLParser parser = new XMLParser(); String xml = parser.getXmlFromUrl(vVenderURL); // getting XML Document doc = parser.getXMLElement(xml); // getting DOM element Log.d("XML URL", xml); NodeList nList = doc.getElementsByTagName(KEY_RESPONSE); for (int tempN = 0; tempN paramName : : " + vParamName); if (vParamName.equals("ttype")) { xmlttype = aList.item(atrCnt).getChildNodes().item(0).getNodeValue(); } else if (vParamName.equals("tempTxnId")) { xmltempTxnId = aList.item(atrCnt).getChildNodes().item(0).getNodeValue(); } else if (vParamName.equals("token")) { xmltoken = aList.item(atrCnt).getChildNodes().item(0).getNodeValue(); } else if (vParamName.equals("txnStage")) { xmltxnStage = aList.item(atrCnt).getChildNodes().item(0).getNodeValue(); } } Log.d("XML URL", xmlURL); Log.d("XML TRANS TYPE", xmlttype); Log.d("tempTxnId : ", xmltempTxnId); Log.d("param : token :", xmltoken); Log.d("param : txnStage : ", xmltxnStage); } }//for Atom2Request = xmlURL + "?ttype=" + xmlttype + "&tempTxnId=" + xmltempTxnId + "&token=" + xmltoken + "&txnStage=" + xmltxnStage; Atom2Request = Atom2Request.replace(" ", "%20"); Log.d("ATOM 2nd Request URl", Atom2Request); return Atom2Request; } @Override protected void onPostExecute(String result) { if (pDialog != null) { pDialog.dismiss(); Intent intent = new Intent(Recharge_Activity.this, WebContent.class); intent.putExtra(KEY_ATOM2REQUEST, result); startActivityForResult(intent, 3); } } @Override protected void onPreExecute() { pDialog.setMessage("Processing Request..."); pDialog.setIndeterminate(false); pDialog.setCancelable(false); pDialog.show(); super.onPreExecute(); } }
when we got response from web page we have form a url and transfer to
WebContent.class
import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.os.Bundle; import android.util.Log; import android.webkit.JavascriptInterface; import android.webkit.WebView; import android.webkit.WebViewClient; public class WebContent extends Activity { private static final String TAG = "WebContent"; SharedPreferences sp; static Context mContext; public static final String KEY_ATOM2REQUEST = "Atom2Request"; String Atom2Request; Intent intent; boolean loadingFinished = true; boolean redirect = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webviewrecharge); // Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this)); mContext = this; Bundle extras = getIntent().getExtras(); if (extras != null) Atom2Request = extras.getString(KEY_ATOM2REQUEST); Log.d("ATOM2Request webview", Atom2Request); WebView webView = (WebView) findViewById(R.id.webView); webView.setWebViewClient(new MyWebViewClient()); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setDomStorageEnabled(true); webView.addJavascriptInterface(new WebAppInterface(this), "Android"); webView.loadUrl(Atom2Request); } private class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String urlNewString) { if (!loadingFinished) { redirect = true; } loadingFinished = false; view.loadUrl(urlNewString); return true; } @Override public void onPageStarted(WebView view, String url, Bitmap facIcon) { loadingFinished = false; //SHOW LOADING IF IT ISNT ALREADY VISIBLE Log.w(TAG, "Loading"); } @Override public void onPageFinished(WebView view, String url) { if (!redirect) { loadingFinished = true; } if (loadingFinished && !redirect) { //HIDE LOADING IT HAS FINISHED Log.w(TAG, "Finish Loading"); } else { redirect = false; } } } public class WebAppInterface { Context mContext; WebAppInterface(Context c) { mContext = c; } @JavascriptInterface public void onResponse(String reponseText) { Intent returnIntent = new Intent(); returnIntent.putExtra("Result", reponseText); setResult(RESULT_OK, returnIntent); finish(); } }
}
//in vVendorURl you need a redirect url to fetch request from ATOM and send response to android Mobile
Just put this code inside redirect url
//reponseText is text recevied frm ATOM that is Okay or No
in vVendorUrl you have to pass a return url..make a page in server ..and put this java script code inside url.
Now atom provide the SDK for various platform. You can download this from it's website atomtech
How does a Merchant Integrate with atom Online Payment Gateway?
- A merchant first needs to Sign Up with atom Online Payment Gateway-atom Paynetz.
- Once a customer wants to make a payment to the merchant, the merchant sends an EPI request to atom Paynetz.
- The EPI request facilitates a transfer of funds between the customer and merchant via Paynetz.
- The Paynetz platform validates the merchant and responds with an XML payload if successful.
- Based on the parameters in the XML, the merchant site has to send a new EPI request to Paynetz by parsing the XML response.
- The list of banks approved for the merchant will be displayed for selection on the Paynetz system, which is redirected to the customer.
- The customer then chooses the bank through which he/she wishes to do the payment.
- The EPI redirects the customer to the corresponding bank’s net banking interface. The customer can now complete the transaction.
PHP code for ATOM integration :
1.Create a form
MERCHANT->RESPONSE->url; // eof code to generate token // code to generate form action $param = “”; $param .= “&ttype=NBFundTransfer”; $param .= “&tempTxnId=”.$xmlObj->MERCHANT->RESPONSE->param[1]; $param .= “&token=”.$xmlObj->MERCHANT->RESPONSE->param[2]; $param .= “&txnStage=1〃; $url = $url.”?”.$param; // eof code to generate form action ?>