PaynetEasyReader 0.2.32-5

PaynetEasyReader 0.2.32-5

Evgeniy Sinev 维护。



 
依赖项
BerTlv~> 0.2
TDOAuth~> 1.0
RemoteLogger~> 0.1
 

  • PaynetEasyReader

PaynetEasyReader SDK for iOS

PaynetEasyReader SDK 为移动应用程序中与 mPOS 终端快速简单集成提供支持。

MPOS 支持列表

  • Spire Payments
  • SPm2
  • SPm20
  • Miura Systems
  • Miura Shuttle (M006)
  • Miura M010
  • Miura M007
  • Verifone Vx820
  • PAX SP30, D200

开始使用

PaynetEasyReader SDK 包含头文件和一个单个静态库。我们将向您介绍集成和使用方法。

需求

  • 支持目标部署iOS版本7.0以上和指令集armv7+(包括64位),x86_64,i386(适用于模拟器)。

将SDK添加到您的项目中

在您的Podfile中添加

pod "PaynetEasyReader", :git => '[email protected]:evsinev/PaynetEasyReader.git', :tag => '$VERSION'

请将$VERSION更改为从https://github.com/payneteasy/PaynetEasyReader/releases获取的最新版本

适用于Miura, Spire和Pax

添加到您的*-Info.plist

<key>UISupportedExternalAccessoryProtocols</key>
  <array>
    <string>com.miura.shuttle</string>
    <string>com.thyron</string>
    <string>com.paxsz.ipos</string>    
  </array>

示例代码

实现PNEReaderPresenter协议

- (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
    ];
}

启动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];

示例

注册您的账户