Italian (Italy)
Knowledge Base  >  Vik Restaurants  >  Hooks  >  Pagamento  >  Ricevere una Notifica

apply_filters_ref_array( 'vikrestaurants_receive_payment_notification', bool $status, object &$order )

Fires before starting the validation of a payment transaction.


Description

This hook is triggering after reaching the notify_url pinged by the payment driver to complete the validation. In case you don't enter here, there's something wrong with your payment/server configuration.

Plugins can use this hook to apply some modifications to the order/reservation object. It is helpful to track and store the logs of the payment wherever you want.

This hook DOES NOT trigger in case the order doesn't exist.


Parameters

$status

(bool)  True on success, false otherwise.

&$order

(VREOrderRestaurant|VREOrderTakeaway)  An object holding the details of the reservation/order.


Example

/**
 * This hook is triggered every time a payment tries
 * to validate a transaction made.
 *
 * @param  boolean  $status  True on success, false otherwise.
 * @param  mixed    &$order  The object holding the details of the order.
 */
add_filter('vikrestaurants_receive_payment_notification', function($status, &$order)
{
    /**
     * @todo do stuff here
     */

    return $status;
}, 10, 2);

Changelog

Version Description
1.0 Introduced.
Ultimo aggiornamento: 2021-01-24
Utile?