TchekSDK Documentation

Protocol Tchek​Buy​Back​Manager

public protocol TchekBuyBackManager  

Requirements

get​Third​Party​Available()

func getThirdPartyAvailable() -> [TchekThirdParty] 

This method list third party available

third​Party​Activated(tchek​Third​Party:​)

func thirdPartyActivated(tchekThirdParty: TchekThirdParty) -> Bool

This method return Third Party activated state (login success)

login​PVO2(login:​pass:​on​Failure:​on​Success:​)

func loginPVO2(login: String,
				   pass: String,
				   onFailure: @escaping (TchekError) -> Void,
				   onSuccess: @escaping () -> Void) 

This method login to PVO2

verify​PVO2Credentials(on​Failure:​on​Success:​)

func verifyPVO2Credentials(onFailure: @escaping (TchekError) -> Void,
							   onSuccess: @escaping () -> Void) 

This method check if credentials are still valid

logout​PVO2(on​Failure:​on​Success:​)

func logoutPVO2(onFailure: @escaping (TchekError) -> Void,
					onSuccess: @escaping () -> Void) 

This method logout to PVO2

buy​Back​Flow​PVO2(builder:​shoot​Inspect​Builder:​)

func buyBackFlowPVO2(builder: TchekBuyBackFlowBuilder, shootInspectBuilder: TchekShootInspectBuilder) -> UIViewController? 

This method initializes a Buy Back Flow customized with the provided TchekBuyBackFlowBuilder

Usage:

let builder = TchekBuyBackFlowBuilder(delegate: self) { builder in
builder...
}
	 
let viewController = TchekSdk.buyBackManager().buyBackFlow(builder: builder)
navigationController.present(viewController, animated: true, completion: nil)

Parameters

builder Tchek​Buy​Back​Flow​Builder

The builder to customize the look of Buy Back Flow UI elements

shoot​Inspect​Builder Tchek​Shoot​Inspect​Builder

The builder used for customizing the features of Shoot/Inspect

Returns

A UIViewController to initiate the Buy Back Flow or null if error occurs (onBuyBackFlowError() delegate method will be called)