Switch to dark theme

Switch to light theme

APIs & Features


About Fusion
Published on 25th March, 2021

After you have successfully completed the steps from the previous section you are now ready to use an instance of CardsService to work with your customers card details.

The following functionalities are avilable as a part of the iOS SDK :

1. Card Info APIs

  • Get Card Data

You can fetch the card PAN details by calling this API. Here is a code snippet :

Sample cURL

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager getCardPanWithCardID: CARD_ID success: ^(NSString *cardPan) {
        NSLog(@"Card Pan Fetched Successfully: %@",cardPan);
    } failure: ^(ApolloCardErrorInfo *userInfo) {
        NSLog(@"Failed to fetch card Pan");
    }];
Code Copied

Note: To comply with PCC DSI guidelines, this API is only exposed for card issuers.

  • Get Sensitive Card Data

You can fetch the sensitive card info by calling this API. Your users will need authentication to access the sensitive data at least once per app launch. Here is a sample code snippet for the same :

Sample snippet

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
8
  
[self.cardManager getSecureCardDetailsWithCardID:CARD_ID
                                success:^(NSDictionary *securedCardDetails) {
        NSLog(@"Fetched card successfully: %@", securedCardDetails);
    }
                                failure:^(ApolloCardErrorInfo *userInfo) {
        NSLog(@"Failed to fetch card: %@",userInfo.message);
    }];
Code Copied

Sample response

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
8
  
[self.cardManager getSecureCardDetailsWithCardID:CARD_ID
                                success:^(NSDictionary *securedCardDetails) {
        NSLog(@"Fetched card successfully: %@", securedCardDetails);
    }
                                failure:^(ApolloCardErrorInfo *userInfo) {
        NSLog(@"Failed to fetch card: %@",userInfo.message);
    }];
Code Copied

Note: To comply with PCC DSI guidelines, this API is only exposed for card issuers.

  • Get card view

You can get the card view with the layout and styles configured specifically for your app with the Zeta platform. The default state of the view returned is the collapsed view which shows only the card PAN.

On clicking the view, the user can toggle between the collapsed and the sensitive info states. User authentication is required for accessing the sensitive state of the cards view if the user has not been asked for authentication already in the current app session.

You also have a copy card number feature on the view to copy the card on the clipboard. Here is the code snippet to fetch cardDetails.

Fetch card details

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
8
  
[self.cardManager getCardUIWithCardID:CARD_ID payload:@{
          @"cardHolderName": @"CardHolder Name"
      } success:^(UIView * _Nullable cardView) {
        NSLog(@"CardView: %@",cardView);
        } failure:^(ApolloCardErrorInfo * _Nonnull error) {
            NSLog(@"Get View Failed: %@", error.message);
        }];
Code Copied

2. Super PIN

  • Super PIN for resource

The return value is a Super PIN along with the validity in milliseconds. Here is a code snippet on how you can fetch the Super PIN for a given resource.

Super PIN for resource

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
8
  
 [self.cardManager generateSuperPINForResource:<RESOURCE_ID> completion:^(NSString * _Nullable superPin, NSTimeInterval validityInSeconds, ApolloCardErrorInfo * _Nullable error) {
        if(error) {
            NSLog(@"Failed to fetch super pin from Card: %@", error.message]);
        } else {
            NSLog(@"SuperPin fetched successfully from Card: %@", superPin);
        }
    }];
Code Copied

  • Super PIN API

Note: Use this only when you are sure that users have a single resource associated with their accountHolderId’s

The return value is a Super PIN along with the validity in milliseconds. Here is a code snippet on how you can fetch the Super PIN.

Super PIN API

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
8
  
    [self.cardManager generateSuperPINWithCompletion:^(NSString * _Nullable superPin, NSTimeInterval validityInSeconds, ApolloCardErrorInfo * _Nullable error) {
        if(error) {
            NSLog(@"Failed to fetch super pin from Card: %@", error.message]);
        } else {
            NSLog(@"SuperPin fetched successfully from Card: %@", superPin);
        }
    }];
Code Copied

Note: When using the Cipher SDK along with the Cards SDK, you need to initialize Cipher SDK before accessing the Super PIN for Cards SDK.

  • Super PIN UI for Resource

Cards SDK also provides a UI for fetching the Super PIN for a given resource. The UI adds a translucent black background on the existing screen and shows a popup containing the Super PIN. The UI is in accordance with the theme with which the SDK has been configured.

Here is a code snippet on how you can fetch the Super PIN UI for a resource.

Super PIN UI for resource

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager getSuperPinUIForResource:<RESOURCE_ID> success:^(UIView * _Nonnull superPinView) {
    // add view to superview here
  } failure:^(ApolloCardErrorInfo * _Nonnull error) {
    NSLog(@"Failed to fetch super pin from Card: %@", [error message]);
  }];
Code Copied

  • Sample response

  • Super PIN UI

Note: Use this only when you are sure that users have a single resource associated with their accountHolderId’s

Cards SDK also provides a UI for fetching the Super PIN. The UI adds a translucent black background on the existing screen and shows a popup containing the Super PIN. The UI is in accordance with the theme with which the SDK has been configured.

