SimplFingerPrint 1.0.9

SimplFingerPrint 1.0.9

DevarajanRahul.M.MohanSimpl Admin 维护。



  • Simpl

simpl-fingerprint-sdk-ios

如何安装

CocoaPods

CocoaPods 是 Cocoa 项目的依赖管理器。您可以使用以下命令安装它:

$ gem install cocoapods

要使用 CocoaPods 将 GetSimpl 集成到您的 Xcode 项目中,请在您的 Podfile 中指定它:

pod 'SimplFingerPrint'

然后,运行以下命令:

$ pod install

用法

  • 导入库

    Obj-C

     #import <SimplFingerPrint/SimplFingerPrint.h>
    

    Swift

     import SimplFingerPrint
    
  • 创建GSUser对象

    Obj-C

    GSUser *user = [[GSUser alloc] initWithPhoneNumber:@"user mobile number" email:@"user email"]
    

    Swift

    let user = GSUser(phoneNumber: "user mobile number" , email: "user email" )
    
  • 如果您想传递额外的参数,则创建一个包含参数的字典,并将其传递给上面创建的GSUser对象

    Obj-C

     NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
     params[@"user_location"] = @"18.9750,72.8258"
     params[@"transaction_amount_in_paise"] = @"123344"
     user.headerParams = parms
    

    Swift

    var params : [String : Any] = [:]
    params["user_location"] = "18.9750,72.8258"
    params["transaction_amount_in_paise"] = "123344"
    user.headerParams = parms
    
  • 收集加密指纹

Obj-C

 GSFingerPrint *fp = [[GSFingerPrint alloc] initWithMerchantId:@"Your merchant id" andUser:user];
 [fp generateEncryptedPayloadWithCallback:^(NSString *payload) {
     NSLog(@"Payload: %@", payload);
 }];

Swift

 let fp = GSFingerPrint(merchantId: "Your merchant id", andUser: user)
 fp.generateEncryptedPayload { (payload: String?) in
   print(payload)
 }

请注意,有效负载将用AES(AES/CBC/PKCS7Padding)进行加密。