.. _mpos_sdk_for_ios: mPOS SDK for iOS ################ .. contents:: :local: .. role:: ex .. role:: code Introduction ------------ Payneteasy mPOS SDK is a mobile payment software & hardware package that allows to quickly and easily start offering a mobile payment service. Usage of an affordable mobile point of sale (mPOS) terminal allows Connecting party to extend their business with in-person non-cash payments. .. uml:: :align: center @startuml left to right direction rectangle "Mobile Device" { (mPOS SDK) #ffe6cc;line:black;line.dotted (Mobile App) } (Payneteasy) -- (mPOS SDK) (Payneteasy) - (Acquirer Bank) (mPOS SDK) -- (Mobile App) (mPOS device) - (mPOS SDK) @enduml PayneteasyReader SDK provides fast, ADVT & M-TIP compliant integration with :ref:`mPOS` terminals in mobile apps. SDK includes header files and a single static library. Supported Terminals ------------------------ .. list-table:: :widths: 30, 50, 50 :header-rows: 1 :class: longtable * - Vendor - Model - Connectivity * - Miura - M006, M007, M010 - Bluetooth, USB, Wi-Fi * - Spire - SPm2, SPm20 - Bluetooth * - Verifone - Vx820 - Ethernet, USB, RS232 * - PAX - SP30, D200 - Ethernet, USB, RS232 .. note:: | Requirements: PayneteasyReader SDK supports target deployment of iOS version 7.0+ and instruction set armv7+ (including 64-bit), x86_64, i386 (for emulator). Integration ----------- Add the SDK to the project ========================== Add the following to Podfile: :: pod "PayneteasyReader", :git => 'git@github.com:evsinev/PayneteasyReader.git', :tag => '$VERSION' Please change :code:`$VERSION` to the latest version from releases list for |ios_link| or |android_link| respectively. .. |ios_link| raw:: html IOS .. |android_link| raw:: html Android For Miura, Spire and Pax ======================== Add the following to \*-Info.plist: :: UISupportedExternalAccessoryProtocols com.miura.shuttle com.thyron com.paxsz.ipos Sample Code =========== Implement the PNEReaderPresenter protocol: :: - (void)stateChanged:(PNEReaderEvent *)aEvent { // displays reader status // see an example at https://github.com/payneteasy/ReaderExample/blob/master/ReaderExample/PaymentModule/PaymentPresenter.m#L69 } - (PNEProcessingContinuation *)onCard:(PNECard *)aCard { // provide payneteasy.com account info PNEProcessingContinuation * continuation = [PNEProcessingContinuation continuationWithBaseUrl:@"https://sandbox.payneteasy.com/paynet" merchantLogin:MERCHANT_LOGIN merchantKey:MERCHANT_KEY merchantEndPointId:END_POINT_ID orderInvoiceNumber:[[NSUUID UUID] UUIDString]]; return continuation; } - (void)onCardError:(PNECardError *)aError { // deal with the error // see an example at https://github.com/payneteasy/ReaderExample/blob/master/ReaderExample/PaymentModule/PaymentPresenter.m#L93 } - (void)onProcessingEvent:(PNEProcessingEvent *)aEvent { // wait for Result event // see an example at https://github.com/payneteasy/ReaderExample/blob/master/ReaderExample/PaymentModule/PaymentPresenter.m#L96 } - (PNEConfigurationContinuation *)onConfiguration { return [[PNEConfigurationContinuation alloc] initWithBaseUrl:@"https://paynet-qa.clubber.me/paynet/rki" merchantLogin:_payment.merchantLogin merchantKey:_payment.merchantKey merchantEndPointId:_payment.merchantEndPointId merchantName:_payment.merchantName ]; } Start Reader Manager: :: PNEReaderFactory *factory = [[PNEReaderFactory alloc] init]; PNEReaderInfo *reader = [PNEReaderInfo infoWithType:PNEReaderType_MIURA_OR_SPIRE]; // Note: manager must be a property or a field or a static local variable, to prevent an elimination manager = [factory createManager:reader amount:[NSDecimalNumber decimalNumberWithString:@"1.00"] currency:@"RUB" presenter:self]; [manager start]; Useful Links ============================================= - `Objective-c with Cocoapods `__ - `Swift with Cocoapods `__ - `Swift with Carthage `__ - Additional samples can be provided by request. - Other releases can be found `here `__. Test Environment ================== .. list-table:: :widths: 30, 50, 50 :header-rows: 1 :class: longtable * - Amount - Status - Stage * - 1.00 - APPROVED - Purchase, Final Advice * - 2.00 - DECLINED - Purchase * - 3.00 - APPROVED - Purchase * - 4.00 - DECLINED - Purchase, Final Advice * - 1000.01 - APPROVED - Purchase, Final Advice with PIN Online Test. :ex:`Only test cards can be used in test purposes.` .. note:: | Any card can be used. | If card asks ARQC then host replies with Authorisation Response Code = 'Z3' (Unable to go online, offline declined).