Blesta Source Documentation

MerchantCc

Merchant Credit Card processing interface. Defines all methods that a credit card payment gateway must implement. Note: not all methods are required to be supported.

Table of Contents

Methods

authorizeCc() Authorize a credit card
captureCc() Capture the funds of a previously authorized credit card
processCc() Charge a credit card
refundCc() Refund a credit card charge
voidCc() Void a credit card charge
Methods

authorizeCc()

Authorize a credit card

public authorizeCc(array<string|int, mixed> $card_info, float $amount[, array<string|int, mixed> $invoice_amounts = null ]) : array<string|int, mixed>
Parameters
$card_info : array<string|int, mixed>

An array of credit card info including:

  • first_name The first name on the card
  • last_name The last name on the card
  • card_number The card number
  • card_exp The card expidation date in yyyymm format
  • card_security_code The 3 or 4 digit security code of the card (if available)
  • type The credit card type
  • address1 The address 1 line of the card holder
  • address2 The address 2 line of the card holder
  • city The city of the card holder
  • state An array of state info including:
    • code The 2 or 3-character state code
    • name The local name of the country
  • country An array of country info including:
    • alpha2 The 2-character country code
    • alpha3 The 3-cahracter country code
    • name The english name of the country
    • alt_name The local name of the country
  • zip The zip/postal code of the card holder
$amount : float

The amount to charge this card

$invoice_amounts : array<string|int, mixed> = null

An array of invoices, each containing:

  • id The ID of the invoice being processed
  • amount The amount being processed for this invoice (which is included in $amount)
Return values
array<string|int, mixed>

An array of transaction data including:

  • status The status of the transaction (approved, declined, void, pending, reconciled, refunded, returned)
  • reference_id The reference ID for gateway-only use with this transaction (optional)
  • transaction_id The ID returned by the remote gateway to identify this transaction
  • message The message to be displayed in the interface in addition to the standard message for this transaction status (optional)

captureCc()

Capture the funds of a previously authorized credit card

public captureCc(string $reference_id, string $transaction_id, float $amount[, array<string|int, mixed> $invoice_amounts = null ]) : array<string|int, mixed>
Parameters
$reference_id : string

The reference ID for the previously authorized transaction

$transaction_id : string

The transaction ID for the previously authorized transaction

$amount : float

The amount to capture on this card

$invoice_amounts : array<string|int, mixed> = null

An array of invoices, each containing:

  • id The ID of the invoice being processed
  • amount The amount being processed for this invoice (which is included in $amount)
Return values
array<string|int, mixed>

An array of transaction data including:

  • status The status of the transaction (approved, declined, void, pending, reconciled, refunded, returned)
  • reference_id The reference ID for gateway-only use with this transaction (optional)
  • transaction_id The ID returned by the remote gateway to identify this transaction
  • message The message to be displayed in the interface in addition to the standard message for this transaction status (optional)

processCc()

Charge a credit card

public processCc(array<string|int, mixed> $card_info, float $amount[, array<string|int, mixed> $invoice_amounts = null ]) : array<string|int, mixed>
Parameters
$card_info : array<string|int, mixed>

An array of credit card info including:

  • first_name The first name on the card
  • last_name The last name on the card
  • card_number The card number
  • card_exp The card expidation date in yyyymm format
  • card_security_code The 3 or 4 digit security code of the card (if available)
  • type The credit card type
  • address1 The address 1 line of the card holder
  • address2 The address 2 line of the card holder
  • city The city of the card holder
  • state An array of state info including:
    • code The 2 or 3-character state code
    • name The local name of the country
  • country An array of country info including:
    • alpha2 The 2-character country code
    • alpha3 The 3-cahracter country code
    • name The english name of the country
    • alt_name The local name of the country
  • zip The zip/postal code of the card holder
  • reference_id The reference ID attached to this account given by the payment processor (optional)
  • client_reference_id The reference ID for the client this payment account belongs to (optional)
$amount : float

The amount to charge this card

$invoice_amounts : array<string|int, mixed> = null

An array of invoices, each containing:

  • id The ID of the invoice being processed
  • amount The amount being processed for this invoice (which is included in $amount)
Return values
array<string|int, mixed>

An array of transaction data including:

  • status The status of the transaction (approved, declined, void, pending, reconciled, refunded, returned)
  • reference_id The reference ID for gateway-only use with this transaction (optional)
  • transaction_id The ID returned by the remote gateway to identify this transaction
  • message The message to be displayed in the interface in addition to the standard message for this transaction status (optional)

refundCc()

Refund a credit card charge

public refundCc(string $reference_id, string $transaction_id, float $amount) : array<string|int, mixed>
Parameters
$reference_id : string

The reference ID for the previously authorized transaction

$transaction_id : string

The transaction ID for the previously authorized transaction

$amount : float

The amount to refund this card

Return values
array<string|int, mixed>

An array of transaction data including:

  • status The status of the transaction (approved, declined, void, pending, reconciled, refunded, returned)
  • reference_id The reference ID for gateway-only use with this transaction (optional)
  • transaction_id The ID returned by the remote gateway to identify this transaction
  • message The message to be displayed in the interface in addition to the standard message for this transaction status (optional)

voidCc()

Void a credit card charge

public voidCc(string $reference_id, string $transaction_id) : array<string|int, mixed>
Parameters
$reference_id : string

The reference ID for the previously authorized transaction

$transaction_id : string

The transaction ID for the previously authorized transaction

Return values
array<string|int, mixed>

An array of transaction data including:

  • status The status of the transaction (approved, declined, void, pending, reconciled, refunded, returned)
  • reference_id The reference ID for gateway-only use with this transaction (optional)
  • transaction_id The ID returned by the remote gateway to identify this transaction
  • message The message to be displayed in the interface in addition to the standard message for this transaction status (optional)
Tags
subpackage

components.gateways

copyright

Copyright (c) 2010, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results