Skip to content

nab-velocity/ios-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

IOS-sdk

This is the velocity IOS SDK implementation.
It has the implementation of all the transaction payment solution methods for a merchant application who wants to access the Velocity payment gateway.

At the center of this SDK, there is the class VelocityProcessor.

The signature for initialising this class is as below:

- (VelocityProcessor *) initWith:(NSString *)identityToken forAppProfileId:(NSString *)appProfileId forMerchantProfileId:(NSString *)merchantProfileId forWorkflowId:(NSString *)workflowId andSessionToken:(NSString *)sessiontoken andType:(BOOL )isTestAccount;

@parameter sessionToken - initialises the value for session token.
@parameter identityToken - initialises the value for identity token.
@parameter appProfileId - initialises the value for application profile Id.
@parameter merchantProfileId - initialises the value for merchant profile Id.
@parameter workFlowId - initializes the value for workflow Id.
@parameter isTestAccount - works as a flag for the TestAccount.

Used in Sample App as

velocityProcessorObj= [[VelocityProcessor alloc] initWith:kIdentityToken forAppProfileId:kAppProfileId forMerchantProfileId:kMerchantProfileId forWorkflowId:KWorkflowId andSessionToken:nil andType:kisTestAccountBOOL ];

1. VelocityProcessor


This class provides the implementation of the following methods:
1. createCardToken;
2. authorise;
3. authorizeAndCapture;
4. capture;
5. undo;
6. adjust;
7. returnById;
8.returnUnlinked;
9.queryTransactionsDetail;
10.captureAll;

The class also provides delegate for conveying success and error response

VelocityProcessor Delegates


1.-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; //delegate method for successful transaction
2.-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny; //delegate method for Failed transaction

1. createCardToken(....)


The method is responsible for the invocation of verify operation on the Velocity REST server.
velocityPaymentTransaction Modal Class - holds the values for the verify request VelocityPaymentTransaction
           		1.cardType - String     <br/>
		2.cardholderName - String     <br/>
           		3.panNumber-String   <br/>
    		4.expiryDate - String   <br/>
		5.street - String   <br/>
           		6.stateProvince - String     <br/>
           		7.postalCode - String   <br/>
           		8.phone - String    <br/>
		9.state - String     <br/>
           		10.cvDataProvided - String    <br/>
           		11.cVData - String   <br/>
       		12.amount - String       <br/>
           		13.currencyCode - String       <br/> 
           		14.customerPresent - String     <br/>
           		15.employeeId - String     <br/>
           		16.entryMode - String      <br/>
           		17.industryType - String   <br/>
           		18.email - String   <br/>
           		19.transactionDateTime - String   <br/>
           		20.city -String <br/>

How to set the Ui value on VelocityPaymentTransaction model


Sample code
    VelocityPaymentTransaction *vPTMCObj;  //velocityProcessorTransactionModelClass Object
    vPTMCObj=[PaymentObjecthandler getModelObject];  //method to initialize the modal class object
    vPTMCObj.transactionName = [self.transactionTypebtn titleForState:UIControlStateNormal];
    vPTMCObj.state = [self.stateBtn titleForState:UIControlStateNormal]; 
    vPTMCObj.country = self.countryTxtField.text; 
    vPTMCObj.cardType = [self.cardTypeBtn titleForState:UIControlStateNormal]; 
    vPTMCObj.cardholderName = self.nameTxtField.text; 
    vPTMCObj.panNumber=self.creditCardNotxtField.text; 
    vPTMCObj.expiryDate = [self.monthTextField.text stringByAppendingString:self.yearTextField.text]; 
    vPTMCObj.street = self.streetTxtField.text; 
    vPTMCObj.city = self.cityTxtField.text; 
    vPTMCObj.stateProvince = [self.stateBtn titleForState:UIControlStateNormal]; 
    vPTMCObj.accountType=@"NotSet";
    vPTMCObj.postalCode = self.zipTxtField.text; 
    vPTMCObj.phone= self.phoneTxtField.text; 
    vPTMCObj.cvDataProvided = @"Provided";
    vPTMCObj.cVData = self.cVCtxtField.text; 
    vPTMCObj.amount = self.testCashTxtField.text; 
    vPTMCObj.currencyCode = self.currencyCodeTxtField.text; 
    vPTMCObj.customerPresent = @"Present";
    vPTMCObj.employeeId = self.customerIDtxtField.text; 
    vPTMCObj.entryMode = @"Keyed";
    vPTMCObj.industryType = @"Ecommerce";
    vPTMCObj.email = self.emailTxtField.text; 
    vPTMCObj.countryCode = @"USA";
    vPTMCObj.transactionDateTime=@"2013-04-03T13:50:16";
    [PaymentObjecthandler setModelObject:vPTMCObj]; //method which sets value into modal class<br/>

1.Request a [velocityProcessorObj createCardToken];method from API .
initialize response view class to store values in its variable
make property of VelocityResponase class

@property (strong, nonatomic) VelocityResponse *_txRespons_obj;<br/>

initialize the object

self._txRespons_obj = [VelocityResponseObjectHandlers getModelObject];<br/>

2.Get the success or Error response from API.

2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
  
 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny;</b><br/>

//Here get the Success status then show the corresponding message.
if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[BankcardTransactionResponsePro class]]&& 	
__txRespons_obj.status!=nil ) { 
//initialise VelocityPaymentTransactionModalClass object
VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];
//set value of payment account data token for transaction with token methos
 obj.paymentAccountDataToken = self._txRespons_obj.paymentAccountDataToken;
				}

1.2 authorise(...);


The method is responsible for the invocation of authorise operation on the Velocity REST server.
<h2>1.2.1 authoriseWithToken();</h2><br/>
<b>[velocityProcessorObj authorise];</b><br/>
The method is responsible for the invocation of authorise operation with token on the Velocity REST server.<br/>
for this you have to make pass the payment account data token to the library 

<h2>1.2.2 authoriseWithoutToken();</h2><br/>
<b>[velocityProcessorObj authorise];</b><br/>
The method is responsible for the invocation of authorise operation without token on the Velocity REST server. this will be called only when payment account data token is null and card data should be present.<br/>
<h2>1.2.3 authoriseP2PE();</h2><br/>
The method is responsible for the invocation of authorise operation without token and with encrypted card data on the Velocity REST server. this will be called only when payment account data token is null and card data should be present.<br/>

Values are set from modal class velocityPaymentTransaction - holds the values for the authorize request VelocityPaymentTransaction
1.cardType - String
2.cardholderName - String
3.panNumber-String
//require for without token operation 4.expiryDate - String
//require for without token operation 5.street - String
6.stateProvince - String
7.postalCode - String

8.phone - String
9.state - String
10.cvDataProvided - String
11.cVData - String
//require for without token operation 12.reportingDataReference String
13.transactionDataReference String
14.amount - String
15.currencyCode - String
16.customerPresent - String
17. partialShipment - boolean
18.signatureCaptured - boolean
19.quasiCash - boolean
20.email - String
21.transactionDateTime - String
22.city -String
23.partialApprovalCapable-String
24.country - String
25.tipAmount - String
26.employeeId - String
27.entryMode - String
28.industryType - String
29.countryCode - String
30.businnessName - String
31.comment - String
32.description - String
33.paymentAccountDataToken - String
//required for with token operation 34.cashBackAmount - String
35.goodsType - String
36.invoiceNumber - String
37.orderNumber - String
38.FeeAmount - String
39.securePaymentAccountData - String
//require for P2PE operation 40.encryptionKeyId - String
//require for P2PE operation 41.swipeStatus - String
//require for P2PE operation .if not available make it null.

How to set the Ui value on VelocityPaymentTransaction model


Sample code
VelocityPaymentTransaction *vPTMCObj;		 //velocityProcessorTransactionModelClass Object
vPTMCObj=[PaymentObjecthandler getModelObject];	//method to initialize the modal class object
vPTMCObj.transactionName = [self.transactionTypebtn titleForState:UIControlStateNormal];
vPTMCObj.state = [self.stateBtn titleForState:UIControlStateNormal]; 
vPTMCObj.country = self.countryTxtField.text; 
vPTMCObj.amountforadjust = self.testCashAdjustTxtFeild.text; 
vPTMCObj.cardType = [self.cardTypeBtn titleForState:UIControlStateNormal]; 
vPTMCObj.cardholderName = self.nameTxtField.text; 
vPTMCObj.panNumber=self.creditCardNotxtField.text; 
vPTMCObj.expiryDate = [self.monthTextField.text stringByAppendingString:self.yearTextField.text]; 
vPTMCObj.isNullable = false; 
vPTMCObj.street = self.streetTxtField.text; 
vPTMCObj.city = self.cityTxtField.text; 
vPTMCObj.stateProvince = [self.stateBtn titleForState:UIControlStateNormal];
vPTMCObj.accountType=@"NotSet";
vPTMCObj.postalCode = self.zipTxtField.text;
vPTMCObj.phone= self.phoneTxtField.text;
vPTMCObj.cvDataProvided = @"Provided";
vPTMCObj.cVData = self.cVCtxtField.text; 
vPTMCObj.amount = self.testCashTxtField.text; 
vPTMCObj.currencyCode = self.currencyCodeTxtField.text; 
vPTMCObj.customerPresent = @"Present";
vPTMCObj.employeeId = self.customerIDtxtField.text;
vPTMCObj.entryMode = @"Keyed";
vPTMCObj.industryType = @"Ecommerce";
vPTMCObj.email = self.emailTxtField.text;
vPTMCObj.countryCode = @"USA";
vPTMCObj.businnessName = @"MomCorp";
vPTMCObj.CustomerId = @"11";
vPTMCObj.comment = @"a test comment";
vPTMCObj.discription = @"a test description";
vPTMCObj.reportingDataReference = @"001";
vPTMCObj.transactionDataReference = @"xyt";
vPTMCObj.transactionDateTime=@"2013-04-03T13:50:16";
vPTMCObj.cashBackAmount = @"0.0";
vPTMCObj.goodsType = @"NotSet";
vPTMCObj.invoiceNumber = @"808";
vPTMCObj.orderNumber = @"629203";
vPTMCObj.FeeAmount = @"1000.05";
vPTMCObj.tipAmount = self.tipAmountTxtField.text;	//this amount is used for capture<br/>
vPTMCObj.keySerialNumber=@"";
vPTMCObj.securePaymentAccountData = _securePaymentAccountDataTextView.text;//for P2PE only, leave null string in case not P2PE
vPTMCObj.encryptionKeyId = _encryptionKeyIDTextView.text; //for P2PE only, leave null string in case not P2PE
vPTMCObj.swipeStatus = @""; //for P2PE only, leave null string in case not P2PE
vPTMCObj.isPartialShipment = false;
vPTMCObj.isSignatureCaptured = false; 
vPTMCObj.partialApprovalCapable = @"NotSet";
vPTMCObj.isQuasiCash=false; 
[PaymentObjecthandler setModelObject:vPTMCObj]; 

1.Request a authorize() method from API .

	[velocityProcessorObj authorise];  	//calling authwithtoken method
	----------------------------------
	vPTMCObj.paymentAccountDataToken = nil;  //calling authwithout token method
        	[velocityProcessorObj authorise];	
    	------------------------------------
    	vPTMCObj.paymentAccountDataToken = nil;  //calling P2PE  method
    	vPTMCObj.encryptionKeyId = _encryptionKeyIDTextView.text; //for P2PE only, leave null string in case not P2PE
	vPTMCObj.swipeStatus = @""; //for P2PE only, leave null string in case not P2PE
		vPTMCObj.securePaymentAccountData = _securePaymentAccountDataTextView.text;	//for P2PE only, leave null string in case not P2PE
        	[velocityProcessorObj authorise];
	-----------------------------------

if calling with token then have to set value for vPTMCobj.paymentaccountdDatatoken.
if calling without token fill the card data information. if calling P2PE securityaccount data token and encryption key id should be there.

2.Get the success or Error response from API.

2.1 -(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;

 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }

2.2 -(void)VelocityProcessorFinishedWithSuccess:(id )successAny;

//Here get the Success status then show the corresponding message.
if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[BankcardTransactionResponsePro class]]&& 	
__txRespons_obj.status!=nil ) { 
//Assign value for further transection data 
  
 VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];<br/>
	obj.transectionID=self._txRespons_obj.transactionId;   //set value for TransectionID<br/>
	obj.paymentAccountDataToken = self._txRespons_obj.paymentAccountDataToken; //set value for payentAccount data token<br/>
	obj.batchID =self._txRespons_obj.batchId; //set value for batchID<br/>
 	}

1.3 authAndCapture(...)


The method is responsible for the invocation of authorizeAndCapture operation on the Velocity REST server.
-(void)authorizeAndCapture;

Set paramets in the modal class velocityPaymentTransaction
1. cardType - String
2. cardholderName - String
3.panNumber-String
4.expiryDate - String
5.street - String
6. stateProvince - String
7.postalCode - String
8. phone - String
9. reportingDataReference String
10. transactionDataReference String
11. state - String
12. cvDataProvided - String
13.cVData - String
14. amount - String
15. currencyCode - String
16. customerPresent - String
17. employeeId - String
18. entryMode - String
19.industryType - String
20. email - String
21. transactionDateTime - String
22. city -String
23. partialShipment - boolean
24.country - String
25.signatureCaptured - boolean
26.tipAmount - String
27. quasiCash - boolean
28.partialApprovalCapable - String
29. countryCode - String
30. businnessName - String
31.comment - String
32.description - String
33.paymentAccountDataToken - String
34.cashBackAmount - String
35.goodsType - String
36.invoiceNumber - String
37.orderNumber - String
38.FeeAmount - String

How to set the Ui value on VelocityPaymentTransaction model


Sample code
VelocityPaymentTransaction *vPTMCObj;//velocityProcessorTransactionModelClass Object
	vPTMCObj=[PaymentObjecthandler getModelObject];//method to initialize the modal class object
	vPTMCObj.transactionName = [self.transactionTypebtn titleForState:UIControlStateNormal];
	vPTMCObj.state = [self.stateBtn titleForState:UIControlStateNormal]; 
	vPTMCObj.country = self.countryTxtField.text; 
	vPTMCObj.amountforadjust = self.testCashAdjustTxtFeild.text; 
	vPTMCObj.cardType = [self.cardTypeBtn titleForState:UIControlStateNormal]; 
	vPTMCObj.cardholderName = self.nameTxtField.text; 
	vPTMCObj.panNumber=self.creditCardNotxtField.text; 
vPTMCObj.expiryDate = [self.monthTextField.text stringByAppendingString:self.yearTextField.text]; 
vPTMCObj.isNullable = false; 
	vPTMCObj.street = self.streetTxtField.text; 
	vPTMCObj.city = self.cityTxtField.text; 
	vPTMCObj.stateProvince = [self.stateBtn titleForState:UIControlStateNormal];
	vPTMCObj.accountType=@"NotSet";
	vPTMCObj.postalCode = self.zipTxtField.text;
	vPTMCObj.phone= self.phoneTxtField.text;
	vPTMCObj.cvDataProvided = @"Provided";
	vPTMCObj.cVData = self.cVCtxtField.text; 
	vPTMCObj.amount = self.testCashTxtField.text; 
	vPTMCObj.currencyCode = self.currencyCodeTxtField.text; 
	vPTMCObj.customerPresent = @"Present";
	vPTMCObj.employeeId = self.customerIDtxtField.text;
	vPTMCObj.entryMode = @"Keyed";
	vPTMCObj.industryType = @"Ecommerce";
	vPTMCObj.email = self.emailTxtField.text;
	vPTMCObj.countryCode = @"USA";
	vPTMCObj.businnessName = @"MomCorp";
	vPTMCObj.CustomerId = @"11";
	vPTMCObj.comment = @"a test comment";
	vPTMCObj.discription = @"a test description";
	vPTMCObj.reportingDataReference = @"001";
	vPTMCObj.transactionDataReference = @"xyt";
	vPTMCObj.transactionDateTime=@"2013-04-03T13:50:16";
	vPTMCObj.cashBackAmount = @"0.0";
	vPTMCObj.goodsType = @"NotSet";
	vPTMCObj.invoiceNumber = @"808";
	vPTMCObj.orderNumber = @"629203";
	vPTMCObj.FeeAmount = @"1000.05";
	vPTMCObj.tipAmount = self.tipAmountTxtField.text;//this amount is used for capture<br/>
	vPTMCObj.securePaymentAccountData = @"";
	vPTMCObj.encryptionKeyId = @"";
	vPTMCObj.swipeStatus = @"";
	vPTMCObj.isPartialShipment = false;
	vPTMCObj.isSignatureCaptured = false; 
	vPTMCObj.partialApprovalCapable = @"NotSet";
  	vPTMCObj.isQuasiCash=false; 
	[PaymentObjecthandler setModelObject:vPTMCObj]; 

