mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
Check for captured vault webhook order meta
This commit is contained in:
parent
572c62c74c
commit
465855d061
5 changed files with 24 additions and 10 deletions
|
@ -53,7 +53,7 @@ class VaultPaymentTokenCreated implements RequestHandler
|
|||
$response = array( 'success' => false );
|
||||
$webhook_id = (string) ( $request['id'] ?? '' );
|
||||
|
||||
$customer_id = $request['customer_id'] ?? '';
|
||||
$customer_id = $request['resource']['customer_id'] ?? '';
|
||||
if(!$customer_id) {
|
||||
$message = sprintf( 'No customer id for webhook event %s was found.', $webhook_id );
|
||||
$this->logger->warning( $message, array( 'request' => $request ) );
|
||||
|
@ -62,7 +62,8 @@ class VaultPaymentTokenCreated implements RequestHandler
|
|||
}
|
||||
|
||||
$customer_id_parts = explode('-', $customer_id);
|
||||
$this->authorized_payments_processor->capture_authorized_payments_for_customer((int) end($customer_id_parts));
|
||||
$wc_customer_id = (int) end($customer_id_parts);
|
||||
$this->authorized_payments_processor->capture_authorized_payments_for_customer($wc_customer_id);
|
||||
|
||||
$response['success'] = true;
|
||||
return rest_ensure_response($response);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue