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';
|
||||
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',
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue