Action
rpress_checkout_before_gateway
On this page
Fires after checkout validation, just before the order is sent to the payment gateway.
Runs in rpress_process_purchase_form() on the final (non-AJAX) submission, after validation has passed and the user, customer record and purchase data have been prepared, and before the purchase data is filtered by rpress_purchase_data_before_gateway and handed to rpress_send_to_gateway(). $valid_data already contains the resolved user under the 'user' key.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$data | array | Sanitized copy of $_POST. |
$user_info | array | User info with 'id', 'email', 'first_name', 'last_name', 'discount' and 'address'. |
$valid_data | array | Validated data, with the resolved user added under 'user'. |
Example#
add_action( 'rpress_checkout_before_gateway', 'my_store_checkout_email', 10, 3 );
function my_store_checkout_email( $data, $user_info, $valid_data ) {
if ( ! empty( $user_info['id'] ) ) {
update_user_meta( $user_info['id'], 'my_last_checkout_email', $user_info['email'] );
}
}
Notes#
Not fired for the AJAX validation request, which ends with 'success' before this point.
Source#
Fired from:
includes/process-purchase.php(line 214), inrpress_process_purchase_form()
See also#
Was this page helpful?
