IOS

1. Development Environment: Minimum iOS target 8.0

Notes: supported armv7, armv7s, arm64 architechture and structures (+i368, x86_64 for simulator).

2. Compatible library

VTCPosSDK supports versions from iOS 8.0 and above. It also supports all structures, including armv7, armv7s, arm64 and + i386, x86_64 for simulator.

3. Xcode Tool

We use Xcode 9.0 to create libraries and demo project. You may get errors if you use the lower xcode versions. We encourage you to using the newest version of Xcode.

4. Demo project

We provide a demo project that helps you use this SDK easily.

Installing SDK for your project

1. Import library into your project

• Drag and drop VTCPosSDK.framework into your project.
• Let “Create groups” and “Copy items if needed” checked to copy SDK to your project.

Đăng Ký

2. Embedded Binaries framework

Đăng Ký
Đăng Ký

3.Working with the SDK:

• for Swift
- to present the SDK VTC POS:
VTCPosSDKManager.sharedInstance().showSDK(from: viewController)
Parameters:
o viewController: view controller for presenting the SDK.
- SDK Delegate
You need inherit protocol VTCPosSDKManagerDelegate to receive result after transaction finish.
Implement method of VTCPosSDKManagerDelegate: func vtcPosSDKManagerDidCompleted(withTransactionId transactionId: String?, error: String?) {
}
Parameters:
o transactionId: ID of transaction if successful.
o error: error message if there is a error in transaction.
• for Objective-C
- to present the SDK VTC POS:
[[VTCPosSDKManager sharedInstance] showSDKFrom:viewController];
Parameters:
o viewController: view controller for presenting the SDK.
- SDK Delegate
You need inherit protocol VTCPosSDKManagerDelegate to receive result after transaction finish.
Implement method of VTCPosSDKManagerDelegate:
- (void)VTCPosSDKManagerDidCompletedWithTransa ctionId:(NSString *)transactionId error:(NSString
*)error {
}
Parameters:
o transactionId: ID of transaction if successful.
o error: error message if there is a error in transaction.

ANDROID

1. Gradle Setup

1.1. Open file build.gradle (Module: app) and add the following: compile(name: 'sdkpos', ext: 'aar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.google.zxing:core:3.2.0'
compile 'com.mikhaellopez:circularimageview:3.0.2'
1.2. Open file build.gradle (Module: Project) add the following: allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
flatDir {
dirs 'libs'
}
}
}

2. Add required code

SdkPos.getInstance().initSdk(MainActivity.this, new CallbackPayment() {
@Override public void onPaymentSuccess(PaymentModel paymentModel) {
Toast.makeText(MainActivity.this, "onPaymentSuccess " + paymentModel.getTransactionID(), Toast.LENGTH_LONG).show();
}
@Override public void onPaymentError(String error)
{
Toast.makeText(MainActivity.this, "onPaymentError " + error, Toast.LENGTH_LONG).show();
}
});
Parameters:
• MainActivity: context
• CallbackPayment: callback when payment success
• PaymentModel: model when payment success
Params: - TransactionID (long): transaction ID when payment success

3. Proguard

If use Proguard, add following code to file proguard:
-keepattributes Signature -keepattributes *Annotation*
-keep class com.vtc.sdkpaypos.** { *; }
-dontwarn com.vtc.sdkpaypos.**
-keep class android.content.** { *; }
-dontwarn android.content.**
-keep class android.support.** { *; }
-dontwarn android.support.**
-dontwarn okio.**
-dontwarn com.squareup.okhttp.**
-dontwarn com.squareup.picasso.** #retrofit2
-dontnote retrofit2.Platform
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
-dontwarn retrofit2.Platform$Java8 -dontwarn rx.internal.**

CONTACTS

Hanoi (Headquarter): Floor 14 - VTC Building, 23 Lac Trung Street, Hai Ba Trung District, Hanoi
HCMC(Branch) : 259 Dong Den Street, Ward 10, Tan Binh District, HCMC
Sale manager: Mr.Cao Ngoc Tan – Email: tancn@vtc.vn
Contact : 1900 1530 - 08 9999 1530 - https://pay.vtc.vn

Download iOS Download android