Payment ideal
Step 1:instamojo ma login karvu and PAN card ni bdhi detail puchse ae nakhi deve
Step 2:devsupport software download karvu
Step 3:Payment Name ni new activity open karvi android studio ma
-xml ma button j levu
-java ma setonclicklistner lai levu and findViewBy id lai levu
Step 4:devsuppuort open karvu and email id nakhvu
-Drop your source folder pr click karvu
-and je project nu name hoy aeni pr click karvu
Step 5:lntegrate pr click karvu
Step 6:instamojo lakhvu and search pr click karvu
Step 7:,php intergration pr click karvu and and client id and clidnt secret ae instamojo mathi copy-paste kri devu
-client id and client-secret instamojo ma javu and aema Api and plugins aeni pr click karvu and click
kreya pche client id and client secret copy paste kre devu
Step 8:access-token php download karvi
Step 9:000webhost pr click karvu and file manager ma jvu and upload files now pr click karvu
[aama email id registration karvu + symbol che tyathi and upload files nu symbol hse tyathu token file upload karvu and
and file upload EX acces-token aa file upload kre che to aeni pr right click karvu view ma jvu and url copy kr devu and
paste kre devu
Step 10:Go to android intergration pr click karvu and feedback ma comment lkhine submit kre devu and mainactivity.java ma jate j
code aave jse
[janava mate token file upload kreae tyare access-token.php vadi file upload karvi]
*code jova mate
Activity.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="demoproject.aalap.com.payment.MainActivity">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btn"
android:text="BUTTON"/>
</LinearLayout>
activity.java
package demoproject.aalap.com.payment;
import android.support.v7.app.AppCompatActivity;
import android.app.Activity;
import instamojo.library.InstapayListener;
import instamojo.library.InstamojoPay;
import instamojo.library.Config;
import org.json.JSONObject;
import org.json.JSONException;
import android.content.IntentFilter;
import android.widget.Toast;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button btn;
private void callInstamojoPay(String email, String phone, String amount, String purpose, String buyername) {
final Activity activity = this;
InstamojoPay instamojoPay = new InstamojoPay();
IntentFilter filter = new IntentFilter("ai.devsupport.instamojo");
registerReceiver(instamojoPay, filter);
JSONObject pay = new JSONObject();
try {
pay.put("email", email);
pay.put("phone", phone);
pay.put("purpose", purpose);
pay.put("amount", amount);
pay.put("name", buyername);
pay.put("send_sms", true);
pay.put("send_email", true);
} catch (JSONException e) {
e.printStackTrace();
}
initListener();
instamojoPay.start(activity, pay, listener);
}
InstapayListener listener;
private void initListener() {
listener = new InstapayListener() {
@Override
public void onSuccess(String response) {
Toast.makeText(getApplicationContext(), response, Toast.LENGTH_LONG)
.show();
}
@Override
public void onFailure(int code, String reason) {
Toast.makeText(getApplicationContext(), "Failed: " + reason, Toast.LENGTH_LONG)
.show();
}
};
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Call the function callInstamojo to start payment here
btn=findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
callInstamojoPay("aalapmistry11@gmail.com", "7600237805", "20", "official", "buyername");
}
});
}
}
Step 2:devsupport software download karvu
Step 3:Payment Name ni new activity open karvi android studio ma
-xml ma button j levu
-java ma setonclicklistner lai levu and findViewBy id lai levu
Step 4:devsuppuort open karvu and email id nakhvu
-Drop your source folder pr click karvu
-and je project nu name hoy aeni pr click karvu
Step 5:lntegrate pr click karvu
Step 6:instamojo lakhvu and search pr click karvu
Step 7:,php intergration pr click karvu and and client id and clidnt secret ae instamojo mathi copy-paste kri devu
-client id and client-secret instamojo ma javu and aema Api and plugins aeni pr click karvu and click
kreya pche client id and client secret copy paste kre devu
Step 8:access-token php download karvi
Step 9:000webhost pr click karvu and file manager ma jvu and upload files now pr click karvu
[aama email id registration karvu + symbol che tyathi and upload files nu symbol hse tyathu token file upload karvu and
and file upload EX acces-token aa file upload kre che to aeni pr right click karvu view ma jvu and url copy kr devu and
paste kre devu
Step 10:Go to android intergration pr click karvu and feedback ma comment lkhine submit kre devu and mainactivity.java ma jate j
code aave jse
[janava mate token file upload kreae tyare access-token.php vadi file upload karvi]
*code jova mate
Activity.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="demoproject.aalap.com.payment.MainActivity">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btn"
android:text="BUTTON"/>
</LinearLayout>
activity.java
package demoproject.aalap.com.payment;
import android.support.v7.app.AppCompatActivity;
import android.app.Activity;
import instamojo.library.InstapayListener;
import instamojo.library.InstamojoPay;
import instamojo.library.Config;
import org.json.JSONObject;
import org.json.JSONException;
import android.content.IntentFilter;
import android.widget.Toast;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button btn;
private void callInstamojoPay(String email, String phone, String amount, String purpose, String buyername) {
final Activity activity = this;
InstamojoPay instamojoPay = new InstamojoPay();
IntentFilter filter = new IntentFilter("ai.devsupport.instamojo");
registerReceiver(instamojoPay, filter);
JSONObject pay = new JSONObject();
try {
pay.put("email", email);
pay.put("phone", phone);
pay.put("purpose", purpose);
pay.put("amount", amount);
pay.put("name", buyername);
pay.put("send_sms", true);
pay.put("send_email", true);
} catch (JSONException e) {
e.printStackTrace();
}
initListener();
instamojoPay.start(activity, pay, listener);
}
InstapayListener listener;
private void initListener() {
listener = new InstapayListener() {
@Override
public void onSuccess(String response) {
Toast.makeText(getApplicationContext(), response, Toast.LENGTH_LONG)
.show();
}
@Override
public void onFailure(int code, String reason) {
Toast.makeText(getApplicationContext(), "Failed: " + reason, Toast.LENGTH_LONG)
.show();
}
};
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Call the function callInstamojo to start payment here
btn=findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
callInstamojoPay("aalapmistry11@gmail.com", "7600237805", "20", "official", "buyername");
}
});
}
}
Comments
Post a Comment