Thursday, May 2, 2013

[android help] Set notify url to paypal payment in my android apps


Normally on websites, we can set a notify URL to check payment with paypal server. However how do we set it in an app? I am super new to paypal app payment.


I am using MEP.PayPal



@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(resultCode) {
case Activity.RESULT_OK:
String payKey = data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY);
data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY);
Toast.makeText(this,"Paymnet Successful : " + payKey,Toast.LENGTH_LONG).show();
//finish();
break;
case Activity.RESULT_CANCELED:
Toast.makeText(this,"Paymnet Cancel",Toast.LENGTH_LONG).show();
//finish();
break;
case PayPalActivity.RESULT_FAILURE:
Toast.makeText(this,"Paymnet Failed",Toast.LENGTH_LONG).show();
String errorID =
data.getStringExtra(PayPalActivity.EXTRA_ERROR_ID);
String errorMessage =
data.getStringExtra(PayPalActivity.EXTRA_ERROR_MESSAGE);
//Toast.makeText(getApplicationContext(),errorMessage, Toast.LENGTH_LONG).show();
//finish();
break;
}
}


So how Activity.RESULT_OK, I would like to send a post to my notify URL so that the codes in the URL can validate payments.


Also, I get that the paykey can return the transaction details. If so, then I will use it to do the verification instead of using notify url. But after doing much reading, I still could not find the answer to return the transaction details, like maybe data.getStringExtra('transaction_id'), data.getStringExtra('merchant_name'), etc.



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...