Here is a code snippet on how you can fetch the Super PIN UI assuming a single resource :

Super PIN UI

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager getSuperPinUIWithSuccess:^(UIView * _Nonnull superPinView) {
    // add view to superview here
  } failure:^(ApolloCardErrorInfo * _Nonnull error) {
    NSLog(@"Failed to fetch super pin from Card: %@", [error message]);
  }];
Code Copied

  • Sample response

3. Set Static PIN APIs

The app can use the set static pin API to set the static for entered cardId (form-factor-id) in the API method param. This API is behind user authentication and requires authentication per launch of the app. Here is the code snippet for the same.

Static PIN

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
    [self.cardManager setCardPin:@"X_DIGIT_CARD_PIN" forCardId:@"CARD_ID" success:^{
        NSLog(@"Card PIN Set Successfully");
    } failure:^(ApolloCardErrorInfo *userInfo) {
        NSLog(@"Setting Card Pin Failed with error: %@",userInfo.message);
    }];
Code Copied

Note: To comply with PCC DSI guidelines, this API is only exposed for card issuers.

  • Set Static PIN Using UI Cards SDK exposes this API to expose the set static PIN functionality along with the UI. The UI is in accordance with the theme with which the SDK has been configured. This API is behind user authentication and requires authentication per launch of the app. Here is the code snippet for the same.

Static PIN

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
   [self.cardManager launchCardPinUIForCardId:<card_id> success:^{
        NSLog(@"Card PIN Set Successfully");
    } failure:^(ApolloCardErrorInfo *userInfo) {
        NSLog(@"Setting Card Pin Failed with error: %@",userInfo.message);
    }];
Code Copied

  • Change StaticPin API + UI

Cards SDK provides a UI for changing the Static PIN given a card form-factor. This API can only be used once the Static PIN is set. The UI is in accordance with the theme with which the SDK has been configured. The UI comprises of three input fields where we can enter:

  1. Old Static PIN
  2. New Static PIN
  3. Re-enter New Static PIN

Users can update the Static by providing the correct Old PIN and valid new PIN. The UI also provides validations for:

  1. PIN lengths
  2. Correctness of Old Static PIN entered.
  3. Equality of the New Static PIN entered twice.

Here is the code snippet for the same:

Static PIN

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager launchChangeCardPinUIForCardId:CARD_ID success:^{
    NSLog(@"Change pin successfully");
  } failure:^(ApolloCardErrorInfo *userInfo) {
    NSLog(@"Failed to change pin with error: %@", userInfo.message);
  }];
Code Copied

  • Sample response

4. Block/ Unblock Card API

Cards SDK exposes this API to expose the Block Card functionality. The user can use this API to block the card temporarily. The user may unblock the card in future if required. Here is the code snippet for the same.

Block card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager blockCard:CARD_ID description:@"" success:^{
          NSLog(@"Card Blocked successfully");
      } failure:^(ApolloCardErrorInfo *userInfo) {
          NSLog(@"Card block Failed with error: %@",userInfo.message);
      }];
Code Copied

  • Block Card UI

Cards SDK also provides a UI for blocking the card. The UI is in accordance with the theme with which the SDK has been configured. The UI adds a translucent black background on the existing screen and shows a snackbar containing the option to either cancel or Block the card.

Here is the code snippet for the same.

Block card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
 [self.cardManager blockCardWithAlert:<CARD_ID> description:<Description> success:^{
    NSLog(@"Card blocked successfully");
  } failure:^(ApolloCardErrorInfo *userInfo) {
    NSLog(@"Card block failed");
  }];
Code Copied

  • Sample response

  • Unblock Card API

Cards SDK exposes this API to expose the unblock Card functionality. The user can use this API to block the card temporarily. The user may unblock the card in future if required. Here is the code snippet for the same.

Unblock card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
  

[self.cardManager unblockCard:CARD_ID description:@"" success:^{
          NSLog(@"Card unblocked successfully");
      } failure:^(ApolloCardErrorInfo *userInfo) {
          NSLog(@"Card unblock Failed with error: %@",userInfo.message);
      }];
Code Copied

  • Unblock card UI

Cards SDK also provides a UI for unblocking the card. The UI is in accordance with the theme with which the SDK has been configured. The UI adds a translucent black background on the existing screen and shows a snackbar containing the option to either cancel or unblock the card. Here is the code snippet for the same.

Unblock card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager unblockCardWithAlert:<CARD_ID> description:<Description> success:^{
    NSLog(@"Card unblocked successfully");
  } failure:^(ApolloCardErrorInfo *userInfo) {
    NSLog(@"Card unblock failed");
  }];
Code Copied

  • Sample response :

5. Hotlist Card API

Cards SDK exposes this API to expose the Hotlist Card functionality. The user can use this API to block the card permanently. This can be done in a case when the user has lost his card and wants to block the card permanently to prevent any misuse. While invoking this API, one first sends the reason for Hotlisting the card. Following can be the reasons for Hotlisting the card:

  1. “LOST”
  2. “STOLEN”
  3. “DAMAGED”
  4. “HOTLISTED”
  5. “OFAC_BLOCKED”
  6. “EXPIRED”

