For the complete documentation index, see llms.txt. This page is also available as Markdown.

Payment Helper Functions

The helper you can use for payment transactions. And get, delete, update payment details.

function add_payment($payment) {.....}

Supported hooks

Filter name: before_add_payment Description: This filter would be executed before add payment into the database in add_payment helper. Usage:

// The filter callback function is based on the filter.

add_filter( ‘before_add_payment’, ‘before_add_payment_callback_fun’, 10, 1 );

function before_add_payment_callback_fun($payment) {
 // code
}

Filter name: should_add_payment Description: This filter would be executed before add payment into database in add_payment helper. Usage:

// The filter callback function is based on the filter.

add_filter( ‘should_add_payment’, ‘should_add_payment_callback_fun’, 10, 1 );

function should_add_payment_callback_fun($payment) {
    // code
}

hook name: pre.add.payment Description: This hook would be executed before add payment into the database in add_payment helper. Usage:

hook name: post.add.payment Description: This hook would be executed after add payment into the database in add_payment helper. Usage:

Usage

Request Parameters

Parameters in array format includes following attributes:

Param
Type
Required
Default
Description

description

Character

Null

The description of a specific payment.

booking_id

Integer

Yes

0

The booking_id for a specific payment.

amount

Decimal Integer

Yes

0

The amount for a specific payment.

is_captured

Integer

0

The is_captured for a specific charge.

selling_date

Date

Yes

Date

The selling_date for specific payment ( must provide date in gmdate() format).

user_id

Integer

Yes

Null

The user_id for a specific payment.

customer_id

Integer

0

The customer_id for a specific payment.

parent_charge_id

Integer

Null

The parent_charge_id for specific payment.

company_id

Integer

Yes

0

The company_id for specific payment.

payment_type_id

Integer

0

The payment_type_id for a specific payment.

gateway_charge_id

Character

Yes

Null

The gateway charge_id for a specific payment.

payment_gateway_used

Character

Yes

Null

The payment gateway is used for a specific payment.

selected_gateway

Character

Yes

Null

The selected_gateway for a specific payment.

cvc

Integer

Yes

Null

The CVC of the user for a specific payment.

folio_id

Integer

0

The folio_id for a specific payment.

Response

function get_payment($payment_id) {....}

Supported hooks

Filter name: before_get_payment Description: This filter would be executed before retrieving payment details from database in get_payment helper. Usage:

Filter name: should_get_payment Description: This filter would be executed before retrieving payment details from database in get_payment helper. Usage:

hook name: pre.get.payment Description: This hook would be executed before retrieving payment details from database in get_payment helper. Usage:

hook name: post.get.payment Description: This hook would be executed after retrieving payment details from database in get_payment helper. Usage:

Usage

Request Parameters

Param
Type
Required
Default
Description

$payment_id

Integer

Yes

Null

The primary id of the payment corresponds to the payment table

Response

function update_payment($payment, $payment_id) {....}

Usage

Supported hooks

Filter name: before_update_payment Description: This filter would be executed before update payment into the database in update_payment helper. Usage:

Filter name: should_update_payment Description: This filter would be executed before update payment into database in update_payment helper. Usage:

hook name: pre.update.payment Description: This hook would be executed before update payment into the database in update_payment helper. Usage:

hook name: post.update.payment Description: This hook would be executed after update payment into the database in update_payment helper. Usage:

Request Parameters

Request required payment_id and array format data includes following attributes:

Param
Type
Required
Default
Description

payment_id

Integer

Yes

Null

The primary key of the payment table for a specific payment.

description

Character

Null

The description of a specific payment.

is_captured

Integer

0

The is_captured for a specific charge.

payment_type_id

Integer

Yes

0

The payment_type_id for a specific payment.

selected_gateway

Character

Yes

Null

The selected_gateway for a specific payment.

payment_status

Character

Yes

Null

The payment_status for a specific payment.

folio_id

Integer

0

The folio_id for a specific payment.

Response

function get_payments($filter) {.....}

Supported hooks

Filter name: before_get_payments Description: This filter would be executed before retrieving payment details from database in get_payments helper. Usage:

Filter name: should_get_payments Description: This filter would be executed before retrieving payment details from database in get_payments helper. Usage:

hook name: pre.get.payments Description: This hook would be executed before retrieving payment details from database in get_payments helper. Usage:

hook name: post.get.payments Description: This hook would be executed after retrieving payment details from database in get_payments helper. Usage:

Usage

Request Parameters

parameter array filter required for payment details.

Param
Type
Required
Default
Description

payment_id

Integer

Yes

Null

The primary key id of the payment table for a specific payment.

booking_id

Integer

Yes

Null

The booking_id for specific payment.

customer_id

Integer

Yes

Null

The customer_id for a specific payment.

folio_id

Integer

Yes

Null

The folio_id for a specific payment.

Response

function delete_payment($payment_id) {.....}

Usage

Request Parameters

Param
Type
Required
Default
Description

$payment_id

Integer

Yes

Null

The id of the payment corresponds to the payment table

Response

Last updated