Runs when a new payment is created and inserted into the database.


  • $payment_id (int) - ID of the newly created payment.
  • $args (array) - Array of arguments used when creating the payment. Includes:
    • subscription (string) - Name of the associated subscription level.
    • object_id (int) - ID of the associated object type (usually the ID of the associated subscription level).
    • object_type (string) - Type of object (usually "subscription" to designate a subscription level).
    • date (string) - Date/time the payment was inserted, in MySQL format.
    • amount (float) - Final payment amount.
    • subtotal (float) - Base price of the subscription level, before any discounts/credits/fees are added.
    • credits (float) - Prorated credits applied towards the payment.
    • fees (float) - Fees applied towards the payment.
    • discount_amount (float) - Discount amount (from discount code) applied towards the payment.
    • discount_code (string) - Discount code used for the payment.
    • user_id (int) - ID of the associated user.
    • payment_type (string) - Type of payment (i.e. "Credit Card One Time").
    • subscription_key (string) - Subscription key.
    • transaction_id (string) - ID of the transaction with the payment gateway.
    • status (string) - Status of the payment (i.e. "complete", "pending", etc.).
    • gateway (string) - Slug of the payment gateway that was used for the payment.