Skip to content

Latest commit

 

History

History
464 lines (439 loc) · 32.7 KB

README.md

File metadata and controls

464 lines (439 loc) · 32.7 KB

FirstApiClient

Payment Gateway API Specification.

  • API version: 21.5.0

Installation

Install the gem

gem install first_data_gateway

(for development, run gem install --dev first_data_gateway to install the development dependencies)

Then add the gem to your Gemfile:

gem 'first_data_gateway', '~> 1.14.0'

Install from Git

Add the following in the Gemfile:

gem 'first_data_gateway', :git => 'https://github.com/GBSEcom/Ruby.git'

Getting Started

require 'openapi_client'
require 'simple_client'

api_key = "Your API Key here"
api_secret = "Your API Secret here"

credentials = SimpleClient::MerchantCredentials.new(api_key, api_secret)

# For use in production, supply "PROD" as the optional production argument:
# gateway = SimpleClient::Gateway.create(credentials, "PROD");

gateway = SimpleClient::Gateway.create(credentials)

payload = 	"{ 
				\"amount\":{
					\"currency\":\"USD\",
					\"total\":\"12.10\"
				},
				\"paymentMethod\":{
					\"paymentCard\":{
						\"expiryDate\":{
							\"month\":\"12\",
							\"year\":\"21\"
						},
						\"number\":\"5500000000000004\"
					},
					\"type\":\"PAYMENT_CARD\"
				},
				\"transactionType\":\"SALE\"
			}"
result = gateway.primary_payment_transaction(payload: payload)
p JSON.generate(result.to_hash)

Documentation for API Endpoints

All URIs are relative to https://cert.api.firstdata.com/gateway/v2

Class Method HTTP request Description
OpenapiClient::AuthenticationApi authentication_access_tokens_post POST /authentication/access-tokens Generate an access token for user authentication.
OpenapiClient::CurrencyConversionApi get_exchange_rate POST /exchange-rates Generate dynamic currency conversion transactions.
OpenapiClient::FraudDetectApi fraud_client_registration_post POST /fraud/client-registration Client registration for fraud detect transaction.
OpenapiClient::FraudDetectApi fraud_payment_registration_post POST /fraud/payment-registration Payment registration for fraud detect transaction.
OpenapiClient::FraudDetectApi score_only POST /fraud/score-only Score a transaction for fraud.
OpenapiClient::InformationLookupApi card_info_lookup POST /card-information Card information lookup.
OpenapiClient::InformationLookupApi lookup_account POST /account-information Account information lookup.
OpenapiClient::OrderApi order_inquiry GET /orders/{order-id} Retrieve the state of an order.
OpenapiClient::OrderApi submit_secondary_transaction_from_order POST /orders/{order-id} Perform return or postAuth secondary transactions.
OpenapiClient::PaymentApi finalize_secure_transaction PATCH /payments/{transaction-id} Update a 3DSecure or UnionPay payment and continue processing.
OpenapiClient::PaymentApi submit_primary_transaction POST /payments Generate a primary transaction.
OpenapiClient::PaymentApi submit_secondary_transaction POST /payments/{transaction-id} Perform a secondary transaction.
OpenapiClient::PaymentApi transaction_inquiry GET /payments/{transaction-id} Retrieve the state of a transaction.
OpenapiClient::PaymentSchedulesApi cancel_payment_schedule DELETE /payment-schedules/{order-id} Cancel a gateway payment schedule.
OpenapiClient::PaymentSchedulesApi create_payment_schedule POST /payment-schedules Create gateway payment schedule.
OpenapiClient::PaymentSchedulesApi inquiry_payment_schedule GET /payment-schedules/{order-id} View a gateway payment schedule.
OpenapiClient::PaymentSchedulesApi update_payment_schedule PATCH /payment-schedules/{order-id} Update a gateway payment schedule.
OpenapiClient::PaymentTokenApi create_payment_token POST /payment-tokens Create a payment token from a payment card.
OpenapiClient::PaymentTokenApi delete_payment_token DELETE /payment-tokens/{token-id} Delete a payment token.
OpenapiClient::PaymentTokenApi get_payment_token_details GET /payment-tokens/{token-id} Get payment card details associated with token.
OpenapiClient::PaymentTokenApi update_payment_token PATCH /payment-tokens Update one or more payment tokens.
OpenapiClient::PaymentURLApi create_payment_url POST /payment-url Create a payment URL.
OpenapiClient::PaymentURLApi delete_payment_url DELETE /payment-url Delete a payment URL.
OpenapiClient::PaymentURLApi payment_url_detail GET /payment-url Retrieve the state of payment URL.
OpenapiClient::VerificationApi verify_account POST /account-verification Verify a payment card or payment token.
OpenapiClient::VerificationApi verify_card POST /card-verification Verify a payment card.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.