Beruflich Dokumente
Kultur Dokumente
P AYMENTS SDK
D EVELOPER S G UIDE
March 2015
Version 1.2.0
Chase Mobile Payments SDK
Version 1.2.0
March 2015
Copyright 2015 Chase Paymentech Solutions, LLC. All rights reserved.
Not for Disclosure outside Chase Paymentech Solutions, L.L.C. or its customers.
This publication is for information purposes only, and its content does not represent a contract in any form.
Furthermore, this publication shall not be deemed to be a warranty of any kind, either express or implied.
Chase Paymentech expressly disclaims, and you expressly waive, any and all warranties, including without
limitation those of merchantability and fitness for a particular purpose. Chase Paymentech reserves the right
to alter product specifications without notice. No part of this publication may be reproduced or transmitted in
any form or by any means, electronic or mechanical, including photocopy, recording, or any information
storage or retrieval system, without Chase Paymentech's permission.
All brand names and product names used in this document are trade names, service marks, or registered
trademarks of their respective owners.
1.1.0 10.20.2014 Ent. Product General Updates; Removal of Recurring, Level 2 and Order
Notification Classes.
Table of Contents
Chapter 1 Overview ...........................................................................................................5
1.1 System Requirements/Environment Setup ................................................................ 6
1.2 Adding the Framework to an App ............................................................................ 6
Chapter 2 Chase Mobile Payments Framework ..............................................................9
2.1 CPSGateway Class ................................................................................................. 9
2.2 CPSAuthorizationRequest Class ............................................................................. 16
2.2.1 CPSAddress Class ........................................................................................... 23
2.2.1.1 CPSBillingAddress Class ............................................................................. 25
2.2.1.2 CPSShippingAddress Class.......................................................................... 26
2.2.2 CPSAudit Class............................................................................................... 28
2.2.3 CPSReceiptRequest Class ................................................................................ 30
2.3 CPSAuthorizationResponse Class ........................................................................... 32
2.3.1 CPSResponseCode Class ................................................................................. 36
2.3.2 CPSEnhancedAuth Class .................................................................................. 38
2.4 CPSDecryptionRequest Class ................................................................................ 40
Appendix A Error Code List ............................................................................................42
A.1 Error Codes ........................................................................................................ 42
Chapter 1 Overview
The Chase Mobile Payments SDK is used to perform cardholder authenticated credit card
transactions. It assembles payment data received from the hosting Merchant Application and
sends it to the Chase Paymentech Orbital SOAP Service in JSON format.
Data sent to our SOAP service is validated, disassembled, and processed by existing Chase
Paymentech services in order to facilitate authenticated card authorizations, as depicted in the
diagram below.
Data formatted by the handset wallet (iOS Passkit) is passed through the hosting Merchant
Application unchanged when the hosting Merchant Application calls the payment function exposed
by the Chase Mobile Payments SDK. The data is formatted in an encrypted payment bundle.
Using a private and public key infrastructure (PKI), Chase Paymentech is able to authenticate each
incoming request prior to authorization.
Xcode:
1. Xcode Project Build Settings
a. Base SDK : iOS 8.0 or above
b. Deployment Target Settings : iOS 8.0 or above
2. Applications can be developed using Objective-C and Swift using this framework.
3. Simulator/Device OS : iOS 8.0 or above
3. Click on Add Other and choose ChasePaymentech.framework from the physical location
in step 1.
Objective-C:
#import <ChasePaymentech/ChasePaymentech.h>
Swift:
import ChasePaymentech
Key Classes
CPSGateway
CPSAuthorizationRequest
CPSAuthorizationResponse
CPSDecryptionRequest
Request Classes
CPSAddress
CPSBillingAddress
CPSShippingAddress
CPSAudit
CPSReceiptRequest
Response Classes
CPSResponseCode
CPSEnhancedAuth
Overview
The CPSGateway class provides methods to execute and authorize a credit card transaction.
formatPaymentWithRequest
o This method prepares a JSON formatted request to the Gateway and returns it to the
calling application for processing. Use of this method requires the merchant to
perform some server side processing. Merchants may decide to use this method to
exercise more control over transaction processing but will need to pass the JSON
request to the Gateway at the server side. Parameters required by the Gateway must
be populated and validated using the CPSAuthorizationRequest objects validate
method and this object is used by the formatPaymentWithRequest to construct the
data in the format required by the Gateway to complete the transaction
o This method is synchronous and returns a NSData * containing the formatted JSON
request. This NSData * should then be passed to the merchant server side
application for aggregation and posting to the Gateway for authorization.
formatDecryptionRequestWithRequest
o This method prepares an encrypted XML request to be used at the merchants server
side application in order to decrypt an Apple Pay transaction via the Chase
Paymentech Gateways XML interface.
o Clients invoke this synchronous method on the application layer, passing in a
CPSAuthorizationRequest. The method returns data that the application then passes
to the merchant server side for passage to the Gateway. The In-App Debundle
Service Developers Guide details the usage at the server side in the SDK Mode
section.
Note: For development and testing, the test property should be set to YES. When set to YES,
authorizePaymentWithRequest method will send transaction requests to the Gateway Test
environment. This test environment will not relay transactions to the credit card networks and will
simulate responses based on transaction amounts, eg: $5.00 authorizations will always result in an
approval due to the even dollar amount.
Error Handling
The framework validates errors by validating the property values set in the
CPSAuthorizationRequest object, network connectivity and HTTP Status Codes returned by the
Gateway Server. Such errors are returned as part the completionHandler set by the
authorizePaymentWithReqeust method.
Tasks
Authorize a Payment
- authorizePaymentWithRequest: request withCompletionHandler:completionHandler
Properties
test
This allows the SDK to point to either the Production or Test environment. This property is set to
True by default.
Instance Methods
authorizePaymentWithRequest
This authorizes credit cards by formatting and sending transaction requests to the Gateway. The
completionHandler block returns the CPSAuthorizationResponse and the NSError object.
The purpose of NSError object is to capture all errors before the transaction. Some of the errors
returned are connectivity errors and HTTP errors.
- (void)authorizePaymentWithRequest:(CPSAuthorizationRequest *)request
withCompletionHandler:(CPSAuthorizationCompletionHandler)completionHandler;
Parameters
request
Filled and validated CPSAuthorizationRequest object is passed to perform credit card
authorizations.
completionHandler
Block handling operation completion. The block returns the CPSAuthorizationResponse
object as a parameter. The CPSAuthorizationRequest object contains the Gateway response. If
this object is nil, an error condition is indicated and the application should check the NSError object
for the Error Code and Error Message. The NSError object will be nil if a valid Gateway transaction
occurs. See topics, Valid Transaction and Responses, Error handling.
Return Value
void
formatDecryptionRequestWithRequest
This prepares a decryption request for credit cards by formatting transaction requests for the
Gateway. The method returns a formatted and encrypted request as an object containing
encrypted and base64 encoded authorization datato be used in merchant server side processing.
- (CPSDecryptionRequest *)formatDecryptionRequestWithRequest:(CPSAuthorizationRequest
*)request error:(NSError * __autoreleasing *)error;
Parameters
request
Filled and validated CPSAuthorizationRequest object is passed to perform credit card
authorizations.
error
A pointer to a pointer containing an error object that's owned by the caller. If the return value is
false, error will contain an NSError object. Otherwise, it will be nil.
Return Value
CPSDecryptionRequest *
An object containing an encrypted and base64 encoded request. This may be passed to the
merchants server side application and then forwarded to the Gateway for decryption over the XML
interface.
Refer to the In-App Debundle Service Developers Guide for details concerning POSTing to the XML
service in SDK Mode.
formatPaymentWithRequest
This prepares an authorization for credit cards by formatting transaction requests for the Gateway.
The method returns a formatted JSON request as a NSData * to be used in merchant server side
processing.
Parameters
request
Filled and validated CPSAuthorizationRequest object is passed to perform credit card
authorizations.
error
A pointer to a pointer containing an error object that's owned by the caller. If the return value is
false, error will contain an NSError object. Otherwise, it will be nil.
Return Value
NSData *
A formatted JSON request. This may be passed to the merchants server side application and then
forwarded to the Gateway for authorization.
At the server side POST the JSON to the Gateway URLs below. The server will process the request
and return a JSON response. Note that for an authorization only POST to /auth and for an
authorization with sale POST to /authcap
Production URL
https://mobileservices.chasepaymentech.com/gateway/1/order/creditcard/auth
https://mobileservices.chasepaymentech.com/gateway/1/order/creditcard/authcap
Test URL
https://mobileservices-uat.chasepaymentech.com/gateway/1/order/creditcard/auth
https://mobileservices-uat.chasepaymentech.com/gateway/1/order/creditcard/authcap
{
"discountAmount" : "500",
"billAddress" : {
"city" : "Tampa",
"phone" : "1112223456",
"countryCode" : "11",
"phoneType" : "D",
"state" : "FL",
"address2" : "addressTwo",
"zip" : "33333",
"address1" : "addressOne"
},
"level2" : {
"pcardDestinationZip" : "33624",
"pcardPurchaseOrder" : "123456789"
},
"taxAmount" : "70",
"encryptedPaymentBundle" : {
"header" : {
"publicKeyHash" : "dxCK7GDzZd3JocWOla8OtUeLJ7tf+OHLFAi9heOMb6o=",
"applicationData" : "94ee059335e587e501cc4bf90613e0814f00a7b08bc7c64c2",
"ephemeralPublicKey" : "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE",
"transactionId" : "c1caf5ae72f0039a82bad9dcb60a795"
},
"data" : "f6TlGdkXa3UIuTQe8gahT20vTnT",
"version" : "EC_v1"
},
"orderId" : "2277",
"tipAmount" : "20",
"orderNotifications" : {
"items" : [
{
"name" : "Baseball glove",
"totalAmount" : "0",
"price" : "1999",
"quantity" : "0"
}
],
"taxes" : [
{
"percentage" : "0",
"name" : "FL state sales tax",
"amount" : "140"
}
]
},
"merchantId" : "com.paymentech",
"audit" : {
"latitudeLongitude" : "1,1",
"softwareID" : "TEST"
},
"comments" : "a comment",
"surchargeAmount" : "1000",
"sendReceipt" : {
"custReceiptPhone" : "813-123-4567",
"custReceiptEmail" : "developer@chasepaymentech.com"
},
"shipAddress" : {
"city" : "Tampa",
"phone" : "9998881234",
"countryCode" : "11",
"phoneType" : "H",
"state" : "FL",
"address2" : "addressTwo",
"zip" : "44444",
"shippingMethod" : "G",
"address1" : "addressOne"
}
}
{
cardBrand = VI;
enhancedAuth = {
};
hash1 = 3adfe2a59aeede7b3d090c3b2293bb1e07c79e8015da69372c1d3d55078de29b;
hash2 = a46014f1e3a3018d44e5c5eecb80a7027cf8bce743eec713d7d8fe89fbf3778c;
lastFourDPAN = 0839;
orderId = 3932;
responseCode = {
approvalStatus = 0;
authorizationCode = "";
avsRespCode = " ";
hostAvsRespCode = "";
hostResponseCode = 05;
mcRecurringAdvCode = "";
procStatus = 0;
respCode = 05;
respCodeMessage = "Do Not Honor";
visaVbVRespCode = "";
};
txRefNum = 54F60B76A36286AAD26E7F837BF2E3AD9AF65322;
}
Overview
The CPSAuthorizationRequest class holds all parameters that can be sent to the Gateway using the
CPSGateway object. The CPSAuthorizationRequest class also provides methods to validate all
parameters before submitting it to the CPSGateway object.
Tasks
orderId property
merchantId property
discountAmount property
tipAmount property
taxAmount property
surchargeAmount property
comments property
cardIndicators property
partialAuthInd property
audit property
paymentData property
sendReceipt property
shipAddress property
billingAddress property
capture property
Properties
orderId
This is a unique identification value of an order that is generated by the hosting application. For a
single order, there could be one or more transaction reference numbers associated due to partial
approvals.
merchantId
This is an optional merchant ID which may be used to process a transaction on another merchant
ID setup for transaction processing. The merchantId can be used in a multi-merchant chain setup
and is subject to validation checks at the Gateway.
discountAmount
tipAmount
The tipAmount is represented in the lowest denomination of its currency. For example, cents is the
lowest denomination for USD. By default the value is initialized to NSUIntegerMax and is
considered optional. See validate method reference for more details.
taxAmount
Order level Tax. The taxAmount is represented in the lowest denomination of its currency. For
example, cents is the lowest denomination for USD. By default the value is initialized to
NSUIntegerMax and is considered optional. See validate method reference for more details.
surchargeAmount
The surchargeAmount is represented in the lowest denomination of its currency. For example,
cents is the lowest denomination for USD. By default the value is initialized to NSUIntegerMax and
is considered optional. See validate method reference for more details.
Note: The sum of discountAmount, tipAmount, taxAmount and surchargeAmount cannot be greater
than the total transaction amount. This validation will not be performed by the validate method
since the transaction amount is part of the paymentData object. The host application is expected
to perform this validation. The Gateway may return an error if the validation fails.
comments
A short comment associated with the transaction.
cardIndicators
The cardIndicators returns extra data containing the issuer characteristics of the card
@property (nonatomic) CPSCardIndicatorscardIndicators;
CPSCardIndicators Description
Enumeration
CPSCardIndicatorsNone By default, this value is set during object initialization. This value will
not be sent to Gateway and is considered optional.
CPSCardIndicatorsYes Set this value to get enhanced card data as part of response from the
Gateway.
CPSCardIndicatorsNo Set this value to ignore enhanced card data as part of response from
the Gateway.
partialAuthInd
The partialAuthIndproperty is used to indicate to the card issuer if the host application can support
logic to perform and manage a partial approval response. In the case of a partial approval,
business logic must be in place in the host application to determine what action should be taken
with the balance owing.
CPSPartialAuthIndEnumeration Description
audit
The audit property is used by the Gateway to validate the authenticity of the transaction for its
approval. Vendor ID and Software ID may be provided as part of the Tampa (PNS) host
certification process. See CPSAudit class reference for more details. Geo-coordinates can be sent
to the gateway as an optional value for validation.
paymentData
This is encrypted payment data received from the iOS Passkit. The data received from iOS will be
in JSON format and is set to the paymentData property for the Gateway to parse and use for the
credit card authorization request. This object is mandatory to submit a transaction request and
should be passed in the initWithPaymentData method.
sendReceipt
Use this property to send a customer receipt by email or text message. This property is optional.
See the CPSReceiptRequest class reference for more details.
shipAddress
Shipping address for the order. See CPSShippingAddress class for more details.
billingAddress
Billing address of the card used for the transaction. This address can also be used to perform an
address verification request as part of the authorization. Sending the billing zip/postal code may
qualify the transaction for a lower interchange rate.
See CPSBillingAddress class for more details.
capture
Set the capture property to YES to indicate that the Gateway should authorize and capture the
transaction amount for settlement. Set this property to NO to indicate an authorization only
request. Authorize only is typically used when future order fulfillment is required.
Value
YES The Gateway is expected to perform authorization and capture the transaction amount.
NO The Gateway is expected only to only authorize funds from the cards open-to-buy.
Instance Methods
initWithPaymentData
Initializes request properties with default values. The orderId, audit and paymentData properties
are mandatory for the Gateway to process a transaction.
- (instancetype)initWithPaymentData:(NSData *)paymentData
NS_DESIGNATED_INITIALIZER;
validate
Validates all request properties and returns list of errors in an NSArray containing NSError objects.
If a property does not validate, then the related error code and error message is added as a
NSError object.
- (NSArray *)validate;
Overview
The CPSAddress class has properties to store postal address and phone number. The
CPSBillingAddress and the CPSShippingAddress classes inherit CPSAddress.
name
Name associated with this address.
addressOne
Frist line of the street address.
addressTwo
Second line of the street address.
city
City name of this address.
state
Two character state code. Example: NY for New York.
postalCode
ZIP (for USA) or Postal Code (for Canada) associated with this address. The host application is
expected to validate ZIP/Postal Code for its format.
For USA the zip code can be 5 digits or 9 digits. Examples: 12345 or 12345-6789.
For Canada, the postal code should be 6 characters in letter-number format. Example: Z1Z1Z1
countryCode
County code associated with this address. US for United States of America, CA for Canada.
phoneNumber
Phone number associated with this address.
Adopted Protocol
NSCopying
copyWithZone:
Property
phoneType
Type of phone number.
CPSPhoneTypeEnumeration Description
Adopted Protocol
NSCopying
copyWithZone:
Properties
phoneType
Phone type of the phone number provided in phoneNumber property of CPSAddress object.
shippingMethod
The CPSAudit class is mandatory for the Gateway to validate the transaction.
Adopted Protocol
NSCopying
copyWithZone:
Tasks
Properties
vendorID
Refer to the certification team for details on the vendor Id.
softwareID
Refer to the certification team for details on software Id.
Location
Optionally send the geo-coordinates to have the services validate the location.
Overview
Adopted Protocol
NSCopying
copyWithZone:
Tasks
Properties
customerReceiptEmail
Destination email address for an email customer transaction receipt.
customerReceiptPhone
Destination phone number for an SMS customer transaction notification.
Overview
The CPSAuthorizationResponse class holds all response parameters that are received from the
Gateway using the CPSGateway object.
Tasks
procStatus property
procStatusMessage property
approvalStatus property
respCode property
respCodeMessage property
hostResponseCode property
hostResponseCodeMessage property
avsRespCode property
hostAvsRespCode property
remainingBalance property
requestedAmount property
redeemedAmount property
partialAuthOccurred property
approvalStatus property
genericRespCode property
genericRespMessage property
genericRespCode property
tknAssuranceLevel property
enhancedAuth property
txRefNum
A unique reference number assigned by the Gateway to identify the transaction.
remainingBalance
Remaining balance available on the card optionally returned by the card issuer.
requestedAmount
The amount requested from the paymentData for authorization or capture of the transaction.
redeemedAmount
This is the amount taken away from the cards open-to-buy. This should match the requested
amount unless a partial authorization has occurred.
partialAuthOccurred
This indicates whether or not a partial authorization has occurred.
authorizationCode
This returns the issuer approval code for an authorization request.
visaVBVRespCode
This returns Visas verified by Visa response code.
procStatus
This returns the Gateway processing status code. A value of zero means there were no gateway
errors on the transaction.
procStatusMessage
This returns the verbose processing status message.
approvalStatus
This returns the issuer approval status.
respCode
This returns the Gateway response code.
respCodeMessage
This is the verbose Gateway response message.
hostResonseCode
This returns the host (PNS or Stratus) response code.
hostResponseCodeMessage
This returns the verbose host (PNS or Stratus) response message.
avsRespCode
This returns the gateway address verification response code.
hostAvsRespCode
This returns the host address verification response code.
tknAssuranceLevel
enhancedAuth
Overview
Tasks
Properties
authorizationCode
visaVbVRespCode
procStatus
procStatusMessage
approvalStatus
respCode
respCodeMessage
hostRespCode
avsRespCode
hostAVSRespCode
genericRespCode
genericRespMessage
tknAssuranceLevel
Adopted Protocol
NSCopying
copyWithZone:
Tasks
Properties
ctiAffluentCard
ctiCommercialCard
ctiDurbinExemption
ctiHealthcareCard
ctiLevel3Eligible
ctiPayrollCard
ctiPrepaidCard
ctiPINlessDebitCard
ctiSignatureDebitCard
ctiIssuingCountry
ctiDurbinExcemption
Overview
The CPSDecryptionRequest class defines the object returned by the CPSGateways
formatDecryptionReq uestWithRequest method. The object contains NSString properties that can
be passed to the merchants server side application tier for passage to the Gateways decryption
service on the XML interface.
Properties
encryptedData property
encryptedKey property
format property
latitudeLongitude property
Properties
encryptedData
This property contains base64 encoded encrypted data.
encryptedKey
This is an optional encrypted key and is currently not implemented. However for future
compatibility this value should be passed to the Gateways XML interface as-is.
format
This is the data and encryption type specifier. Pass to the Gateways XML interface as-is.
latitudeLongitude
typedefNS_ENUM(NSUInteger, CPSAuthorizationError) {
CPSAuthorizationErrorAuditMandatory,
};
typedefNS_ENUM(NSUInteger, CPSAuditError) {
CPSAuditErrorLatitudeLongitudeMandatory=5014,
CPSAuditErrorLatitudeLongitudeOutOfRange,
CPSAuditErrorInvalidObject
};
typedefNS_ENUM(NSUInteger, CPSReceiptError) {
CPSReceiptErrorNullEmailId=5020,
CPSReceiptErrorEmailFormatInvalid,
CPSReceiptErrorEmailEmailIdOutOfRange,
CPSReceiptErrorNullPhoneNumber,
CPSReceiptErrorInvalidPhoneNumber,
CPSReceiptErrorPhoneNumberOutOfRange,
CPSReceiptErrorInvalidObject
};
typedefNS_ENUM(NSUInteger, CPSShippingAddressError) {
CPSShippingAddressNameOutOfRange=5055,
CPSShippingAddressOneOutOfRange,
CPSShippingAddressTwoOutOfRange,
CPSShippingAddressCityOutOfRange,
CPSShippingAddressStateOutOfRange,
CPSShippingAddressPostalCodeNull,
CPSShippingAddressPostalCodeOutOfRange,
CPSShippingAddressCountryCodeOutOfRange,
CPSShippingAddressInvalidPhoneNumberFormat,
CPSShippingAddressPhoneNumberOutOfRange,
CPSShippingAddressPhoneTypeOutOfRange,
CPSShippingAddressShippingMethodOutOfRange,
CPSShippingAddressErrorInvalidObject
};
typedefNS_ENUM(NSUInteger, CPSBillingAddressError) {
CPSBillingAddressNameOutOfRange=5068,
CPSBillingAddressOneOutOfRange,
CPSBillingAddressTwoOutOfRange,
CPSBillingAddressCityOutOfRange,
CPSBillingAddressStateOutOfRange,
CPSBillingAddressPostalCodeNull,
CPSBillingAddressPostalCodeOutOfRange,
CPSBillingAddressCountryCodeOutOfRange,
CPSBillingAddressInvalidPhoneNumberFormat,
CPSBillingAddressPhoneNumberOutOfRange,
CPSBillingAddressPhoneTypeOutOfRange,
CPSBillingAddressErrorInvalidObject
};
typedefNS_ENUM(NSUInteger, CPSError) {
CPSErrorValidationFailed,
CPSErrorParserFailed,
CPSErrorSSLFailed,
CPSErrorConnectivityNotAvailable
};