问题
I have to integrate Citrus Payment gateway into my android app, Any help will be appreciated. website here Thank you in advance.
回答1:
Citrus has provided with some really simplified developer's guide for efficient technical integration. Lets walk through the sample Net banking integration.Remaining steps can be found over The Citrus Developer's Guide.
- Make sure that you have the following parameters from Citrus.(How to get following parameters)
- Secret Key
- Access Key
- SignIn Key
- SignIn Secret
- SignUp Key
- SignUp Secret
Download the kit from - Example and Citruslibrary. Add Citruslibrary as a dependency to Example. From Github.
git clone https://github.com/citruspay/open-android-v2.git
Have a look at the init function. You can set the keys with citrus config.
private void init() { Config citrus = new Config(); citrus.setEnv("sandbox"); //replace it with production when you are ready citrus.setupSignupId("merchant-signup"); citrus.setupSignupSecret("3e2288d3a1a3f59ef6f93373884d2ca1"); citrus.setSigninId("merchant-wallet"); citrus.setSigninSecret("c40798d3c12114b5bb19f2051d9ed181"); }Get the bill from your server.Collect user details.Call the charge API.
private void cardpay(String bill_string) { Bill bill = new Bill(bill_string); Card card = new Card("4111111111111111", "11", "21", "000", "Tony Stark", "debit"); UserDetails userDetails = new UserDetails(customer); PG paymentgateway = new PG(card, bill, userDetails); paymentgateway.charge(new Callback() { @Override public void onTaskexecuted(String success, String error) { processresponse(success, error); } } }); }Calling charge with Netbanking
private void bankpay(String bill_string) { Bill bill = new Bill(bill_string); Bank netbank = new Bank("CID002"); UserDetails userDetails = new UserDetails(customer); PG paymentgateway = new PG(netbank, bill, userDetails); paymentgateway.charge(new Callback() { @Override public void onTaskexecuted(String success, String error) { processresponse(success, error); } }); }
来源:https://stackoverflow.com/questions/21111545/citrus-payment-gateway-android-integration