1.Request a AuthANdCapture() method from API .

[velocityProcessorObj authorizeAndCapture];   //calling with token 
------------------------------------
vPTMCObj.paymentAccountDataToken = nil;  //calling authwithout token method
[velocityProcessorObj authorizeAndCapture];    //calling without token
-------------------------------------
vPTMCObj.paymentAccountDataToken = nil;  //calling P2PE  method
    	vPTMCObj.encryptionKeyId = _encryptionKeyIDTextView.text; //for P2PE only, leave null string in case not P2PE
	vPTMCObj.swipeStatus = @""; //for P2PE only, leave null string in case not P2PE
		vPTMCObj.securePaymentAccountData = _securePaymentAccountDataTextView.text;	//for P2PE only, leave null string in case not P2PE
[velocityProcessorObj authorizeAndCapture];    //For P2PE

if calling with token then have to set value for vPTMCobj.paymentaccountdDatatoken.
Other wise have to fill the card data information for without token and secureaccount data token ,encryption key id for P2PE 2.Get the success or Error response from API.

2.1 -(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;

 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }

2.2 -(void)VelocityProcessorFinishedWithSuccess:(id )successAny;

//Here get the Success status then show the corresponding message.
        if (__txRespons_obj!=nil&&[self._txRespons_objisKindOfClass:[BancardCaptureResponseclass]]&&__txRespons_obj.status!  =nil){
//Assign value for further transection data 
  
 VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];<br/>
	obj.transectionID=self._txRespons_obj.transactionId;   //set value for TransectionID<br/>
	obj.paymentAccountDataToken = self._txRespons_obj.paymentAccountDataToken; //set value for payentAccount data token<br/>
	obj.batchID =self._txRespons_obj.batchId; //set value for batchID<br/>
 

				}

1.4 capture(...)


The method is responsible for the invocation of capture operation on the Velocity REST server.
[velocityProcessorObj capture];

How to set the Ui value on VelocityPaymentTransaction model


Sample code
    VelocityPaymentTransaction *vPTMCObj;//velocityProcessorTransactionModelClass Object
	vPTMCObj=[PaymentObjecthandler getModelObject];//method to initialize the modal class object
	vPTMCObj.amount = self.testCashTxtField.text; 
	vPTMCObj.tipAmount = self.tipAmountTxtField.text;//this amount is used for capture<br/>
	//transection id should be set in the sucess response of previous authorised method.
	[PaymentObjecthandler setModelObject:vPTMCObj]; 


   1.Request a capture() method from API .<br/> 
   [velocityProcessorObj capture];<br/>
   2.Get the success or Error response from API.<br/> 
   
2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
  
 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; </b><br/>
//Here get the Success status then show the corresponding message.
if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[BancardCaptureResponse 				  
	class]]&&__txRespons_obj.status!=nil){
 VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];<br/>
	obj.transectionID=self._txRespons_obj.transactionId;   //set value for TransectionID<br/>//save transection 				id       for void method,return by id and return unlinked method
				}

1.5 undo(...)


The method is responsible for the invocation of undo operation on the Velocity REST server.
-(void)undo;

How to set the Ui value on VelocityPaymentTransaction model


Value for trANSECTION ID is assigned from the privious sucess delegate method of velocity processor delegate

Sample code
1.Request a undo() method from API .
[velocityProcessorObj undo]; set the transection id 2.Get the success or Error response from API.

2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
  
 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; </b><br/>
//Here get the Success status then show the corresponding message.
if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[BankcardTransactionResponsePro class]]&& 	
__txRespons_obj.status!=nil ) { 
 VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];<br/>
	obj.transectionID=self._txRespons_obj.transactionId;   //set value for TransectionID<br/>//save transection 				id       for void method,return by id and return unlinked method
				}

1.6 adjust(...)


The method is responsible for the invocation of adjust operation on the Velocity REST server.
-(void)adjust;
              1.amountfordjust - String     <br/>
	  2.transactionId - String      <br/>

How to set the Ui value on VelocityPaymentTransaction model


Sample code
	    VelocityPaymentTransaction *vPTMCObj;//velocityProcessorTransactionModelClass Object<br/>
		vPTMCObj=[PaymentObjecthandler getModelObject];//method to initialize the modal class object<br/>
	    vPTMCObj.amountforadjust = self.testCashAdjustTxtFeild.text;<br/>
	
