Xendit iOS SDK is compatible with CocoaPods and Swift Package Manager, and provides target for consumption: Xendit
.
Team: Credit Cards Team
Slack Channel: #p-cards-product
Slack Mentions: @troops-cards
Note that starting version 3.10.0, it requires minimum version of iOS 11. If you still want to support iOS 9, you may use version 3.9.2 instead.
Add this to your Podfile.
pod 'Xendit', '~> 3.10.2'
Important: Import SDK in Objective-C project with CocoaPods integration, you can do as following
#import "Xendit-Swift.h"
-
Select your project in the Project Navigator on the right. Select the project in the Project section and click the Package Dependencies tab at the top.
-
Click the + button at the bottom of the table to add Xendit iOS SDK using the Swift Package Manager.
-
Enter the package URL in the search field in the top right, that simply means the GitHub URL.
-
Choose Dependency Rule as
Up to Next Major Version
from3.7.0
.
Important: Import SDK in Objective-C project with SPM integration, you can do as following
@import Xendit;
This function accepts parameters below:
Parameter | Type | Description |
---|---|---|
Card | Card Object | Card data that will be used to create a token |
amount | String | Amount that will be used to create a token bundled with 3DS authentication |
shouldAuthenticate | Boolean | A flag indicating if 3DS authentication is required for this token. Will be set to true if you omit the parameter |
isMultipleUse | Boolean | A flag to identify whether a token will be reusable or just for one-time use. Will be set to false if you omit the parameter |
billingDetails | billingDetails Object | Card holder's billing details |
customer | customer object | Xendit customer object |
currency | String | Currency of the transaction that will be submitted for 3DS authentication |
midLabel | String | For switcher merchant only Specific string value which labels any of your Merchant IDs (MID) set up with Xendit. This can be configured in the list of MIDs on your Dashboard settings. (If this is not included in a request, and you have more than 1 MID in your list, the transaction will proceed using your prioritized MID (first MID on your list)). |
Open Xendit.xcworkspace
To run unit tests: choose Xendit
scheme and press cmd+u
(or "Run Product" -> "Test")
To run UI tests: choose XenditExample
scheme and press cmd+u
- Open xcode, click on the
Open a project or file
- Browse to the repository folder, and open
Xendit.xcworkspace
- Click the project scheme button (its beside stop button)
- A dropdown list will appear, click
Edit scheme...
- On the
Run
section, at theInfo
tab, click theExecutable
dropdown
- Select
XenditExample.app
andClose
the window
- Click the
Run
button
- Wait for the app build and the simulator will showed up