mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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';
|
||||
if ( $target_customer_id ) {
|
||||
// $url = add_query_arg(
|
||||
// array(
|
||||
// 'target_customer_id' => $target_customer_id,
|
||||
// ),
|
||||
// $url
|
||||
// );
|
||||
$url = add_query_arg(
|
||||
array(
|
||||
'target_customer_id' => $target_customer_id,
|
||||
),
|
||||
$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(
|
||||
'method' => 'POST',
|
||||
'headers' => array(
|
||||
// 'Authorization' => 'Bearer ' . $bearer->token(),
|
||||
'Authorization' => 'Basic ' . base64_encode( "$key:$secret" ),
|
||||
|
||||
'Authorization' => 'Bearer ' . $bearer->token(),
|
||||
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||
),
|
||||
);
|
||||
|
|
|
@ -132,7 +132,7 @@ return array(
|
|||
'allow_card_button_gateway',
|
||||
array(
|
||||
'spacer' => array(
|
||||
'title' => __( '', 'woocommerce-paypal-payments' ),
|
||||
'title' => '',
|
||||
'type' => 'ppcp-text',
|
||||
'text' => '',
|
||||
'class' => array(),
|
||||
|
|
|
@ -49,10 +49,22 @@ return array(
|
|||
|
||||
'axo.card_icons' => static function ( ContainerInterface $container ): array {
|
||||
return array(
|
||||
array('title' => 'Visa', 'file' => 'visa-dark.svg'),
|
||||
array('title' => 'MasterCard', 'file' => 'mastercard-dark.svg'),
|
||||
array('title' => 'American Express', 'file' => 'amex.svg'),
|
||||
array('title' => 'Discover', 'file' => 'discover.svg'),
|
||||
array(
|
||||
'title' => 'Visa',
|
||||
'file' => 'visa-dark.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',
|
||||
'address' => $address_widget ?: 'render',
|
||||
'payment' => $payment_widget ?: 'render',
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class AxoModule implements ModuleInterface {
|
|||
add_filter(
|
||||
'woocommerce_payment_gateways',
|
||||
function ( $methods ) use ( $c ): array {
|
||||
$methods[] = $c->get('axo.gateway');
|
||||
$methods[] = $c->get( 'axo.gateway' );
|
||||
return $methods;
|
||||
},
|
||||
1,
|
||||
|
|
|
@ -44,6 +44,8 @@ class AxoGateway extends WC_Payment_Gateway {
|
|||
* AXOGateway constructor.
|
||||
*
|
||||
* @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(
|
||||
ContainerInterface $ppcp_settings,
|
||||
|
@ -66,7 +68,7 @@ class AxoGateway extends WC_Payment_Gateway {
|
|||
? $this->ppcp_settings->get( 'axo_gateway_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_settings();
|
||||
|
@ -78,15 +80,6 @@ class AxoGateway extends WC_Payment_Gateway {
|
|||
'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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +132,7 @@ class AxoGateway extends WC_Payment_Gateway {
|
|||
}
|
||||
|
||||
$images = array();
|
||||
foreach ($this->card_icons as $card) {
|
||||
foreach ( $this->card_icons as $card ) {
|
||||
$images[] = '<img
|
||||
class="ppcp-card-icon"
|
||||
title="' . $card['title'] . '"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue