Skip to content

Single Card Payment

The following is a full example on how a card payment flow is expected to behave. For an example on other payment method different than card, on in combining several payment methods, please refer to the Multi-tender full example.

We are going to guide you on the usage of each delegate function for the Sale manager, and how they are used during a card payment. We will assume you build your Sale request with all the products, amounts, etc., and that your app UI is ready to use by, for example, a clerk.

The User Interface

From your UI, the app user will select a payment method (for example, card or cash). We will focus here in the case of Card.

After the user selects to proceed wth a card payment, your app will need to use the ePOS SDK to access the payment terminal, and then proceed to use this terminal to start the payment. If you implemented the SDK correctly, you should be subscribing (Android) or declaring the delegate methods (iOS) for such purpose. As you can see in the Object Models and samples below, actions for accepting signature, informing about progress, etc., will be called asynchronously when needed. You can run the Integration Tests provided to see it yourself on iOS and Android.

The iOS Object Model

The payment flow for purchase sales requests is largely handled by the six methods of the Sales Manager component shown below on the right side of the diagram. The completed sale is delivered in the Sale Response object:

  • as a sale object if the processing was successful
  • as an error object if the processing was not successful

Tip

In the provided Objective-C and Swift sample code, look first at the very bottom of the code to see the six Sales Manager methods that are used because this helps to understand the overall payment flow. Next, look at the preceding code to see the details of each method that is called in the payment flow.

The Android Object Model

The previous chapter presented the Android code for handling the various card-related events on the terminal so the sample code here has just this code, and the object model looks like this:

The Sample Code

ObjC

Swift

The code demonstrates very simplistic usage of each unit of behaviour

Universal Windows Platform SDK coming soon