-
Notifications
You must be signed in to change notification settings - Fork 1
Home
See the Objective-C Example app and Swift Example app for a working implementation of all API methods.
Note: make sure to open the project using CitrusPay.xcworkspace
and not CitrusPay.xcodeproj
for Cocoa-Pod Example. To run the example project, run pod install
from the Example directory first.
- Complete the installation steps (above).
Swift
- Include CitrusPay
import CitrusPay
Objective-C
- Include CitrusPay.h
#import <CitrusPay/CitrusPay.h>
####Setup working Enviroments
SDK operates in two different modes Sandbox and Production mode. for both the enviroments Citrus PG Prerequisites key sets are different. keys from one enviroment won't work on other. so please make sure you are using correct set of keys. During the developement you would always want to use the Sandbox mode. once you are done with your App development you can switch to production mode .
Swift
#if PRODUCTION_MODE
CitrusPaymentSDK.initWithSign(inID: SignInId, signInSecret: SignInSecretKey, signUpID: SubscriptionId, signUpSecret: SubscriptionSecretKey, vanityUrl: VanityUrl, environment: CTSEnvProduction)
#else
CitrusPaymentSDK.initWithSign(inID: SignInId, signInSecret: SignInSecretKey, signUpID: SubscriptionId, signUpSecret: SubscriptionSecretKey, vanityUrl: VanityUrl, environment: CTSEnvSandbox)
#endif
Objective-C
#if PRODUCTION_MODE
[CitrusPaymentSDK initWithSignInID: SignInId signInSecret: SignInSecretKey signUpID: SubscriptionId signUpSecret: SubscriptionSecretKey vanityUrl: VanityUrl environment: CTSEnvProduction];
#else
[CitrusPaymentSDK initWithSignInID: SignInId signInSecret: SignInSecretKey signUpID: SubscriptionId signUpSecret: SubscriptionSecretKey vanityUrl: VanityUrl environment: CTSEnvSandbox];
#endif
Only after you are done with initialization you can proceed with following guide
The SDK is logically divided into 3 modules/layers or interfacing classes
- CTSAuthLayer - handles all of the user creation related tasks .
- CTSProfileLayer - handles all of the user profile related tasks .
- CTSPaymentLayer - handles all of the payment related tasks .
To use any of the above layers your need to fetch their singlton instance from CitrusPaymentSDK's class methods,
Swift
// initialization in your .m file
var authLayer : CTSAuthLayer?
var profileLayer : CTSProfileLayer?
var paymentLayer : CTSPaymentLayer?
authLayer = CTSAuthLayer.fetchShared()
profileLayer = CTSProfileLayer.fetchShared()
paymentLayer = CTSPaymentLayer.fetchShared()
Objective-C
// initialization in your .m file
CTSAuthLayer * authLayer = [CTSAuthLayer fetchSharedAuthLayer];
CTSProfileLayer * proifleLayer = [CTSProfileLayer fetchSharedProfileLayer];
CTSPaymentLayer * paymentLayer = [CTSPaymentLayer fetchSharedPaymentLayer];
Swift
CitrusPaymentSDK.setLogLevel(.verbose)
Objective-C
[CitrusPaymentSDK setLogLevel:CTSLogLevelVerbose];
Following are the specific tasks related to each of the layer
#####Doing direct payments
#####User Management
#####Card Management
#####Using Citrus Cash a.k.a Prepaid Account
- Get User's Citrus Cash Balance
- Loading Money into Users Citrus Cash Account
- Paying via Citrus Cash account
- Save Cashout Bank Account
- Get Saved Cashout Bank Acoount
- Initiate Cashout Proccess into users Bank Account from Citrus Cash account
- Send Citrus Cash to another Citrus User
#####Dynamic Pricing Offer Coupons and Surcharge
#####One Tap Payment
#####Others
===== ####Common Integration Issues