mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
auto fix phpcs errors
This commit is contained in:
parent
f804e01228
commit
c07862ca68
2 changed files with 8 additions and 9 deletions
|
@ -223,7 +223,7 @@ class OrderEndpoint {
|
|||
'body' => wp_json_encode( $data ),
|
||||
);
|
||||
|
||||
$paypal_request_id = '' === $paypal_request_id ? $this->generate_request_id() : $paypal_request_id;
|
||||
$paypal_request_id = '' === $paypal_request_id ? $this->generate_request_id() : $paypal_request_id;
|
||||
|
||||
$args['headers']['PayPal-Request-Id'] = $paypal_request_id;
|
||||
if ( $this->bn_code ) {
|
||||
|
@ -557,14 +557,13 @@ class OrderEndpoint {
|
|||
$new_order = $this->order( $order_to_update->id() );
|
||||
return $new_order;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a new invoice id.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function generate_request_id(): string
|
||||
{
|
||||
private function generate_request_id(): string {
|
||||
return uniqid( 'ppcp-', true );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -711,12 +711,12 @@ return array(
|
|||
'type' => 'text',
|
||||
'desc_tip' => true,
|
||||
'description' => __( 'If you use your PayPal account with more than one installation, please use a distinct prefix to separate those installations. Please do not use numbers in your prefix.', 'woocommerce-paypal-payments' ),
|
||||
'default' => (static function (array $allowedSymbols): string {
|
||||
$default_prefix_chars = array_rand(array_flip($allowedSymbols), 4);
|
||||
$random_prefix = implode('', $default_prefix_chars) . '-';
|
||||
$site_domain = parse_url(get_site_url(get_current_blog_id()), PHP_URL_HOST);
|
||||
'default' => ( static function ( array $allowedSymbols ): string {
|
||||
$default_prefix_chars = array_rand( array_flip( $allowedSymbols ), 4 );
|
||||
$random_prefix = implode( '', $default_prefix_chars ) . '-';
|
||||
$site_domain = parse_url( get_site_url( get_current_blog_id() ), PHP_URL_HOST );
|
||||
return $random_prefix . $site_domain;
|
||||
})(range('A', 'Z')),
|
||||
} )( range( 'A', 'Z' ) ),
|
||||
'screens' => array(
|
||||
State::STATE_PROGRESSIVE,
|
||||
State::STATE_ONBOARDED,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue