PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 11, 2022

[FIXED] How to set RazorPay key dynamically?

 November 11, 2022     android, gradle, payment-gateway, razorpay     No comments   

Issue

I want to set the Razorpay key dynamically.

Can anyone help me with this ?

I have tried with

implementation 'com.razorpay:checkout:1.5.13'

Checkout checkout = new Checkout();
checkout.setKeyID(MY_KEY_HERE);

Still it gives me error to set RazorPay API key in manifest.

Later i tried with custom by setting .aar in libs folder also and tried with

implementation project(name: "razorpay-android-3.8.8", ext: 'aar')

Then it gave me error while building gradle as:

ERROR: Required keys [path] are missing from map {name=razorpay-android-3.8.8, ext=aar}.


Solution

Issue resolved with this.

Steps followed:

Checkout.preload(PaymentActivity.this);
Checkout checkout = new Checkout();
checkout.setKeyID(MY_KEY_HERE);


final Activity activity = this;

checkout.open(activity, options);



Answered By - Sachin Harne
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing