Documentation - iOS webteh modul

Versions

  • Version 1.8.2

    • Removed UIWebView usage, replaced with WKWebView
    • Updated examples
  • Version 1.8.1

    • Added add payment method with cancel transaction functionality (void after authorization)
    • Refactored existing code
    • Added add payment method example
  • Version 1.8.0.rc1

    • Added list payment methods
    • Added update payment method
    • Added delete payment method
    • Updated examples: list, update, delete
  • Version 1.8.0.beta

    • Added Merchant class
    • Added OrderDetails class
    • Added PayCvvOrderDetails class
    • Extended AddCardModel with new constructor(Merchant, OrderDetails, Consumer)
      • Added user_id flag, used to save card
    • Updated usage example
  • Version 1.7.0.rc

    • Added support for Customer data
    • Updated examples with Customer initialization
  • Version 1.6.0.rc.0

    • Added extensive logging
    • Added optional method -(void) logTransactionInfo:(NSString *)loggingInfo; on TransactionLifecycleAdapterDelegate
  • Version 1.5.2.rc
    • Added BusinessError handling in PgwApi
    • BusinessError fields are nil if not found (previous NSNull)
    • Added BusinessError
      • Business errors are now parsed into BusinessError instance with extra fields
        • transactionId
        • maskedPan
        • fullName
        • cardType
        • pmAlias
    • Error handling now creates BusinessError instance if possible
      • Error contains transaction_id, full_name, card_type, masked_pan, and library_error = false - BusinessError will be created
      • ApiError instance will be created

Description

Module encapsulates basic functionality for payment system.

Installation


Add pay.xcodeproj in your application or via cocoa pods.

Usage & requirements


Overall functionality is shown in flow charts:

Pay module functionality is provided in two classes:

  • WebtehWebView class
  • PgwApi class

To use WebtehWebView add-card and pay-cvv developer must provide auth_token issued to merchant. Same case is for PgwApi.

Auth token is used to authenticate merchant and to decide which payment gateway endpoint will be used (test or production).

Note: if you do not have auth token please contact [email protected] to receive one.

WebtehWebView


Functionality

Include WebtehWebView in your layout or create dynamically in java code.

Usage example:

  • Connect webView from storyboard with outlet
    @interface AddCardViewController ()
      @property (weak, nonatomic) IBOutlet WebtehWebView *webtehWebView;
    @end
    
  • Initialize webview and implement TransactionLifecycleAdapterDelegate - example.h example.m
    PgwApi *api = [[PgwApi alloc] init:@"00001111222233330000111122223333" isDebug:true];
    NSString *orderNumber = [ApiService currentMillis];
    TransactionLifecycleAdapter * adapter = [[TransactionLifecycleAdapter alloc] init:self api:api
      merchantKey:@"TestKeyXULLyvgWyPJSwOHe" orderNumber:orderNumber];
    [_webtehWebView initialize:adapter isDebug:true timeout:10000];
    
  • Invoke addCard or
    AddCardModel *model = [[AddCardModel alloc] init:@"007007007007"
      client:@"ios"
      orderInfo:@"order info"
      orderNumber:orderNumber
      sign:@"009"
      amount:@"1340"
      currency:@"EUR"
      clientSecret:@"MegaSecretKey"
      authToken:@"00001111222233330000111122223333"];
    [_webtehWebView addCard:model];
  • invoke payCvv
    
    PayCvvModel *model = [[PayCvvModel alloc] init:@"007007007007"
      pmAlias: @"xoAVCN1-4nzfgOP6uKlH6LWgZXYuk7IY4kJ8JxYa"
      client:@"cvv_ios"
      orderInfo:@"order info"
      orderNumber:orderNumber
      sign:@"009"
      amount:@"1340"
      currency:@"EUR"
      clientSecret:@"MegaSecretKey"
      authToken:@"00001111222233330000111122223333"];
    [_webtehWebView payCvv:model];
    
    

Models

-AddCard jsonschema
Proxy uses json schemas to validate input received on endpoints. For example this schema is used to validate on /add-card endpoint.
-PayCvv json schema
Proxy uses json schemas to validate input received on endpoints. For example this schema is used to validate on /pay-cvv endpoint.
-TransactionError
-TransactionSuccess
-TransactionErrorDetailed

PgwApi


Usage example - checkOrderId, checkOrder, checkTransaction, getError - example