Checkout_Complete_Webhook

Summary

Class Checkout Complete Webhook


Description

Sets up the webhook that runs when checkout completes


Source

File: src/BigCommerce/Webhooks/Checkout_Complete_Webhook.php

class Checkout_Complete_Webhook extends Webhook {
	const SCOPE = 'store/cart/converted';
	const NAME  = 'checkout_complete';

	/**
	 * @param array $request
	 *
	 * @return void
	 */
	public function trigger_action( $request ) {
		$cart_id = $request['data']['id'];
		/**
		 * Fires when a product inventory webhooks has been received from the BigCommerce store.
		 *
		 * @param int $product_id BigCommerce product ID.
		 */
		do_action( 'bigcommerce/webhooks/' . self::NAME, [ 'cart_id' => $cart_id ] );
	}
}

Methods


User Contributed Notes

You must log in before being able to contribute a note or feedback.