Payment Gateway API Specification.
- API version: 21.5.0
Python 2.7 and 3.4+
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
)
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
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)
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. |
- ACSResponse
- AVSResponse
- AccessTokenRequest
- AccessTokenResponse
- AccountInfoLookupRequest
- AccountUpdaterResponse
- AccountVerificationRequest
- AchCreditTransaction
- AchPostAuthTransaction
- AchPostAuthTransactionAllOf
- AchPreAuthTransaction
- AchPreAuthTransactionAllOf
- AchRecurringType
- AchResponse
- AchReturnTransaction
- AchSaleTransaction
- AchVoidTransaction
- AdditionalAmountRate
- AdditionalDetails
- AdditionalTransactionDetails
- Address
- Airline
- AirlineAncillaryServiceCategory
- AirlineTravelRoute
- AliPay
- AliPayPaymentMethod
- AliPayPaymentMethodAllOf
- AliPaySaleTransaction
- AliPaySaleTransactionAllOf
- Amount
- AmountComponents
- AuthenticationRequest
- AuthenticationResult
- AuthenticationUpdateRequest
- Background
- BackgroundColor
- BancontactQR
- BasicResponse
- Billing
- BillingAddress
- BlockCard
- BlockDomain
- BlockIPAddress
- BlockName
- BlockedCardNumber
- BlockedItems
- Body
- Borders
- BrandingStyleConfigurationRequest
- BrandingStyleConfigurationResponse
- BrandingStyleConfigurationResult
- Button
- CarRental
- CarRentalExtraCharges
- Card
- CardFunction
- CardInfo
- CardInfoLookupRequest
- CardInfoLookupResponse
- CardVerificationRequest
- ChinaDomestic
- ChinaDomesticPaymentMethod
- ChinaDomesticPaymentMethodAllOf
- ChinaPnRSaleTransaction
- ChinaPnRSaleTransactionAllOf
- ClassicMode
- ClearingDetails
- ClearingElement
- ClientLocale
- ClientRegistration
- CombinedMode
- ConnectMode
- Contact
- Content
- CountryProfile
- CreatePaymentToken
- CurrencyConversion
- CurrencyConversionResponse
- Customer
- CustomerAddress
- DCCExchangeRateRequest
- DCCExchangeRateRequestAllOf
- Dcc
- DccAllOf
- DecryptedApplePay
- DecryptedApplePayWalletPaymentMethod
- DecryptedApplePayWalletPaymentMethodAllOf
- DecryptedGooglePay
- DecryptedGooglePayWalletPaymentMethod
- DecryptedGooglePayWalletPaymentMethodAllOf
- DecryptedSamsungPay
- DecryptedSamsungPayWalletPaymentMethod
- DecryptedSamsungPayWalletPaymentMethodAllOf
- DeleteBrandingStyleConfigurationResponse
- Device
- Disbursement
- DisbursementTransactionType
- Document
- DynamicPricing
- DynamicPricingAllOf
- DynamicPricingExchangeRateRequest
- DynamicPricingExchangeRateRequestAllOf
- EmailNotificationData
- EncryptedApplePay
- EncryptedApplePayHeader
- EncryptedApplePayWalletPaymentMethod
- EncryptedApplePayWalletPaymentMethodAllOf
- EncryptedGooglePay
- EncryptedGooglePayData
- EncryptedGooglePayWalletPaymentMethod
- EncryptedGooglePayWalletPaymentMethodAllOf
- EncryptedSamsungPay
- EncryptedSamsungPayWalletPaymentMethod
- EncryptedSamsungPayWalletPaymentMethodAllOf
- EndpointResponse
- Error
- ErrorDetails
- ErrorMessage
- ErrorResponse
- ExchangeRateDetails
- ExchangeRateRequest
- ExchangeRateResponse
- Expiration
- FontFace
- FontProperties
- FontWeight
- Footer
- FraudAddress
- FraudOrder
- FraudOrderItems
- FraudRegistration
- FraudRegistrationCard
- FraudRegistrationDevice
- FraudRegistrationDeviceItems
- FraudRegistrationError
- FraudRegistrationResponse
- FraudScore
- FraudSettings
- FraudSettingsResponse
- Frequency
- FundingTransactionType
- Header
- Hover
- IdInfo
- IndustrySpecificExtensions
- InitiateClearingResponse
- InitiateClearingResponseAllOf
- InstallmentOptions
- IssuerResponse
- Items
- Location
- LockoutTime
- Lodging
- LodgingExtraCharges
- Logo
- Loyalty
- MasterpassWalletPaymentMethod
- MasterpassWalletPaymentMethodAllOf
- MaximumPurchaseAmount
- Mcc6012
- Merchant
- Method
- Mobile
- MobileHeaderArea
- Order
- OrderErrorResponse
- OrderResponse
- PayPal
- PayPalPaymentMethod
- PayPalPaymentMethodAllOf
- Payment
- PaymentCard
- PaymentCardCreditTransaction
- PaymentCardDisbursementTransaction
- PaymentCardDisbursementTransactionAllOf
- PaymentCardForcedTicketTransaction
- PaymentCardForcedTicketTransactionAllOf
- PaymentCardInfoLookupRequest
- PaymentCardInfoLookupRequestAllOf
- PaymentCardPayerAuthTransaction
- PaymentCardPayerAuthTransactionAllOf
- PaymentCardPaymentMethod
- PaymentCardPaymentMethodAllOf
- PaymentCardPaymentTokenUpdateRequest
- PaymentCardPaymentTokenizationRequest
- PaymentCardPaymentTokenizationRequestAllOf
- PaymentCardPreAuthTransaction
- PaymentCardPreAuthTransactionAllOf
- PaymentCardSaleTransaction
- PaymentCardSaleTransactionAllOf
- PaymentCardVerificationRequest
- PaymentCardVerificationRequestAllOf
- PaymentDevice
- PaymentDeviceCreditTransaction
- PaymentDeviceCreditTransactionAllOf
- PaymentDeviceDisbursementTransaction
- PaymentDeviceDisbursementTransactionAllOf
- PaymentDevicePaymentMethod
- PaymentDevicePaymentMethodAllOf
- PaymentDevicePaymentTokenizationRequest
- PaymentDevicePaymentTokenizationRequestAllOf
- PaymentDevicePreAuthTransaction
- PaymentDevicePreAuthTransactionAllOf
- PaymentDeviceSaleTransaction
- PaymentDeviceSaleTransactionAllOf
- PaymentFacilitator
- PaymentMethodDetails
- PaymentMethodPaymentSchedulesRequest
- PaymentMethodPaymentSchedulesRequestAllOf
- PaymentMethodType
- PaymentRegistration
- PaymentSchedulesErrorResponse
- PaymentSchedulesRequest
- PaymentSchedulesResponse
- PaymentTokenCreditTransaction
- PaymentTokenCreditTransactionAllOf
- PaymentTokenDetails
- PaymentTokenDetailsAllOf
- PaymentTokenDisbursementTransaction
- PaymentTokenDisbursementTransactionAllOf
- PaymentTokenInfoLookupRequest
- PaymentTokenInfoLookupRequestAllOf
- PaymentTokenPaymentMethod
- PaymentTokenPaymentMethodAllOf
- PaymentTokenPreAuthTransaction
- PaymentTokenPreAuthTransactionAllOf
- PaymentTokenSaleTransaction
- PaymentTokenSaleTransactionAllOf
- PaymentTokenUpdateResponse
- PaymentTokenVerificationRequest
- PaymentTokenVerificationRequestAllOf
- PaymentTokenizationErrorResponse
- PaymentTokenizationRequest
- PaymentTokenizationResponse
- PaymentUrlDetail
- PaymentUrlDetailResponse
- PaymentUrlErrorResponse
- PaymentUrlRequest
- PaymentUrlResponse
- PaymentUrlStatus
- PaypalCreditTransaction
- PaypalCreditTransactionAllOf
- Phone
- PostAuthTransaction
- PostAuthTransactionAllOf
- Primary
- PrimaryTransaction
- ProcessorData
- Properties
- PurchaseCards
- PurchaseCardsLevel2
- PurchaseCardsLevel3
- PurchaseCardsLevel3LineItems
- Receipt
- ReceiptLine
- ReceiptRequestInfo
- ReceiverInfo
- RecurringPaymentDetails
- RecurringPaymentDetailsResponse
- ReferencedOrderPaymentSchedulesRequest
- ReferencedOrderPaymentSchedulesRequestAllOf
- ReferencedOrderPaymentTokenizationRequest
- ReferencedOrderPaymentTokenizationRequestAllOf
- RegistrationMethod
- RemoveFraudBlockedItemsResponse
- ResponseAmountComponents
- ResponseAmountComponentsAllOf
- ResponseType
- ReturnTransaction
- ReturnTransactionAllOf
- ScoreOnlyRequest
- ScoreOnlyResponse
- ScoreOnlyResponseFraudScore
- ScoreOnlyResponseFraudScoreExplanations
- SecondaryTransaction
- Secure3D10AuthenticationRequest
- Secure3D10AuthenticationResult
- Secure3D10AuthenticationResultAllOf
- Secure3D10AuthenticationUpdateRequest
- Secure3D10AuthenticationUpdateRequestAllOf
- Secure3D21AuthenticationRequest
- Secure3D21AuthenticationRequestAllOf
- Secure3D21AuthenticationResult
- Secure3D21AuthenticationResultAllOf
- Secure3D21AuthenticationUpdateRequest
- Secure3D21AuthenticationUpdateRequestAllOf
- Secure3DAuthenticationResponse
- Secure3DAuthenticationResponseParams
- Secure3DAuthenticationResponseSecure3dMethod
- Secure3dResponse
- SenderInfo
- Sepa
- SepaMandate
- SepaPaymentMethod
- SepaPaymentMethodAllOf
- SepaSaleTransaction
- SepaSaleTransactionAllOf
- SharedSecretConfigurationRequest
- SharedSecretConfigurationResponse
- ShipToAddress
- Shipping
- SoftDescriptor
- SplitShipment
- StoreBrandingStyleConfiguration
- StoreEmailSettings
- StoreEmailSettingsResult
- StoreFraudSettings
- StoreFraudSettingsResult
- StoreUrlConfiguration
- StoreUrlConfigurationRequest
- StoreUrlConfigurationResponse
- StoreUrlConfigurationResult
- StoredCredential
- SubMerchantData
- SubMerchantSplit
- TeleCheckAchPaymentMethod
- TeleCheckAchPaymentMethodAchBillTo
- TeleCheckCBPPaymentMethod
- TeleCheckICAPaymentMethod
- TeleCheckICAPaymentMethodAllOf
- Text
- Title
- TokenIdentifier
- TopBar
- TransactionErrorResponse
- TransactionOrigin
- TransactionResponse
- TransactionType
- UnionPayAuthenticationRequest
- UnionPayAuthenticationRequestAllOf
- UnionPayAuthenticationUpdateRequest
- UnionPayAuthenticationUpdateRequestAllOf
- UpdateEmailSettingsRequest
- UpdateEmailSettingsResponse
- UpdateFraudSettingsRequest
- UpdateFraudSettingsResponse
- UpdatePaymentToken
- UsePaymentToken
- Verification3ds
- VerificationAvs
- VerificationCvv
- VoidPreAuthTransactions
- VoidTransaction
- VoidTransactionAllOf
- WalletPaymentMethod
- WalletPreAuthTransaction
- WalletPreAuthTransactionAllOf
- WalletSaleTransaction
- WalletSaleTransactionAllOf
All endpoints do not require authorization.