CryptoPay Docs
  • OVERVIEW
    • 👋Welcome
    • 👨‍💻Installation
  • ADD-ONS
    • 🧑‍💻Installation
    • 🔌Donation
    • 🔌Network supports
      • ⚙️Node providers
  • SETTINGS
    • ❓Which setting does what?
    • ⚙️Networks and currencies
      • 🆕How do I add a new network (EVM)
      • 🆕How do I add a new token
      • 🔵How do I use my own token
    • 🔣Currency discounts
    • 💱Currency converter
      • 💲How custom prices work
      • 🔑Get Moralis API Key
  • FOR DEVELOPERS
    • 🪝Hooks
      • 👷Actions
      • 👮Filters
      • ⚡JS Events
    • 📚Examples
      • ⭐Start payment
      • 🔌Currency converters
      • 🔌Integration add-on
  • ABOUT
    • 📃Version history
Powered by GitBook
On this page
  1. FOR DEVELOPERS

🪝Hooks

PreviousGet Moralis API KeyNextActions

Last updated 1 year ago

CtrlK

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.