Documentation - iOS webteh modul


  • 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


Module encapsulates basic functionality for payment system.


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 to receive one.



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;
  • 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"
      orderInfo:@"order info"
    [_webtehWebView addCard:model];
  • invoke payCvv
    PayCvvModel *model = [[PayCvvModel alloc] init:@"007007007007"
      pmAlias: @"xoAVCN1-4nzfgOP6uKlH6LWgZXYuk7IY4kJ8JxYa"
      orderInfo:@"order info"
    [_webtehWebView payCvv:model];


-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.


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