Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 3.56 KB

CNISDKSumUpKit.md

File metadata and controls

77 lines (53 loc) · 3.56 KB

conichiSDK SumUp Kit

Dependency

This kit is dependent on the following:

Overview

The CNISDKSumUpKit provides the way to manage guest's credit cards by using SumUp as a payment provider.

Installation

Install as a framework

To use CNISDKSumUpKit, head on over to the releases page, and download the CNISDK.framework.zip. Extract the zip file and drag and drop CNISDKCoreKit.framework, Conichi_Meta.framework, Conichi_Authentication.framework, Conichi_Network.framework, CNISDKPaymentKit.framework, CNISDKSumUpKit.framework and Conichi_Errors.framework to the Project target -> general -> Embedded Binaries.

Install via CocoaPods

The preferred way to integrate CNISDKSumUpKit is via CocoaPods. Add the following line to your Podfile:

use_frameworks!

pod 'CNISDKSumUpKit'

Run pod install, and you should now have the latest CNISDKSumUpKit release.

Install via Carthage

To integrate CNISDKSumUpKit via Carthage add the following line to your Cartfile:

github "conichiGMBH/conichi-ios-sdk"

Run carthage update, and you should now have the latest version of CNISDKSumUpKit in your Carthage folder.

Getting Started

Sections below explain major and the most important parts of the CNISDKSumUpKit. For the complete documentation please refer to this page. Also, it can be useful to read the overview about CNISDKCoreKit and CNISDKPaymentKit.

Initialization

Example below shows the simplest setup CNISDKSumUpKit

  //Create a configuration for the payment.
  //At the moment there are no available properties to configure
  CNISDKSumUpKitConfiguration *sumUpKitConfiguration = [CNISDKSumUpKitConfiguration configurationWithBlock:^(id<CNISDKMutableSumUpKitConfiguration> \_Nonnull mutableConfiguration) {}];

  //Create a payment kit bundle
  CNISDKKitBundle *sumUpKit = [CNISDKKitBundle bundleWithKit:CNISDKSumUpKit configuration:sumUpKitConfiguration]

  //Create a configuration for the sdk instance
  CNISDKConfiguration *configuration = [CNISDKConfiguration configurationWithBlock:^(id<CNISDKMutableConfiguration> \_Nonnull mutableConfiguration) {
    mutableConfiguration.logLevel = CNISDKLogLevelInfo;
    mutableConfiguration.apiKey = @"your-api-key";
    mutableConfiguration.apiSecret = @"your-api-secret";
    mutableConfiguration.kits = @[ sumUpKit ];
    mutableConfiguration.environment = CNISDKEnvironmentSandbox;
  }];

  //Setups the sdk delegate - it can be any object that conforms to CNISDKDelegate protocol
  id<CNISDKDelegate> delegate = [self yourMethodToSetupSDKDelegate];

  //Start the sdk with the given configuration
  [CNISDK startWithConfiguration:configuration delegate:delegate];

Managing of credit cards

Important to manage credit cards guest has to be authorized.
To manager credit cards for the specific CNISDKGuest please refer to paymentInstrumentManager:

[CNISDKSumUp sharedInstance].paymentInstrumentManager

The manager conforms to CNISDKPaymentInstrumentManager protocol that describes the all possible actions.