Giter Site home page Giter Site logo

glsee / revenue-monster-java-android-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from revenuemonster/rm-java-android-sdk

0.0 0.0 0.0 2.58 MB

Android SDK for Revenue Monster Payment

Home Page: https://revenuemonster.my

License: BSD 3-Clause "New" or "Revised" License

Java 100.00%

revenue-monster-java-android-sdk's Introduction

RM SDK for Android

Add it to your build.gradle with:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and:

dependencies {
    compile 'com.github.RevenueMonster:RM-Android:{latest version}'
}


Checkout Sample Code

try {
	new Checkout(MainActivity.this).getInstance().
		setEnv(<<Environment Parameter>>). // set environment
		setWeChatAppID("<< WeChat Open Platform AppID >>"). // only use for wechatpay
		setCardInfo("<<Card Holder Name>>","<<Card No>>","<<Cvc No>>","<<Exp Month>>","<<Exp Year>>","<<Country Code>>","<<Card Save>>"). // only use for new card 
		setToken("<<Card Token>>","<<Cvc No>>"). // only use if use existing card token
		setBankCode("<<Set Bank Code>>"). // only use for fpx, get the bank code from open api
		pay(<<Method Parameter>>,"<<Get Checkout Id from API>>", new Result());
} catch(Exception e) {
	e.printStackTrace();
}

// Callback Result
static public class Result implements PaymentResult {
	public void onPaymentSuccess(Transaction transaction) {
		Log.d("SUCCESS", transaction.getStatus());
	}
	public void onPaymentFailed(Error error) {
		Log.d("FAILED", error.getCode());
	}
	public void onPaymentCancelled() {
		Log.d("CANCELLED", "User cancelled payment");
	}
}

Environment Parameter

  • SANDBOX
  • PRODUCTION


Method Parameter

  • WECHATPAY_MY
  • TNG_MY
  • BOOST_MY
  • ALIPAY_CN
  • GRABPAY_MY
  • MCASH_MY
  • RAZERPAY_MY
  • PRESTO_MY
  • GOBIZ_MY
  • FPX_MY

WeChatPay In-App Payment

1. Create a developer account on the WeChat Open Platform:

  • Go to https://open.weixin.qq.com/ and click Log In.
  • Navigate to Admin Center > Mobile Application > Create Mobile Application, and input name, short introduction, official website, and package name.

2. Pass the app id when trigger payment:

	try {
		new Checkout(MainActivity.this).getInstance().
			setEnv(<<Environment Parameter>>). // set environment
			setWeChatAppID("<< WeChat Open Platform AppID >>"). // only use for wechatpay
			pay(<<Method Parameter>>,"<<Get Checkout Id from API>>", new Result());
	} catch(Exception e) {
		e.printStackTrace();
	}

revenue-monster-java-android-sdk's People

Contributors

myussufz avatar snorsnor9998 avatar oskang09 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.