Add ability to override payment gateway settings URL (https://github.com/woocommerce/woocommerce-admin/pull/7281)

This commit is contained in:
Joshua T Flowers 2021-07-05 17:43:11 -04:00 committed by GitHub
parent 4a3e4ff7ef
commit 98d8040a06
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,9 @@ class PaymentGatewaysController {
$data['needs_setup'] = $gateway->needs_setup();
$data['post_install_scripts'] = self::get_post_install_scripts( $gateway );
$data['settings_url'] = admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . strtolower( $gateway->id ) );
$data['settings_url'] = method_exists( $gateway, 'get_settings_url' )
? $gateway->get_settings_url()
: admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . strtolower( $gateway->id ) );
$return_url = wc_admin_url( '&task=payments&connection-return=' . strtolower( $gateway->id ) );
$data['connection_url'] = method_exists( $gateway, 'get_connection_url' )