1.Request a adjust() method from API .<br/> 
   		[velocityProcessorObj adjust];<br/>
   2.Get the success or Error response from API.<br/> 
   
2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
  
 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; </b><br/>
//Here get the Success status then show the corresponding message.
if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[BankcardTransactionResponsePro class]]&& 	
__txRespons_obj.status!=nil ) { 
 VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];<br/>
	obj.transectionID=self._txRespons_obj.transactionId;   //set value for TransectionID<br/>//save transection 				id       for void method,return by id and return unlinked method
				}

1.7 returnById(...)


The method is responsible for the invocation of returnById operation on the Velocity REST server.
-(void)returnById;

Modal class velocityPaymentTransaction - holds the values for the returnById request VelocityPaymentTransaction
1. transactionId - String
2. amount - String

How to set the Ui value on VelocityPaymentTransaction model


Sample code
VelocityPaymentTransaction *vPTMCObj;//velocityProcessorTransactionModelClass Object vPTMCObj=[PaymentObjecthandler getModelObject];//method to initialize the modal class object vPTMCObj.amount = self.testCashTxtField.text; //take transection id prom previous capture method success delegate
   1.Request a returnById() method from API .<br/> 
    [velocityProcessorObj returnById];<br/>
   2.Get the success or Error response from API.<br/> 
   
2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
  
 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; </b><br/>
//Here get the Success status then show the corresponding message.
if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[BankcardTransactionResponsePro class]]&& 	
__txRespons_obj.status!=nil ) { 
 VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];<br/>
	obj.transectionID=self._txRespons_obj.transactionId;   //set value for TransectionID<br/>//save transection 				id for void method,return by id and return unlinked method
				}

1.8 returnUnLinked(...)


The method is responsible for the invocation of returnUnLinked operation on the Velocity REST server.
-(void)returnUnlinked;

Modal class velocityPaymentTransaction - holds the values for the returnUnlinked request VelocityPaymentTransaction
1. cardType - String
2. cardholderName - String
3. panNumber-String
4. expiryDate - String
5. street - String
6. stateProvince - String
7. postalCode - String
8. phone - String
9. reportingDataReference String
10. transactionDataReference String
11. state - String
12. cvDataProvided - String
13. amount - String
14. currencyCode - String
15. customerPresent - String
16. employeeId - String
17. entryMode - String
18. industryType - String
19. email - String
20. transactionDateTime - String
21. city -String
22. quasiCash - boolean
23. country - String
24. transactionId- String
25. signatureCaptured - boolean
26. partialShipment - boolean
27. countryCode - String
28. businnessName - String
29. comment - String
30. description - String
31. paymentAccountDataToken - String
32. cashBackAmount - String
33. goodsType - String
34.invoiceNumber - String
35.orderNumber - String
36. FeeAmount - String
37. tipAmount - String
38. partialApprovalCapable - String

How to set the Ui value on VelocityPaymentTransaction model


Sample code

    VelocityPaymentTransaction *vPTMCObj;//velocityProcessorTransactionModelClass Object
	vPTMCObj=[PaymentObjecthandler getModelObject];//method to initialize the modal class object
	vPTMCObj.transactionName = [self.transactionTypebtn titleForState:UIControlStateNormal];
	vPTMCObj.state = [self.stateBtn titleForState:UIControlStateNormal]; 
	vPTMCObj.country = self.countryTxtField.text; 
	vPTMCObj.amountforadjust = self.testCashAdjustTxtFeild.text; 
	vPTMCObj.cardType = [self.cardTypeBtn titleForState:UIControlStateNormal]; 
	vPTMCObj.cardholderName = self.nameTxtField.text; 
	vPTMCObj.panNumber=self.creditCardNotxtField.text; 
	vPTMCObj.expiryDate = [self.monthTextField.text stringByAppendingString:self.yearTextField.text]; 
	vPTMCObj.isNullable = false; 
	vPTMCObj.street = self.streetTxtField.text; 
	vPTMCObj.city = self.cityTxtField.text; 
	vPTMCObj.stateProvince = [self.stateBtn titleForState:UIControlStateNormal];
	vPTMCObj.accountType=@"NotSet";
    vPTMCObj.postalCode = self.zipTxtField.text;
	vPTMCObj.phone= self.phoneTxtField.text;
	vPTMCObj.cvDataProvided = @"Provided";
	vPTMCObj.cVData = self.cVCtxtField.text; 
	vPTMCObj.amount = self.testCashTxtField.text; 
    vPTMCObj.currencyCode = self.currencyCodeTxtField.text; 
	vPTMCObj.customerPresent = @"Present";
	vPTMCObj.employeeId = self.customerIDtxtField.text;
	vPTMCObj.entryMode = @"Keyed";
	vPTMCObj.industryType = @"Ecommerce";
	vPTMCObj.email = self.emailTxtField.text;
	vPTMCObj.countryCode = @"USA";
	vPTMCObj.businnessName = @"MomCorp";
	vPTMCObj.CustomerId = @"11";
	vPTMCObj.comment = @"a test comment";
    vPTMCObj.discription = @"a test description";
	vPTMCObj.reportingDataReference = @"001";
	vPTMCObj.transactionDataReference = @"xyt";
	vPTMCObj.transactionDateTime=@"2013-04-03T13:50:16";
	vPTMCObj.cashBackAmount = @"0.0";
	vPTMCObj.goodsType = @"NotSet";
	vPTMCObj.invoiceNumber = @"808";
	vPTMCObj.orderNumber = @"629203";
	vPTMCObj.FeeAmount = @"1000.05";
	vPTMCObj.tipAmount = self.tipAmountTxtField.text;//this amount is used for capture<br/>
	vPTMCObj.securePaymentAccountData = @""; //ONLY FOR P2PE
	vPTMCObj.encryptionKeyId = @"";		//ONLY FOR P2PE
	vPTMCObj.swipeStatus = @"";
  	vPTMCObj.isPartialShipment = false;
	vPTMCObj.isSignatureCaptured = false; 
	vPTMCObj.partialApprovalCapable = @"NotSet";
   	vPTMCObj.isQuasiCash=false; 
	[PaymentObjecthandler setModelObject:vPTMCObj]; 
	
   1.Request a returnUnLinked() method from API .<br/> 
   
	[velocityProcessorObj returnUnlinked]; //return unlinked method call
	--------------------------------------
	vPTMCObj.paymentAccountDataToken = nil;  //calling authwithout token method
	[velocityProcessorObj returnUnlinked];  //return unlinked without token method call
	---------------------------------------
	vPTMCObj.paymentAccountDataToken = nil;  //calling P2PE  method
    	vPTMCObj.encryptionKeyId = _encryptionKeyIDTextView.text; //for P2PE only, leave null string in case not P2PE
	vPTMCObj.swipeStatus = @""; //for P2PE only, leave null string in case not P2PE
		vPTMCObj.securePaymentAccountData = _securePaymentAccountDataTextView.text;	//for P2PE only, leave null string in case not P2PE
	[velocityProcessorObj returnUnlinked];  //For P2PE
2.Get the success or Error response from API.<br/> 
   
2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
  
 //Here get the Error status then show the corresponding message.	
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[ErrorPaymentResponse 		  
      class]]&&__txRespons_obj.errorId!=nil) { 
					   }
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; </b><br/>
//Here get the Success status then show the corresponding message.
      if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[BankcardTransactionResponsePro class]]&& 	
	__txRespons_obj.status!=nil ) { 
       VelocityPaymentTransaction *obj =[PaymentObjecthandler getModelObject];<br/>
    	obj.transectionID=self._txRespons_obj.transactionId;   //set value for TransectionID<br/>//save transection 				id for void method,return by id and return unlinked method
				}

1.9 QueryTransactionDetail()


The method is responsible for the invocation of queryTransaction operation on the Velocity REST server.

-(void)queryTransactionsDetail;

Modal class velocityPaymentTransaction - holds the values for the returnUnlinked request VelocityPaymentTransaction
1. cardType - String
2. cardholderName - String
3. panNumber-String
4. expiryDate - String
5. street - String
6. stateProvince - String
7. postalCode - String
8. phone - String
9. reportingDataReference String
10. transactionDataReference String
11. state - String
12. cvDataProvided - String
13. amount - String
14. currencyCode - String
15. customerPresent - String
16. employeeId - String
17. entryMode - String
18. industryType - String
19. email - String
20. transactionDateTime - String
21. city -String
22. quasiCash - boolean
23. country - String
24. transactionId- String
25. signatureCaptured - boolean
26. partialShipment - boolean
27. countryCode - String
28. businnessName - String
29. comment - String
30. description - String
31. paymentAccountDataToken - String
32. cashBackAmount - String
33. goodsType - String
34.invoiceNumber - String
35.orderNumber - String
36. FeeAmount - String
37. tipAmount - String
38. partialApprovalCapable - String

How to set the Ui value on VelocityPaymentTransaction model


