Giter VIP home page Giter VIP logo

rm-ios-sdk's Introduction

RM SDK for iOS

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

RevenueMonster is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'RevenueMonster', '1.3'

Author

Mohamed Yussuf, [email protected]

License

Checkout Sample Code

do {
	try Checkout(viewController: self)
		.setEnv(<<Environment Parameter>>) // set environment
		.setWeChatAppID(wechatAppID: "<<WeChat Open Platform AppID>>", universalLink: "<<Universal Link>>")
		.setCardInfo(name: "", cardNo: "", cvcNo: "", expMonth: 1, expYear: 2020, countryCode: "MY", isSave: true) // only use for new card 
		.setToken(token: "<<Card Token>>",cvcNo: "<<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: <<Method Parameter>>, checkoutId: "<<Get Checkout Id from API>>", result: Result())
} catch {
		print("error: \(error.localizedDescription).")
}

// Callback Result
class Result: PaymentResult {
	func onPaymentSuccess(transaction: Transaction) {
		print("SUCCESS", transaction.getStatus())
	}

	func onPaymentFailed(error: PaymentError) {
		print("FAILED", error.getCode())
	}

	func onPaymentCancelled() {
		print("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 - PAYDEE_MY - ZAPP_MY - SHOPEEPAY_MY - ALIPAYPLUS_MY - SENHENGPAY_MY

Register weixin, weixinULAPI, alipay, boostapp in the "URL type" of the "info" tab:

  1. Go to your Info.plist
  2. Add weixin, weixinULAPI, alipay, boostapp to LSApplicationQueriesSchemes


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, bundle id and universal link.

2. Register weixin, weixinULAPI in the "URL type" of the "info" tab:

  1. Go to your Info.plist
  2. Add weixin, weixinULAPI, alipay, boostapp to LSApplicationQueriesSchemes

3. Add your WeChat App ID to URL scheme:

  1. Go to Targets > Info > URL type > URL Scheme.
  2. Add a new URL Scheme :
    • For identifier set weixin
    • For URL Schemes set your App ID.

4. Pass the app id and universal link when trigger payment:

	do {
		try Checkout(viewController: self)
			.setEnv(<<Environment Parameter>>) // set environment
			.setWeChatAppID(wechatAppID: "<<WeChat Open Platform AppID>>", universalLink: "<<Universal Link>>")
			.pay(method: <<Method Parameter>>, checkoutId: "<<Get Checkout Id from API>>", result: Result())
	} catch {
			print("error: \(error.localizedDescription).")
	}

rm-ios-sdk's People

Contributors

myussufz avatar oskang09 avatar

Watchers

 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.