0

I m trying to build an ecommerce app using paypal-android-sdk. I have tried the sdk version: 2.14.2, 2.15.3, 2.16.0 for Android studio version 3.5.3
The result is the same and it show the above message: onActivityResult overrides nothing.
I did add ? after Intent. what is the problem? Can someone help me on this? appreciate your help.
below is the code:

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_pay_pal_payment)

        config = PayPalConfiguration().environment(PayPalConfiguration.ENVIRONMENT_SANDBOX)
            .clientId(ShoppingCart.client_id)

        var i = Intent(this, PayPalService::class.java)
        i.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config)
        startService(i)


        val total_amt:String = intent.getStringExtra("TTL")
        Payment_tv_TotalAmount.setText(total_amt)

        Payment_btnPay.setOnClickListener {

            amount = Payment_tv_TotalAmount.text.toString().toDouble()

            var payment = PayPalPayment(BigDecimal.valueOf(amount),"USD","My Pal", PayPalPayment.PAYMENT_INTENT_SALE) 

            var intent = Intent(this, PaymentActivity::class.java ) 

            intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION,config)
            intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment)

            startActivityForResult(intent,my_request_code)

        }
    }



 override fun OnActivityResult(requestCode:Int, resultCode:Int, data:Intent?) {
         super.onActivityResult(requestCode, resultCode, data)

        if(requestCode == my_request_code){

              if(resultCode == Activity.RESULT_OK) {
                var i = Intent(this, PaymentConfirmActivity::class.java)

                startActivity(i)
            }
        }
    }

MilkBottle
  • 4,242
  • 13
  • 64
  • 146

1 Answers1

0

Your method name should be onActivityResult not OnActivityResult

the first letter is a lower case character.

oziomajnr
  • 1,671
  • 1
  • 15
  • 39
  • Can I ask you a question. Is Paypal-android-Sdk deprecated? can it still be used to get payment? Thanks – MilkBottle Oct 02 '20 at 13:33
  • yes, the error is gone now. But I dont know it will work? – MilkBottle Oct 02 '20 at 13:35
  • the documentation does say its deprecated so I don't think you should go ahead and use it, please see https://github.com/paypal/PayPal-Android-SDK – oziomajnr Oct 02 '20 at 13:39
  • BUT in other github the doc says you still can use it but it will not be updated, so you should migrate to BrainTree. This is like yes, you can use the old one, but try to use the new braintree api. is this correct? well ,it will be kind if you can advise. Anyway Ijust want to be sure. Thanks – MilkBottle Oct 02 '20 at 13:41
  • they want to give time for people to migrate so its not good for new projects to use it. Check out their alternatives – oziomajnr Oct 02 '20 at 13:45
  • Do you mind to help me another problem. The Activity can be rendered or displayed but I see an Exclaimation mark on the editor. I just dont figure out. here the link: https://stackoverflow.com/questions/64060759/render-problem-path-op-not-supported-in-latest-material-design-version – MilkBottle Oct 02 '20 at 13:53