Services


Intro

Services are in charge of all the communication between your integration and the PixelPay system. Services make it easy to build requests, which are then sent to the PixelPay servers for further processing.

The Services section includes:

  • Transaction: Allows the creation, authorization, capture, cancellation or status retrieval of all sales within the business.
  • Tokenization: Allows the tokenization, update, deletion or retrieval of credit and debit cards within the affiliated company.

Services generate the Requests to the PixelPay API, which is why they are of great importance.

Services throw two types of exceptions (defined as exceptions within the SDK) that can be catched:

  • InvalidCredentialsException
  • InvalidTransactionException

It is important to use try/catch blocks to handle any exceptions that may arise from a miscommunication with the PixelPay servers.


Transaction Transaction

PixelPay's transaction service allows you to obtain payment status, create new payments, authorize and capture payments, and cancel payments.

All the different services use a different type of request depending on the type of action you want to perform with PixelPay. You can identify which type of service each request corresponds to by looking at the name of the file or the class (eg CardTokenization is a request for the Tokenization service )


Initialization of Transaction

Builder Parameters Access
default settings: Settings public

Default constructor used to initialize transaction service.


Transaction methods

Function Parameters Return Access
doSale transaction: SaleTransaction Response public

Submit and process sales transaction.

You can use the entity TransactionResult with the result of this method.


Function Parameters Return Access
doAuth transaction: AuthTransaction Response public

Submit and process authentication transaction.

You can use the entity TransactionResult with the result of this method.


Function Parameters Return Access
doCapture transaction: CaptureTransaction Response public

Send and process capture transaction, after having performed an authentication transaction.

You can use the entity TransactionResult with the result of this method.


Function Parameters Return Access
doVoid transaction: VoidTransaction Response public

Send and process Void Payment transaction, after having performed an authentication transaction.

You can use the entity TransactionResult with the result of this method.


Function Parameters Return Access
getStatus transaction: StatusTransaction Response public

Get current status of the transaction.


Function Parameters Return Access
verifyPaymentHash hash: string
order_id: string
secret: string
boolean public

Compare the hash value (or payment_hash within the response) to verify that the transaction is real.

Payment verification can only be done on the server side, and not on the cliente side. If the client had access to this information, the payment hash would be available to the general public. The secret parameter must not be encrypted.


Tokenization Tokenization

PixelPay's tokenization service allows card information to be stored securely using a token service instead of raw card data.

All the different services use a different type of request depending on the type of action you want to perform with PixelPay. You can identify which type of service each request corresponds to by looking at the name of the file or the class (eg CardTokenization is a request for the Tokenization service )


Initialization of Tokenization

Builder Parameters Access
default settings: Settings public

Default constructor used to initialize tokenization service.


Tokenization methods

Function Parameters Return Access
vaultCard card: CardTokenization Response public

Save the credit/debit card and get a token card identifier (T-* format).

You can use the entity CardResult with the result of this method.


Function Parameters Return Access
updateCard token: string
card: CardTokenization
Response public

Update credit/debit card by token card identifier ( T-* ).

You can use the entity CardResult with the result of this method.


Function Parameters Return Access
showCard token: string Response public

Show credit/debit card metadata by token card identifier ( T-* ).


Function Parameters Return Access
showCards tokens: string[] Response public

Show credit/debit card metadata by multiple symbolic card identifiers ( T-* ).


Function Parameters Return Access
deleteCard token: string Response public

Remove credit/debit card metadata using token card identifier ( T-* ).