Sample code

    VelocityPaymentTransaction *vPTMCObj;//velocityProcessorTransactionModelClass Object
	vPTMCObj=[PaymentObjecthandler getModelObject];//method to initialize the modal class object
	vPTMCObj.transactionName = [self.transactionTypebtn titleForState:UIControlStateNormal];
	vPTMCObj.state = [self.stateBtn titleForState:UIControlStateNormal]; 
	vPTMCObj.country = self.countryTxtField.text; 
	vPTMCObj.amountforadjust = self.testCashAdjustTxtFeild.text; 
	vPTMCObj.cardType = [self.cardTypeBtn titleForState:UIControlStateNormal]; 
	vPTMCObj.cardholderName = self.nameTxtField.text; 
	vPTMCObj.panNumber=self.creditCardNotxtField.text; 
	vPTMCObj.expiryDate = [self.monthTextField.text stringByAppendingString:self.yearTextField.text]; 
	vPTMCObj.isNullable = false; 
	vPTMCObj.street = self.streetTxtField.text; 
	vPTMCObj.city = self.cityTxtField.text; 
	vPTMCObj.stateProvince = [self.stateBtn titleForState:UIControlStateNormal];
	vPTMCObj.accountType=@"NotSet";
    vPTMCObj.postalCode = self.zipTxtField.text;
	vPTMCObj.phone= self.phoneTxtField.text;
	vPTMCObj.cvDataProvided = @"Provided";
	vPTMCObj.cVData = self.cVCtxtField.text; 
	vPTMCObj.amount = self.testCashTxtField.text; 
    vPTMCObj.currencyCode = self.currencyCodeTxtField.text; 
	vPTMCObj.customerPresent = @"Present";
	vPTMCObj.employeeId = self.customerIDtxtField.text;
	vPTMCObj.entryMode = @"Keyed";
	vPTMCObj.industryType = @"Ecommerce";
	vPTMCObj.email = self.emailTxtField.text;
	vPTMCObj.countryCode = @"USA";
	vPTMCObj.businnessName = @"MomCorp";
	vPTMCObj.CustomerId = @"11";
	vPTMCObj.comment = @"a test comment";
    vPTMCObj.discription = @"a test description";
	vPTMCObj.reportingDataReference = @"001";
	vPTMCObj.transactionDataReference = @"xyt";
	vPTMCObj.transactionDateTime=@"2013-04-03T13:50:16";
	vPTMCObj.cashBackAmount = @"0.0";
	vPTMCObj.goodsType = @"NotSet";
	vPTMCObj.invoiceNumber = @"808";
	vPTMCObj.orderNumber = @"629203";
	vPTMCObj.FeeAmount = @"1000.05";
	vPTMCObj.tipAmount = self.tipAmountTxtField.text;//this amount is used for capture<br/>
	vPTMCObj.securePaymentAccountData = @""; //ONLY FOR P2PE
	vPTMCObj.encryptionKeyId = @"";		//ONLY FOR P2PE
	vPTMCObj.swipeStatus = @"";
  	vPTMCObj.isPartialShipment = false;
	vPTMCObj.isSignatureCaptured = false; 
	vPTMCObj.partialApprovalCapable = @"NotSet";
   	vPTMCObj.isQuasiCash=false; 
	[PaymentObjecthandler setModelObject:vPTMCObj]; 
	
   1.Request a queryTransactionDetail() method from API .<br/> 
   
	[velocityProcessorObj queryTransactionsDetail]; //return unlinked method call
	      queryTransactionRequestModalObject.page = @"0";
        queryTransactionRequestModalObject.pageSize = @"10";
        queryTransactionRequestModalObject.transactionStartDateTime = @"";
        queryTransactionRequestModalObject.transactionEndDateTime = @"";
        queryTransactionRequestModalObject.includeRelated = @"true";
        queryTransactionRequestModalObject.isAcknowledged = @"NotSet";
        queryTransactionRequestModalObject.transactionIds = @[_queryTransactionIDTextField.text];
        queryTransactionRequestModalObject.batchIds = @[_queryBatchID.text];
	

2.Get the success or Error response from API.<br/> 
   
2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
  
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; </b><br/>

1.10 CaptureAll()


The method is responsible for the invocation of CaptureAll on the Velocity REST server.

-(void)captureAll;
2.Get the success or Error response from API.

2.1 <b>-(void)VelocityProcessorFailedWithErrorMessage:(id )failedAny;</b><br/>
 
  
2.2 <b>-(void)VelocityProcessorFinishedWithSuccess:(id )successAny; </b><br/>
else if (__txRespons_obj!=nil && [self._txRespons_obj isKindOfClass:[CaptureAllArrayOfResponse class]]&&__txRespons_obj!=nil){
 }

2. VelocityResponse


This Modal class implements the responses coming from the Velocity server for a payment transaction request.
It has the following attributes with name and datatype is string.
1.status; 2.statusCode; 3.statusMessage; 4.transactionId; 5.originatorTransactionId; 6.serviceTransactionId; 7.serviceTransactionDateTime; 8.captureState; 9.transactionState; 10.acknowledged; //it is bool type 11.prepaidCard; 12.reference; 13.amount; 14.cardType; 15.feeAmount; 16.approvalCode; 17.aVSResult; 18.batchId; 19.cVResult; 20.cardLevel; 21.downgradeCode; 22.maskedPAN; 23.paymentAccountDataToken ; 24.retrievalReferenceNumber; 25.adviceResponse; 26.commercialCardResponse; 27.returnedACI; 28.statusHttpResponse; 29.statusCodeHttpResponse; 30.orderId; 31.settlementDate; 32.finalBalance; 33.cashBackAmount; 34.date; 35.time; 36.timeZone; 37.errorId; 38.helpUrl; 39.operation; 40.reason; 41.ruleMessage; 42.netAmount; 43.count; 44.httpCode;

it has one method which provides user an ease to get data from the modal class

	+(VelocityResponse *)getModelObject;

sample code

@property (strong, nonatomic) VelocityResponse *_txRespons_obj;
self._txRespons_obj = [VelocityResponseObjectHandlers getModelObject];

2.1 BankcardTransactionResponsePro


This class has the following main attributes with its name and data type.
1. status - String
2. statusCode - String
3. statusMessage - String
4. transactionId - String
5. originatorTransactionId - String
6. serviceTransactionId - String <br/ 7. addendum - Addendum
8. captureState - String
9. transactionState - String
10. acknowledged - boolean
11. prepaidCard - String
12. reference - String
13. amount - String
14. cardType - String
15. feeAmount - String
16. approvalCode - String
17. avsResult - AVSResult
18. batchId - String
19. cVResult - String
20. cardLevel - String
21. downgradeCode - String
22. maskedPAN - String
23. paymentAccountDataToken - String
24. retrievalReferenceNumber - String
25. resubmit - String
26. settlementDate - String
27. finalBalance - String
28. orderId - String
29. cashBackAmount - String
30. adviceResponse - String
31. date - String
32. time - String
33. time zone - String
34. commercialCardResponse - String
35. returnedACI - String

2.2 BankcardCaptureResponse


This class has the following main attributes with its name and datatype.

1. status - String
2. statusCode - String
3. statusMessage - String
4. transactionId - String
5. originatorTransactionId - String
6. serviceTransactionId - String
7. date - String
8. time - String
9. time zone - String
10. addendum - Addendum
11. captureState - String
12. transactionState - String
13. acknowledged - String
14. reference - String
15. batchId - String
16. industryType - String
17. transactionSummaryData - TransactionSummaryData
18. prepaidCard - String

2.3 ErrorResponse


This class has the following main attributes with its name and data type.

  1. errorId - String
  2. helpUrl - String
  3. operation - String
  4. reason - String
  5. ruleMessage-String
  6. ruleKey-String
  7. ruleLocationKey- String
  8. transactionId - String

3.VelocityPaymentTransaction


This class is mainly used to store the user interface value .
This class has the following main attributes with its name and data-type.
1. transactionName - String
2. state - String
3. country - String
4. amountfordjust - String
5. cardType - String
6. cardholderName - String
7. panNumber-String
8. expiryDate - String
9. street - String
10. stateProvince - String
11. postalCode - String
12. phone - String
13. cvDataProvided - String
14. cVData - String
15. amount - String
16. currencyCode - String
17. customerPresent - String
18. employeeId - String
19. entryMode - String
20. industryType - String
21. email - String
22. countryCode - String
23. businnessName - String
24. comment - String
25. description - String
26. paymentAccountDataToken - String
27. transactionDateTime - String
28. cashBackAmount - String
29. goodsType - String
30. invoiceNumber - String
31. orderNumber - String
32. FeeAmount - String
33. tipAmount - String
34. accountType - String
35. partialApprovalCapable - String
36. quasiCash - boolean
37. signatureCaptured - boolean
38. partialShipment - boolean
39. transactionId - String
40. cashBackAmount - String
41. goodsType - String
42. reportingDataReference String
43. transactionDataReference String
44. customerId - String
45. city - String

3.Velocity sample IOSApplication


The velocity sample IOSApplication is responsible for putting the Velocity IOS-SDK for test purpose.
It intends to perform the testing of transaction methods available on the Velocity payment gateway for a merchant.

When a transaction method needs to invoke from Velocity server then it sends the transaction request data and receives the response depending on the type of transaction performed on the velocity server.
The request data is send through the User Interface form which includes the fields required for a transaction.

The Velocity sample IOS Application is able to test the following transaction methods through its user interface.

  1. Verify - The Verify operation is used to verify information about a payment account, such as address verification data (AVSData) on a credit card account, without reserving any funds.
  2. Authorize - The Authorize operation is used to authorize transactions by performing a check on card-holder's funds and reserves the authorization amount if sufficient funds are available.
  3. Authorize W/O token - This method proceeds with the card details when payment account data token is not available.
    4.P2PE Authorize - This method proceeds with the encrypted card details when payment account data token is not available.
  4. AuthorizeAndCapture - The AuthorizeAndCapture operation is used to authorize transactions by performing a check on card-holder's funds and reserves the authorization amount if sufficient funds are available, and flags the transaction for capture (settlement) in a single invocation.
  5. AuthorizeAndCapture W/O token - This method proceeds with the card details and performs the capture operation in single invocation when the payment account data token is not available.
  6. P2PE AuthorizeAndCapture- This method proceeds with the encrypted card details and performs the capture operation in single invocation when the payment account data token is not available.
  7. Capture - The Capture operation is used to capture a single transaction for settlement after it has been successfully authorized by the Authorize operation.
  8. Undo - The Undo operation is used to release card-holder funds by performing a void (Credit Card) or reversal (PIN Debit) on a previously authorized transaction that has not been captured (flagged) for settlement.
  9. Adjust - The Adjust operation is used to make adjustments to a previously authorized amount (incremental or reversal) prior to capture and settlement.
  10. ReturnById - The ReturnById operation is used to perform a linked credit to a card-holder’s account from the merchant’s account based on a previously authorized and settled(Captured) transaction.
  11. ReturnUnlinked - The ReturnUnlinked operation is used to perform an "unlinked", or standalone, credit to a card-holder’s account from the merchant’s account.
  12. ReturnUnlinked W/O token - This method proceeds with the card details when payment account data token is not available.
    14.P2PE ReturnUnlinked - This method proceeds with the encrypted card details when payment account data token is not available.
    15.QueryTransctionDetails-this method processes with transactionId or BatchID for the query of transaction.
    16.CaptureAll - this method captures ,all the transaction made before.

Depending upon the type of transaction performed with request input data, response is generated from the velocity server which can be viewed on the Result page.

5.How to include static library into XcodeProject


1.Download the sdk from github
2.Unzip and find the velocityLibrary folder .
3.Drag and drop the folder into your existing XcodeProject.
4.Include these headers where you are using the library variables.
5.These files should be included
	5.1 #import "Reachability.h"			//import this header
	5.2 #import "ErrorPaymentResponse.h"		//import this header
	5.3 #import "BankcardTransactionResponsePro.h"	//import this header
	5.4 #import "BancardCaptureResponse.h"		//import this header
	5.5 #import "VelocityResponse.h"		//import this header
	5.6 #import "VelocityPaymentTransaction.h"	//import this header
	5.7 #import "VelocityProcessor.h"               //import this header
	5.8 #import "QueryTransectionRequestModalClass.h"//import this header
	5.9 #import "CaptureAllArrayOfResponse.h"	//import this header
	5.10 #import "TransactionDetailModalClass.h"	//import this header

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •