For installation first download the source code then go to the source code directory in terminal and run the command:
$ gem build velocity.gemspec
The above command will generate the .tar file. Now you can install the gem directly using this command:
$ gem install velocity-0.0.0.gem
Add following lines to your application's Gemfile:
gem 'velocity'
Add the following line to your application's Gemfile:
gem 'velocity', :git => "git://github.com/nab-velocity/ruby-sdk.git"
Run the command:
$ bundle
The Velocity Ruby SDK has the following dependencies:
- HTTParty
- Nokogiri
Note: Bundler will automatically resolve 'httparty' and 'nokogiri' dependencies without adding them to the Gemfile.
First initialize the object
req = Velocity::VelocityProcessor.new(
identity_token,
work_flow_id,
application_profile_id,
merchant_profile_id
)Here we pass the address and credit card details, and industry type.
@response = req.verify(
{
CardholderName: 'John Doe',
Street: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
IndustryType: 'Ecommerce',
PAN: '4012888812348882',
Expire: '0320',
EntryMode: 'Keyed'
}
) OR
@response = req.verify(
{
CardholderName: 'John Doe',
Street: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
IndustryType: 'Ecommerce',
Track1Data: '%B4012000033330026^NAJEER/SHAIK ^0904101100001100000000123456780?',
EntryMode: 'TrackDataFromMSR'
}
) OR
@response = req.verify(
{
CardholderName: 'John Doe',
Street: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
IndustryType: 'Ecommerce',
Track2Data: '4012000033330026=09041011000012345678',
EntryMode: 'TrackDataFromMSR'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address and credit card details, and industry type.
@response = req.authorize(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
PAN: '4012888812348882',
Expire: '0320',
EntryMode: 'Keyed'
}
) OR
@response = req.authorize(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
Track1Data: '%B4012000033330026^NAJEER/SHAIK ^0904101100001100000000123456780?',
EntryMode: 'TrackDataFromMSR'
}
) OR
@response = req.authorize(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
Track2Data: '4012000033330026=09041011000012345678',
EntryMode: 'TrackDataFromMSR'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address details, industry type, and also pass the payment account data token.
@response = req.authorize(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
PaymentAccountDataToken: ' '
InvoiceNumber: '802',
OrderNumber: '629203',
EntryMode: 'Keyed',
IndustryType: 'Ecommerce'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address details, industry type, and also pass card swipe data.
@response = req.authorize(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
SecurePaymentAccountData: ' ',
EncryptionKeyId: ' ',
InvoiceNumber: '802',
OrderNumber: '629203',
EntryMode: 'TrackDataFromMSR',
IndustryType: 'Retail'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address and credit card details, and industry type.
@response = req.authorizeAndCapture(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
PAN: '4012888812348882',
Expire: '0320',
EntryMode: 'Keyed'
}
) OR
@response = req.authorizeAndCapture(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
Track1Data: '%B4012000033330026^NAJEER/SHAIK ^0904101100001100000000123456780?',
EntryMode: 'TrackDataFromMSR'
}
) OR
@response = req.authorizeAndCapture(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
Track2Data: '4012000033330026=09041011000012345678',
EntryMode: 'TrackDataFromMSR'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address details, industry type, and also pass the payment account data token.
@response = req.authorizeAndCapture(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
PaymentAccountDataToken: ' '
InvoiceNumber: '802',
OrderNumber: '629203',
EntryMode: 'Keyed',
IndustryType: 'Ecommerce'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address details, industry type, and also pass card swipe data.
@response = req.authorizeAndCapture(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
SecurePaymentAccountData: ' ',
EncryptionKeyId: ' ',
InvoiceNumber: '802',
OrderNumber: '629203',
EntryMode: 'TrackDataFromMSR',
IndustryType: 'Retail'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the Transaction Id and Amount.
@response = req.capture(
{
TransactionId: ' ',
Amount: '10.00'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the Transaction Ids and Amounts.
@response = req.captureAll(
{
TransactionId: ' ',
Amount: '10.00'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the Transaction Id only.
@response = req.undo(
{
TransactionId: ' '
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the Transaction Id and adjusted Amount.
@response = req.adjust(
{
TransactionId: ' ',
Amount: '10.00'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the Transaction Id and Amount.
@response = req.returnById(
{
TransactionId: ' ',
Amount: '10.00'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address, industry type, credit card details or Track1Data or Track2Data.
@response = req.returnUnlinked(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
PAN: '4012888812348882',
Expire: '0320',
EntryMode: 'Keyed'
}
) OR
@response = req.returnUnlinked(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
Track1Data: '%B4012000033330026^NAJEER/SHAIK ^0904101100001100000000123456780?',
EntryMode: 'TrackDataFromMSR'
}
) OR
@response = req.returnUnlinked(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
IndustryType: 'Ecommerce'
InvoiceNumber: '802',
OrderNumber: '629203',
Amount: '10.00',
CardType: 'Visa',
CVData: '123',
Track2Data: '4012000033330026=09041011000012345678',
EntryMode: 'TrackDataFromMSR'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address details, industry type, and also pass the payment account data token.
@response = req.returnUnlinked(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
PaymentAccountDataToken: ' ',
InvoiceNumber: '802',
OrderNumber: '629203',
EntryMode: 'Keyed',
IndustryType: 'Ecommerce'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the address details, industry type, and also pass card swipe data.
@response = req.returnUnlinked(
{
Street1: '4 corporate sq',
City: 'dever',
CountryCode: 'USA',
PostalCode: '30329',
Phone: '9540123123',
Email: '[email protected]',
Amount: '10.00',
SecurePaymentAccountData: ' ',
EncryptionKeyId: ' ',
InvoiceNumber: '802',
OrderNumber: '629203',
EntryMode: 'TrackDataFromMSR',
IndustryType: 'Retail'
}
)
puts @response # show all the response data, if any error is raised also show errors.Here we pass the Batch id or TransactionId or TransactionDateRanges.
@response = req.queryTransactionsDetail(
{
BatchIds: '0620',
TransactionIds: 'C37A4ACDCA1340E2B458FBA7CDA76785',
EndDateTime: '2015-03-17 02:03:40',
StartDateTime: '2015-03-13 02:03:40'
}
)
puts @response # show all the response data, if any error is raised also show errors.