Я пытаюсь интегрировать paypal с Android-приложением, используя песочницу. Я получаю успешную работу с paypal, но когда я делаю платеж, экран будет невидимым напрямую без Response.
Как я могу получить ответ на указанный вопрос?
Это мой код.
private void invokeSimplePayment()
{
try
{
PayPalPayment payment = new PayPalPayment();
payment.setSubtotal(new BigDecimal(Amt));
payment.setCurrencyType(Currency_code[code]);
payment.setRecipient("Rec_Email");
payment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);
Intent checkoutIntent = PayPal.getInstance().checkout(payment, this);
startActivityForResult(checkoutIntent, request);
}
catch (Exception e)
{
e.printStackTrace();
}
}
public void onActivityResults(int requestCode, int resultCode, Intent data)
{
switch(resultCode)
{
case Activity.RESULT_OK:
resultTitle = "SUCCESS";
resultInfo = "You have successfully completed this " ;
//resultExtra = "Transaction ID: " + data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY);
break;
case Activity.RESULT_CANCELED:
resultTitle = "CANCELED";
resultInfo = "The transaction has been cancelled.";
resultExtra = "";
break;
case PayPalActivity.RESULT_FAILURE:
resultTitle = "FAILURE";
resultInfo = data.getStringExtra(PayPalActivity.EXTRA_ERROR_MESSAGE);
resultExtra = "Error ID: " + data.getStringExtra(PayPalActivity.EXTRA_ERROR_ID);
}
System.out.println("Result=============="+resultTitle);
System.out.println("ResultInfo=============="+resultInfo);
}