Workflow

Overview

Workflow Examples

In Scope

Swift - SwiftUI

To submit a <xCommand> request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Register the “view appear” method with the “body” parameter

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Next, create a transaction parameters object:

Specify the required parameters:

CHANGE <xCommand>

Specify the additional parameters for the <xCommand> transaction type:

If selected Transaction type is cc:sale, cc:credit, cc:authonly

If selected Transaction type is cc:capture

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Swift - Storyboard

To submit a <xCommand> request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Next, create a transaction parameters object:

Specify the required parameters:

CHANGE <xCommand>

Specify the additional parameters for the <xCommand> transaction type:

If selected Transaction type is cc:sale, cc:credit, cc:authonly

If selected Transaction type is cc:capture

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Objective C - Storyboard

To submit a <xCommand> request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Next, create a transaction parameters object:

Specify the required parameters:

CHANGE <xCommand>

Specify the additional parameters for the <xCommand> transaction type:

If selected Transaction type is cc:sale, cc:credit, cc:authonly

If selected Transaction type is cc:capture

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Out of Scope

Swift - SwiftUI 2

To submit a <xCommand> request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Register the “view appear” method with the “body” parameterde

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Define a Publisher object that will deliver processed Transaction results in a Notification:

Define a Publisher object that will deliver Notifications about various card reader event taking place in the SDK:

Define a method to run when the SDK processes a transaction and sends the processing results back:

Afterwards, subscribe the method to receive results back from the SDK:

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

Afterwards, subscribe the method to be notified about card reader events:

Next, create a transaction parameters object:

Specify the required parameters:

CHANGE <xCommand> to value from Transaction Type dropdown

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Swift - Storyboard 2

To submit a <xCommand> request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Define a method to run when the SDK processes a transaction and sends the processing results back:

Afterwards, subscribe the method to receive results back from the SDK:

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

Afterwards, subscribe the method to be notified about card reader events:

Next, create a transaction parameters object:

Specify the required parameters:

CHANGE <xCommand> to value from Transaction Type dropdown

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Objective C - Storyboard 2

To submit a <xCommand> request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Define a method to run when the SDK processes a transaction and sends the processing results back:

Afterwards, subscribe the method to receive results back from the SDK:

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

Afterwards, subscribe the method to be notified about card reader events:

Next, create a transaction parameters object:

Specify the required parameters:

CHANGE <xCommand> to value from Transaction Type dropdown

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Examples

In Scope Example Processes

Selections
Example 1
Example 2

Integration

In Scope

In Scope

Language

Swift

Objective C

UI Toolkit

Storyboard

Storyboard

Transaction Type

cc:sale

cc:refund

In Scope Example 1

Integration

In Scope

Language

Swift

UI Toolkit

Storyboard

Transaction

cc:sale

Example 1 sets xCardNum & xExpDate into the parameters object as those 2 are required by the cc:sale command. Therefor example 1 has the Specify the additional parameters for the "cc:sale" transaction type: sample code

To submit a cc:sale request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software, if any

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Next, create a transaction parameters object:

Specify the required parameters:

[VARIES] REQUIRED FOR IN SCOPE CC:SALE

Specify the additional parameters for the “cc:sale” transaction type:

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

In Scope Example 2

Integration

In Scope

Language

Objective C

UI Toolkit

Storyboard

Transaction Type

cc:refund

Example 2 sets the xRefNum value required by the cc:refund command. Therefor example 2 has Specify the additional parameters for the "cc:refund" transaction type:

To submit a cc:sale request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software, if any

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Next, create a transaction parameters object:

Specify the required parameters:

[VARIES] REQUIRED FOR IN SCOPE CC:REFUND

Specify the additional parameters for the “cc:refund” transaction type:

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Out of Scope Example Processes

Selections
Example 1
Example 2

Integration

Out of Scope

Out of Scope

Language

Swift

Objective C

UI Toolkit

Storyboard

Storyboard

Transaction Type

cc:sale

cc:sale

Out of Scope Example 1

Integration

Out of Scope

Language

Swift

UI Toolkit

Storyboard

Transaction

cc:sale

To submit a cc:sale request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software, if any

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Define a method to run when the SDK processes a transaction and sends the processing results back:

Afterwards, subscribe the method to receive results back from the SDK:

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

Afterwards, subscribe the method to be notified about card reader events:

Next, create a transaction parameters object:

Specify the required parameters:

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Out of Scope Example 2

Integration

Out of Scope

Language

Objective C

UI Toolkit

Storyboard

Transaction Type

cc:sale

To submit a cc:sale request, first configure the SDK with:

  • an xKey value obtained from Cardknox

  • a software name value; a short name for your application

  • a software version value; the current version of your software, if any

  • a version value; the current Cardknox Gateway version 4.5.9

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

Define a method to run when the SDK processes a transaction and sends the processing results back:

Afterwards, subscribe the method to receive results back from the SDK:

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

Afterwards, subscribe the method to be notified about card reader events:

Next, create a transaction parameters object:

Specify the required parameters:

Specify optional parameters, if any:

Create a request object, check if the request object is valid, initiate a transaction & process the response:

Last updated

Was this helpful?