To run the example project, clone the repo, and run pod install
from the Example directory first.
RevenueMonster is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'RevenueMonster', '1.3'
Mohamed Yussuf, [email protected]
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");
}
}
- 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
- Go to your
Info.plist
- Add
weixin
,weixinULAPI
,alipay
,boostapp
toLSApplicationQueriesSchemes
- 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.
- Go to your
Info.plist
- Add
weixin
,weixinULAPI
,alipay
,boostapp
toLSApplicationQueriesSchemes
- Go to
Targets > Info > URL type > URL Scheme
. - Add a new
URL Scheme
:- For identifier set
weixin
- For URL Schemes set your App ID.
- For identifier set
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).")
}