SDK Common Objects

Php SDK

Authorize.net provides a php sdk for working with their payment gateway.


There are a few classes that we'll need to get familiar with when working with their sdk.

  • MerchantAuthenticationType
  • CreditCardType
  • PaymentType
  • OrderType
  • TransactionRequestType
  • CreateTransactionRequest
  • AnetController\CreateTransactionController

MerchantAuthenticationType

In order to use the Payment gateway we must be authenticated. The MerchantAuthenticationType class creates an authentication object where we will set the API LOGIN ID and the TRANSACTION KEY. This object will be consumes by CreateTransactionRequest when we create our request object.

 

CreditCardType

When charging a credit card we need to create an object that represents the credit card. The CreditCardType class allows you to do this. We can have the credit card number, expiration date and the security code for the card. This object will be consumed by the PaymentType class.

 

PaymentType

The PaymentType class is used to specify a type of payment. The payment type can be set as credit card, PayPal or bank account. These correspond to CreditCardTypePayPalType and BankAccountType classes.

 

TransactionRequestType

The TransactionRequestType class is used to set up the type of transaction. A transaction can be a refund, a authorize only, authorize and capture and more. On this object is also where we set the PaymentType , the order amount, and the order details via the OrderType class.

 

CreateTransactionRequest

The CreateTransactionRequest class is used to create a request object. On this request will set the MerchantAuthenticationType  authentication object and the TransactionRequestType object. This request object can then be passed to the 

CreateTransactionController class  which will then execute the request and return a response.

 

CreateTransactionController

The CreateTransactionController object is used to create a controller that can execute our request object of type CreateTransactionRequest.

Cookbook Category: 

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.