mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Fix onboarding email with spaces/plus signs.
Fix order item when image_url is empty.
This commit is contained in:
parent
53f82b74f3
commit
a532462595
2 changed files with 15 additions and 2 deletions
|
@ -249,9 +249,12 @@ class Item {
|
||||||
'sku' => $this->sku(),
|
'sku' => $this->sku(),
|
||||||
'category' => $this->category(),
|
'category' => $this->category(),
|
||||||
'url' => $this->url(),
|
'url' => $this->url(),
|
||||||
'image_url' => $this->image_url(),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( $this->image_url() ) {
|
||||||
|
$item['image_url'] = $this->image_url();
|
||||||
|
}
|
||||||
|
|
||||||
if ( $this->tax() ) {
|
if ( $this->tax() ) {
|
||||||
$item['tax'] = $this->tax()->to_array();
|
$item['tax'] = $this->tax()->to_array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ class SettingsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
$merchant_id = sanitize_text_field( wp_unslash( $_GET['merchantIdInPayPal'] ) );
|
$merchant_id = sanitize_text_field( wp_unslash( $_GET['merchantIdInPayPal'] ) );
|
||||||
$merchant_email = sanitize_text_field( wp_unslash( $_GET['merchantId'] ) );
|
$merchant_email = $this->sanitize_onboarding_email( sanitize_text_field( wp_unslash( $_GET['merchantId'] ) ) );
|
||||||
$onboarding_token = sanitize_text_field( wp_unslash( $_GET['ppcpToken'] ) );
|
$onboarding_token = sanitize_text_field( wp_unslash( $_GET['ppcpToken'] ) );
|
||||||
$retry_count = isset( $_GET['ppcpRetry'] ) ? ( (int) sanitize_text_field( wp_unslash( $_GET['ppcpRetry'] ) ) ) : 0;
|
$retry_count = isset( $_GET['ppcpRetry'] ) ? ( (int) sanitize_text_field( wp_unslash( $_GET['ppcpRetry'] ) ) ) : 0;
|
||||||
// phpcs:enable WordPress.Security.NonceVerification.Missing
|
// phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||||
|
@ -278,6 +278,16 @@ class SettingsListener {
|
||||||
$this->onboarding_redirect();
|
$this->onboarding_redirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sanitizes the onboarding email.
|
||||||
|
*
|
||||||
|
* @param string $email The onboarding email.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function sanitize_onboarding_email( string $email ): string {
|
||||||
|
return str_replace( ' ', '+', $email );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect to the onboarding URL.
|
* Redirect to the onboarding URL.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue