mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Add ngrok to allow using webhooks with a local development server
This commit is contained in:
parent
295ecb91ff
commit
c88ce1ff09
4 changed files with 31 additions and 0 deletions
|
@ -234,6 +234,14 @@ class IncomingWebhookEndpoint {
|
|||
|
||||
$url = str_replace( 'http://', 'https://', $url );
|
||||
|
||||
$ngrok_host = getenv( 'NGROK_HOST' );
|
||||
if ( $ngrok_host ) {
|
||||
$host = wp_parse_url( $url, PHP_URL_HOST );
|
||||
if ( $host ) {
|
||||
$url = str_replace( $host, $ngrok_host, $url );
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue