Skip to content

GBSEcom/Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openapi-client# First Data Gateway

Payment Gateway API Specification.

  • API version: 21.5.0

Requirements

Python 2.7 and 3.4+

Installation & Usage

pip install

pip install first_data_gateway

(you may need to run pip with root permission: sudo pip install first_data_gateway)

You can also install directly from Github:

pip install git+https://github.com/GBSEcom/Python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GBSEcom/Python.git)

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Getting Started

from __future__ import print_function
import openapi_client
import simple
from simple import MerchantCredentials
from simple import Gateway
from openapi_client.rest import ApiException
from pprint import pprint

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

credentials = MerchantCredentials(api_key, api_secret)

gateway = Gateway.create(credentials)
api_client = openapi_client.ApiClient()

json_payload = 	"""{
					\"requestType\": \"PaymentCardSaleTransaction\",
					\"transactionAmount\": {
						\"total\": \"25.01\",
						"currency": "USD"
					},
					\"paymentMethod\": {
						\"paymentCard\": {
							\"number\": \"4012000033330026\",
							\"expiryDate\": {
								\"month\": \"12\",
								\"year\": \"25\"
							},
							\"securityCode\": \"977\"
						}
					}
				}"""

obj_name = "PaymentCardSaleTransaction"
obj_model = getattr(openapi_client, obj_name)
payload = api_client.build_object(json.loads(json_payload), obj_model)

result = gateway.primary_payment_transaction(payload)
pprint(result)

Documentation for API Endpoints

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

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

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

About

Python package repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages