mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Fix lint
Revert authentication
This commit is contained in:
parent
288abde752
commit
e0dd215d92
7 changed files with 41 additions and 43 deletions
|
@ -74,25 +74,18 @@ class UserIdToken {
|
||||||
|
|
||||||
$url = trailingslashit( $this->host ) . 'v1/oauth2/token?grant_type=client_credentials&response_type=id_token&intent=sdk_init';
|
$url = trailingslashit( $this->host ) . 'v1/oauth2/token?grant_type=client_credentials&response_type=id_token&intent=sdk_init';
|
||||||
if ( $target_customer_id ) {
|
if ( $target_customer_id ) {
|
||||||
// $url = add_query_arg(
|
$url = add_query_arg(
|
||||||
// array(
|
array(
|
||||||
// 'target_customer_id' => $target_customer_id,
|
'target_customer_id' => $target_customer_id,
|
||||||
// ),
|
),
|
||||||
// $url
|
$url
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO fix this to use Bearer instead of Basic auth:
|
|
||||||
$settings = PPCP::container()->get( 'wcgateway.settings' );
|
|
||||||
$key = $settings->has( 'client_id' ) && $settings->get( 'client_id' ) ? $settings->get( 'client_id' ) : null;
|
|
||||||
$secret = $settings->has( 'client_secret' ) && $settings->get( 'client_secret' ) ? $settings->get( 'client_secret' ) : null;
|
|
||||||
|
|
||||||
$args = array(
|
$args = array(
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'headers' => array(
|
'headers' => array(
|
||||||
// 'Authorization' => 'Bearer ' . $bearer->token(),
|
'Authorization' => 'Bearer ' . $bearer->token(),
|
||||||
'Authorization' => 'Basic ' . base64_encode( "$key:$secret" ),
|
|
||||||
|
|
||||||
'Content-Type' => 'application/x-www-form-urlencoded',
|
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -132,7 +132,7 @@ return array(
|
||||||
'allow_card_button_gateway',
|
'allow_card_button_gateway',
|
||||||
array(
|
array(
|
||||||
'spacer' => array(
|
'spacer' => array(
|
||||||
'title' => __( '', 'woocommerce-paypal-payments' ),
|
'title' => '',
|
||||||
'type' => 'ppcp-text',
|
'type' => 'ppcp-text',
|
||||||
'text' => '',
|
'text' => '',
|
||||||
'class' => array(),
|
'class' => array(),
|
||||||
|
|
|
@ -49,10 +49,22 @@ return array(
|
||||||
|
|
||||||
'axo.card_icons' => static function ( ContainerInterface $container ): array {
|
'axo.card_icons' => static function ( ContainerInterface $container ): array {
|
||||||
return array(
|
return array(
|
||||||
array('title' => 'Visa', 'file' => 'visa-dark.svg'),
|
array(
|
||||||
array('title' => 'MasterCard', 'file' => 'mastercard-dark.svg'),
|
'title' => 'Visa',
|
||||||
array('title' => 'American Express', 'file' => 'amex.svg'),
|
'file' => 'visa-dark.svg',
|
||||||
array('title' => 'Discover', 'file' => 'discover.svg'),
|
),
|
||||||
|
array(
|
||||||
|
'title' => 'MasterCard',
|
||||||
|
'file' => 'mastercard-dark.svg',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'title' => 'American Express',
|
||||||
|
'file' => 'amex.svg',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'title' => 'Discover',
|
||||||
|
'file' => 'discover.svg',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ class AxoManager {
|
||||||
'email' => $email_widget ?: 'render',
|
'email' => $email_widget ?: 'render',
|
||||||
'address' => $address_widget ?: 'render',
|
'address' => $address_widget ?: 'render',
|
||||||
'payment' => $payment_widget ?: 'render',
|
'payment' => $payment_widget ?: 'render',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,8 @@ class AxoGateway extends WC_Payment_Gateway {
|
||||||
* AXOGateway constructor.
|
* AXOGateway constructor.
|
||||||
*
|
*
|
||||||
* @param ContainerInterface $ppcp_settings The settings.
|
* @param ContainerInterface $ppcp_settings The settings.
|
||||||
|
* @param string $wcgateway_module_url The WcGateway module URL.
|
||||||
|
* @param array $card_icons The card icons.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ContainerInterface $ppcp_settings,
|
ContainerInterface $ppcp_settings,
|
||||||
|
@ -66,7 +68,7 @@ class AxoGateway extends WC_Payment_Gateway {
|
||||||
? $this->ppcp_settings->get( 'axo_gateway_title' )
|
? $this->ppcp_settings->get( 'axo_gateway_title' )
|
||||||
: $this->get_option( 'title', $this->method_title );
|
: $this->get_option( 'title', $this->method_title );
|
||||||
|
|
||||||
$this->description = $this->get_option( 'description', __( '', 'woocommerce-paypal-payments' ) );
|
$this->description = $this->get_option( 'description', '' );
|
||||||
|
|
||||||
$this->init_form_fields();
|
$this->init_form_fields();
|
||||||
$this->init_settings();
|
$this->init_settings();
|
||||||
|
@ -78,15 +80,6 @@ class AxoGateway extends WC_Payment_Gateway {
|
||||||
'process_admin_options',
|
'process_admin_options',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// $this->order_endpoint = $order_endpoint;
|
|
||||||
// $this->purchase_unit_factory = $purchase_unit_factory;
|
|
||||||
// $this->shipping_preference_factory = $shipping_preference_factory;
|
|
||||||
// $this->module_url = $module_url;
|
|
||||||
// $this->logger = $logger;
|
|
||||||
|
|
||||||
// $this->icon = esc_url( $this->module_url ) . 'assets/images/axo.svg'; // TODO
|
|
||||||
// $this->environment = $environment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue