iOS SDK v2.0

10 downloads 11621 Views 150KB Size Report
iOS SDK Developer's Guide - Version 2.0 – Revised 09/05/13. 3. Overview. The SDK ... provides you with notification of important events related to the card reader. By subscribing to ... The zip code on file with the cardholder's issuing bank. CVV2 ... The following example shows a typical approval response: " YAPPROVED ...
iOS SDK v2.0 Developer’s Guide eProcessing Network LLC 9/5/2013

iOS SDK v2.0 Developer Guide Table of Contents OVERVIEW .............................................................................................................................................. 3 REQUIREMENTS .................................................................................................................................... 3 PROJECT SETUP.................................................................................................................................... 3 PROCESSING SWIPED TRANSACTIONS ............................................................................................. 4 PROCESSING KEYED TRANSACTIONS ............................................................................................... 4 RESPONSE VALUES ............................................................................................................................... 6

Overview The SDK provides a framework for processing both swiped and keyed transactions via eProcessing Networks’ secure gateway. For swiped transactions, we support the ePNMobile iMagPro encrypted card reader. Our SDK provides you with notification of important events related to the card reader. By subscribing to these events you will be notified when: o A reader is connected o A reader is disconnected o The user has swiped a card

When the user swipes a card, the SDK gathers the card information from the reader and immediately begins processing a transaction using the data.

Requirements An eProcessingNetwork account is required with corresponding Restrict Key. XCode development environment. A signed addendum with eProcessing Network, which can be obtained from a Sales Channel Development Manager.

Project Setup 1. Create a new project in XCode. 2. Add the ePN_SDK folder to your project folder and then add both to your XCode project. 3. Add the following frameworks to your project: a. AudioUnit.framework b. AVFoundation.framework c. MediaPlayer.framework

Important Note: You cannot use the simulator to build or run your project. A device must be connected because the SDK requires audio hardware that is not available on the simulator.

iOS SDK Developer’s Guide - Version 2.0 – Revised 09/05/13

3

Processing Swiped Transactions 1. Make your interface class implement the ePNSwiperDelegate protocol. 2. Create an ePNSwipeController object with the custom init method. Be sure to use the initWithInfo method because this is where you set your account number and Restrict key. Important Note: The implementation class that initializes the ePNSwipeController object MUST be Objective C++ Source file type. 3. Set the delegate for the ‘imagpro’ property so that your class can receive the swiper events. 4. Implement the delegate methods:

-(void)deviceConnected:(ePNSwipeDevice *)sender  This method is called when a reader is inserted into the audio jack. Here you can perform actions such as notifying the user that a reader is connected. -(void)deviceDisconnected:(ePNSwipeDevice *)sender.  This method is called when a reader is removed from the audio jack. -(NSString*)didReceiveSwipe:(NSString *)response from:(ePNSwipeDevice *)sender  When a card is swiped, it will return a comma separated string that will include the first name, last name, last four of the credit card and the expiration date.  Sample response: John,Doe,X1234,10/15 -(NSString*)postTransaction:(NSString *)response from:(ePNSwipeDevice *)sender  This method returns the transaction response as a string. (See Response Values)  This method will automatically post a transaction using the card data that is received from the reader, the ePNAccount and Restrict key that was set when you initialized the ePNSwipeController object, and an amount. You must set the amount using ePNSwipeController:setAmount before swiping a card. (The following fields are all required for a swiped transaction)

Table 1

Field

Description

ePNAccount

The user’s eProcessingNetwork account number. The restrict key assigned to the user’s eProcessingNetwork account number. Total amount of the transaction. i.e. “12.34” (Do not include currency symbols or commas.)

RestrictKey Total

Processing Keyed Transactions 1. Create an ePNKeyed object. You can use either the default init method or the custom initWithCardData to set all of the required fields when the object is created. 2. If you did not use the custom initWithCardData to initialize your ePNKeyed object, then you must set all of the required properties using accessor methods. (i.e. [keyedObject setCardNum:1234]);

iOS SDK Developer’s Guide - Version 2.0 – Revised 09/05/13

4

3. Set required and optional fields and properties to post with the transaction. (See table 2) 4. When you are ready to submit a transaction, call the ePNKeyed object’s postKeyedTransaction method and pass in your ePNAccount number and restrict key 5. The string that is returned will be the response from posting the transaction. (See Response Values section) (Shaded rows indicate required fields)

Field Name

Table 2

Description

Required Fields (The following fields are required to process a keyed sale)

ePNAccount

The user’s eProcessingNetwork account number.

RestrictKey

The restrict key assigned to the user’s eProcessingNetwork account number. Total amount of the transaction. i.e. “12.34” (Do not include currency symbols or commas.

Total CardNo

The credit card number.

ExpMonth

The 2-digit credit card expiration month, 01 through 12.

ExpYear

The 2-digit credit card expiration year. i.e. “16” for 2016.

Address

The street address on file with the cardholder’s issuing bank (for AVS).

Zip

The zip code on file with the cardholder’s issuing bank.

CVV2

The Card Security Code on the back of the credit card.

Optional Fields (The following fields are optional to process a keyed transaction)

Company

Cardholder's company name.

First Name

Cardholder’s first name.

Last Name

Cardholder’s last name.

City

Cardholder's city.

State

The 2-character state code of cardholder's state.

Phone

Contact phone number for the transaction. If a valid email address is submitted, an email with the summary of the transaction will be emailed to the cardholder.

Email Invoice Number Description

May be up to 8 digits. Description for the transaction, such as an ordered item description.

iOS SDK Developer’s Guide - Version 2.0 – Revised 09/05/13

5

Response Values The response will be formatted as three quoted, comma-delimited strings. The first string always starts with a Y (Yes, approved), an N (No, declined) or a U (No, unable), and is followed by up to 16 characters describing the transaction response. The second string is the Address Verification Systems' response to the street address and Zip code supplied. The third string is the CVV2 systems' response to the CVV2 information supplied. The following example shows a typical approval response: "YAPPROVED 184752","AVS Match 9 Digit Zip and Address (X)","CVV2 Match (M)","23","20080828140719-080880-23" Depending on the result, the TDBE returns one or more strings. The following table (table 2) describes the response fields: Table 2

String

Value

Description

1

Transaction Response

The approval response. The response starts with one of the following 1-character indicating the success of the transaction: Y - Approved N - Declined U - Unable to perform transaction The 1-character response is followed by up to 16 characters explaining the response, for example: APPROVED 123456

2

AVS Response The AVS response returned by the issuing bank.

3

CVV2 Response

4

Invoice Number

5

The CVV2 response returned by the issuing bank. This value is only returned if CVV2 is used

Invoice number for the transaction. This value is only returned if you submit the Inv field.

Transaction ID The transaction ID (TransID) that identifies this transaction. The format for the TransID value is: timestamp-account number-invoice number Some transaction IDs includes a fourth value: -0 for declines; -6 for checks; -5 for voids. This value is only returned if you submit the Inv field in the request.

iOS SDK Developer’s Guide - Version 2.0 – Revised 09/05/13

6

End of Document

iOS SDK Developer’s Guide - Version 2.0 – Revised 09/05/13

7