1. Home
  2. Docs
  3. Support Docs
  4. Developers
  5. Hooks

Hooks

The Crypto Cashier plugin has the following WordPress hooks defined for a customized site.



Action tag: tcc_payment_option_interaction

Purpose: This action is called when a payment option has been either chosen by the customer or canceled by the customer.

Use: Using PHP, a WordPress call to

add_action('tcc_payment_option_interaction', 'my_custom_function', 10, 4);

Then create a custom function called my_custom_function, which accepts 4 parameters.

function my_custom_function( $invoice_ID, $amount , $currency, $status ) {
//...
}

Parameters to custom function:

invoice_ID – The invoice ID is a unique identifier for the invoice for which the payment method was either chosen or canceled and is a string value.

amount  – The amount of the payment, formatted as a string value.

currency – The currency code identifying the currency used (example BTC or ETH).

status* – The status of the payment (in this case will only be pending or canceled):

PENDING =>  0 – The payment option was chosen by the customer
CANCELED => 9 – The payment option was de-selected (canceled) by the customer)



Action tag: tcc_reconciliation

Purpose: This action is called when a payment has been reconciled.

Use: Using PHP, a WordPress call to

add_action('tcc_reconciliation', 'my_custom_function', 10, 5);

Then create a custom function called my_custom_function, which accepts 5 parameters.

function my_custom_function( $payment_ID, $amount , $currency, $status , $context ) {
//...
}

Parameters to custom function:

payment_ID – The payment ID is a unique identifier for the payment and is a string value.

amount  – The amount of the payment, formatted as a string value.

currency – The currency code identifying the currency used (example BTC or ETH).

status*- The status of the payment:

PENDING =>  0
CREDIT => 1
PARTIALLY_PAID => 2
PAID => 3
VOIDED => 8
CANCELED => 9
EXPIRED => 10
COLLISION => 11

context – The context in which the payment was reconciled (basically, was signifying whether this was a manual or automatic execution):

false – A value of false ($context === false) means that this was a manual execution from the administration console.

0 – A value of 0 ($context === 0) means that Auto-reconciliation was executed, but was switched off for this execution.

1 = A value of 1 ($context === 1) means that Auto-reconciliation was executed, but was set to Notification Only for this execution.

2 = A value of 2 ($context === 2) means that Auto-reconciliation was executed.


*Notes:

1. PHP constants are defined for status codes and are available for use. The constants are prefixed as TCC_PAYMENT_STATUS_ and followed by the status code indicated above.

2. If WooCommerce is being used, you can investigate further hooks available in that platform which may be useful for your implementation.

Was this article helpful to you? Yes No

How can we help?