Hotlist card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager hotlistCard:CARD_ID description:@"" success:^{
          NSLog(@"Card Hotlisted successfully");
      } failure:^(ApolloCardErrorInfo *userInfo) {
          NSLog(@"Card Hotlist Failed with error: %@",userInfo.message);
      }];
Code Copied

  • Hotlist Card UI

Cards SDK also provides a UI to hotlist the card. The UI is in accordance with the theme with which the SDK has been configured. The UI adds a translucent black background on the existing screen and shows a snackbar containing the option to either cancel or hotlist the card.

Hotlist card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
 [self.cardManager hotlistCardWithAlert:<CARD_ID> description:<Description> success:^{
    NSLog(@"Card hotlisted successfully");
  } failure:^(ApolloCardErrorInfo *userInfo) {
    NSLog(@"Card hotlist failed");
  }];
Code Copied

6. Activate Card

  • Activate Card Using Card Sensitive Information API:

The Cards SDK provides an API to activate the card using card sensitive information. The card sensitive information includes:

  1. Card Number
  2. Expiry Date
  3. CVV

This API is behind user authentication and requires authentication per launch of the app. Here is the code snippet for the same:

Activate card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager activateCardWithCardNo:<CARD_NO> expiryDate:<EXPIRY> cvv:<CVV> successBlock:^(id responsePayload) {
    NSLog(@"Card Activated Successfully");
  } failureBlock:^(NSError *error) {
    NSLog(@"Card Activation failed");
  }];
Code Copied

  • Activate Card Using Card Sensitive Information UI:

Cards SDK also provides a UI for activating the card. The UI is in accordance with the theme with which the SDK has been configured. The UI allows us to enter the three required fields and supports the following checks:

  1. Validation check on the length of the card number.
  2. Validation check on the length of the expiry date.
  3. Validation check on the length of the CVV number.
  4. Validation for the date entered in the expiry date field.

Activate card sensitive information

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
  

[self.cardManager launchActivateCardNumberUIWithSuccess:^{
    NSLog(@"Card Activated successfully");
  } failure:^(ApolloCardErrorInfo *userInfo) {
    NSLog(@"Activate Card failed with error: %@", userInfo.message);
  }];
Code Copied

  • Activate Card Using Card ID API (For Proxy Users ONLY)

Cards SDK provides the functionality to activate a card using Card ID. The API only requires the user to enter the Card ID. Using this, the API is able to activate the card. This API is behind user authentication and requires authentication per launch of the app. Here is the code snippet for the same :

Activate card using card ID

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
  

[self.cardManager activateCardWithCardID:<cardID> successBlock:^(id responsePayload) {
    NSLog(@"Card Activated Successfully");
  } failureBlock:^(NSError *error) {
    NSLog(@"Card Activation failed");
  }];
Code Copied

  • Sample response
  • Activate Card Using Card ID UI (For Proxy Users ONLY)

Cards SDK also provides the UI for activating cards using Card ID. The UI comprises of a two fields:

  1. Card ID - Editable field that allows the user to enter the Card ID. Validations on Card ID length are added to this field.
  2. DNI Number - Non - Editable user property.

Activate card

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
  

[self.cardManager launchActivateCardIDUIWithSuccess:^{
    NSLog(@"Card Activated successfully");
  } failure:^(ApolloCardErrorInfo *userInfo) {
    NSLog(@"Activate Card failed with error: %@", userInfo.message);
  }];
Code Copied

  • Sample Response:

7. Copy Card Number

Card SDK provides the functionality to copy the un-masked card number. On success, it shows a toast message with the card number. Post that, you can paste the card number where-ever required.

Copy card number

Switch Theme
Expand More
Copy
1
2
  
[self.cardManager copyCardNumberWithCardId:<CARD_ID];
Code Copied

8. Front Face Card UI

Cards SDK provides a full equipped front face card UI. This is a full UI for all the features provided by SDK cards. This UI supports multiple customisations and can be completely designed and changed from as per client requirement. Here is a code snippet.

Front face card view UI

Switch Theme
Expand More
Copy
1
2
3
4
5
6
  
[self.cardManager initiateFrontFaceCardFlowWithCardID:<CARD_ID>
                                           showSuperPin:YES
                                       showCardSettings:YES
                                                  state:<DEFAULT_CARD_STATE>
                                             templateID:<TEMPLATE_ID>];
Code Copied

  • Sample Response:

9. Logout

Ensure that you logout the user by calling this API when you want to switch a user or the user logs out from the app. Failing to do this, the SDK may behave erratically later on. Here is code snippet for the same.

Logout

Switch Theme
Expand More
Copy
1
2
  
   [self.cardManager logout];
Code Copied

Exceptions and error codes

All the exception thrown will have the following fields in addition to the message :

  1. code - The error code related to the response
  2. traceId - The trace id which can be provided to Zeta support for identifying the root cause
  3. type - The type of error. (Added for verbosity)

Following are the meanings along with the error codes :