🪝Hooks

Integrating the CryptoPay payment process into other plugins or adding new features to CryptoPay, modifying some processes is very simple with hooks.

CryptoPay has a wrapper hook system created by writing a simple static class on top of WordPress' classic hook system.

This class, which you can use with autoload as below, plays a leading role in all integration processes.

use BeycanPress\CryptoPay\PluginHero\Hook;

In addition, these hooks generally use OOP-compliant type classes. Below are the namespaces of all classes.

// Abstract types
use BeycanPress\CryptoPay\Types\AbstractType;
use BeycanPress\CryptoPay\Types\AbstractListType;
// Data Types
use BeycanPress\CryptoPay\Types\InitType;
use BeycanPress\CryptoPay\Types\Data\ConfigDataType;
use BeycanPress\CryptoPay\Types\Data\PaymentDataType;
use BeycanPress\CryptoPay\Types\Data\DynamicDataType;
// Enums
use BeycanPress\CryptoPay\Types\Enums\TransactionStatus;
use BeycanPress\CryptoPay\Types\Enums\PaymentDataProcess;
// Network
use BeycanPress\CryptoPay\Types\Network\NetworkType;
use BeycanPress\CryptoPay\Types\Network\NetworksType;
use BeycanPress\CryptoPay\Types\Network\CurrencyType;
use BeycanPress\CryptoPay\Types\Network\CurrenciesType;
// Order
use BeycanPress\CryptoPay\Types\Order\OrderType;
use BeycanPress\CryptoPay\Types\Order\RefundType;
use BeycanPress\CryptoPay\Types\Order\RefundsType;
// Transaction
use BeycanPress\CryptoPay\Types\Transaction\ParamsType;
use BeycanPress\CryptoPay\Types\Transaction\AddressesType;
use BeycanPress\CryptoPay\Types\Transaction\TransactionType;
use BeycanPress\CryptoPay\Types\Transaction\TransactionsType;

Also, the "{addon}" value you will see in some hooks is a dynamic value. It is a value specified with the registerIntegration method during the integration process and sent to the payment API with the "cp_addon" value. In this way, in some hooks you can directly manage the process for specific add-ons.

Please follow the Actions link below for actions and filters you can use with this static class.

Last updated