/Zooz-iOS

Primary LanguageObjective-CApache License 2.0Apache-2.0

Zooz Apple iOS SDK – version 1.2

This version now supports bitcode.

Installing the Zooz iOS SDK Framework

  1. Download the Source code zip (Zooz-iOS zip) and the Zooz-iOS-Frameworks.zip files from https://github.com/Zooz/Zooz-iOS/releases
  2. Unzip the Zooz-iOS zip file into any location on your drive.
  3. Drag the Zooz.framework into your Xcode project hierarchy.
  4. Select your project in "Add to targets", and select "Copy.." in the Destination****.
    Note: Make sure to click "Copy", when adding the framework to your project. If "Copy" is not clicked, and then the downloaded SDK is moved, the app build may not work.
  5. Add the framework to the Embedded Binaries of the target.
  6. Add the following framework headers into the “Zooz-iOS” reference file.

#import <Zooz/ZoozController.h>

#import <Zooz/ZoozAddPaymentMethodRequest.h>

Coding

  1. Create the Zooz Controller object:

ZoozController *zooz = [[ZoozController alloc] initWithProgramId:programId.text zoozServerURL:serverUrl.text delegate:self];

  1. Create the "ZoozPaymentMethodDetails" to hold the card details taken from your UI.

ZoozPaymentMethodDetails *card = [[ZoozPaymentMethodDetails alloc] init];

    card.cardNumber = cardNumber.text;

    card.cvvNumber = cvv.text;

    card.expirationMonth = month.text;

    card.expirationYear = year.text;

    card.cardHolderName = cardHolderName.text;

3. Create either an "add card" or a "remove card" request:

ZoozAddPaymentMethodRequest *addRequest = [ZoozAddPaymentMethodRequest createRequestWithPaymentToken:paymentToken.text emailAddress:email.text address:nil paymentMethodDetails: card isRememberPaymentMethod:rememberMe.on];

4. Execute the request:

[zooz executeZoozRequest:addRequest]

5. Implement the delegate methods to receive the success or failure callbacks of adding the card. Note: *The delegate methods are requested in a background thread, not on the main UI thread.*

ControllerConfiguration Class Definition

Attribute Name

Description

Mandatory

zoozServer

The Zooz server URL.

Yes

programId

Program ID as registered in the Zooz Portal.

Yes

paymentToken

A paymentToken is a secure token representing a payment in the Zooz system. You can generate this value any of the following ways:

  • The paymentToken attribute from the openPayment request.
  • The customerToken attribute from the getToken request.

Yes

addPaymentMethod request

Attribute Name

Description

Mandatory

paymentToken

A paymentToken is a secure token representing a payment in the Zooz system. You can generate this value any of the following ways:

  • The paymentToken attribute from the openPayment request.
  • The customerToken attribute from the getToken request.

Yes

email

Card holder email address.

Yes

billingAddress

User billing address.

No

rememberPaymentMethod

To save the payment method for future transactions. Default value is true.

Yes

paymentMethodDetails

cardHolderName

Name on credit card.

Yes

expirationDate

Card expiration date in MM/YYYY format.

Yes

cvvNumber

Credit card CVV number.

Yes

cardNumber

The credit card number.

Yes

userIdNumber

User's national ID number. Should contain 5-12 digits.

No

removePaymentMethod request

Attribute Name

Description

Mandatory

paymentToken

A paymentToken is a secure token representing a payment in the Zooz system. You can generate this value any of the following ways:

  • The paymentToken attribute from the openPayment request.
  • The customerToken attribute from the getToken request.

Yes

paymentMethodToken

The paymentMethodToken to remove.

Yes

Examples

You can view a complete integration code in the sample app that is part of the SDK zip file.