开发者

Paypal functionality before download

开发者 https://www.devze.com 2023-04-12 12:17 出处:网络
I am working in android. I am designing a program to download a file from my http server. before download the file payment should开发者_StackOverflow社区 be done.

I am working in android. I am designing a program to download a file from my http server. before download the file payment should开发者_StackOverflow社区 be done.

this is my first layout:-

Paypal functionality before download

when i click on on paypal button this paypal site is opened:-

Paypal functionality before download

so i want to know that after make payment is this site return something on the basis of that i can allow or donot allow user to download.

i want to know that user has paid something or not ? please help me in this paypal concept in android.

Thank you in advance...


I have done this by taking help from a from a book.

This is the code which is used to the solution for my question:-

@Override

public void onActivityResult(int requestCode, int resultCode, Intent data) {

switch(resultCode) {

case Activity.RESULT_OK:

//The payment succeeded



Toast.makeText(this,"Payment has done successfully",Toast.LENGTH_SHORT).show();

//Tell the user their payment succeeded

break;

case Activity.RESULT_CANCELED:


    Toast.makeText(this,"Payment has cancled",Toast.LENGTH_SHORT).show();
break;

case PayPalActivity.RESULT_FAILURE:

    flag=false;
    Toast.makeText(this,"Sorry Payment failed",Toast.LENGTH_SHORT).show();
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消