WC_Gateway_Paypal_Webhook_Handler
in package
Handles webhook events.
Table of Contents
- process_webhook() : mixed
- Process the webhook event.
- authorize_or_capture_payment() : void
- Capture the payment.
- get_action_url() : string|null
- Get the action URL from the links.
- process_checkout_order_approved() : mixed
- Process the CHECKOUT.ORDER.APPROVED webhook event.
- process_payment_authorization_created() : mixed
- Process the PAYMENT.AUTHORIZATION.CREATED webhook event.
- process_payment_capture_completed() : mixed
- Process the PAYMENT.CAPTURE.COMPLETED webhook event.
- process_payment_capture_pending() : mixed
- Process the PAYMENT.CAPTURE.PENDING webhook event.
Methods
process_webhook()
Process the webhook event.
public
process_webhook(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
-
The request object.
Return values
mixed —authorize_or_capture_payment()
Capture the payment.
private
authorize_or_capture_payment(WC_Order $order, array<string|int, mixed> $links, string $action) : void
Parameters
- $order : WC_Order
-
The order object.
- $links : array<string|int, mixed>
-
The links from the webhook event.
- $action : string
-
The action to perform (capture or authorize).
Return values
void —get_action_url()
Get the action URL from the links.
private
get_action_url(array<string|int, mixed> $links, string $action) : string|null
Parameters
- $links : array<string|int, mixed>
-
The links from the webhook event.
- $action : string
-
The action to perform (capture or authorize).
Return values
string|null —process_checkout_order_approved()
Process the CHECKOUT.ORDER.APPROVED webhook event.
private
process_checkout_order_approved(array<string|int, mixed> $event) : mixed
Parameters
- $event : array<string|int, mixed>
-
The webhook event data.
Return values
mixed —process_payment_authorization_created()
Process the PAYMENT.AUTHORIZATION.CREATED webhook event.
private
process_payment_authorization_created(array<string|int, mixed> $event) : mixed
Parameters
- $event : array<string|int, mixed>
-
The webhook event data.
Return values
mixed —process_payment_capture_completed()
Process the PAYMENT.CAPTURE.COMPLETED webhook event.
private
process_payment_capture_completed(array<string|int, mixed> $event) : mixed
Parameters
- $event : array<string|int, mixed>
-
The webhook event data.
Return values
mixed —process_payment_capture_pending()
Process the PAYMENT.CAPTURE.PENDING webhook event.
private
process_payment_capture_pending(array<string|int, mixed> $event) : mixed
Parameters
- $event : array<string|int, mixed>
-
The webhook event data.
