mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
store credentials also in the sandbox-prod-credential buckets when returning from paypal
This commit is contained in:
parent
9327b19b7d
commit
de4dc878ef
2 changed files with 20 additions and 2 deletions
|
@ -98,8 +98,19 @@ class SettingsListener {
|
|||
* phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
*/
|
||||
if ( isset( $_GET['merchantIdInPayPal'] ) && isset( $_GET['merchantId'] ) ) {
|
||||
$this->settings->set( 'merchant_id', sanitize_text_field( wp_unslash( $_GET['merchantIdInPayPal'] ) ) );
|
||||
$this->settings->set( 'merchant_email', sanitize_text_field( wp_unslash( $_GET['merchantId'] ) ) );
|
||||
$merchant_id = sanitize_text_field( wp_unslash( $_GET['merchantIdInPayPal'] ) );
|
||||
$merchant_email = sanitize_text_field( wp_unslash( $_GET['merchantId'] ) );
|
||||
$this->settings->set( 'merchant_id', $merchant_id );
|
||||
$this->settings->set( 'merchant_email', $merchant_email );
|
||||
|
||||
$is_sandbox = $this->settings->has( 'sandbox_on' ) && $this->settings->get( 'sandbox_on' );
|
||||
if ( $is_sandbox ) {
|
||||
$this->settings->set( 'merchant_id_sandbox', $merchant_id );
|
||||
$this->settings->set( 'merchant_email_sandbox', $merchant_email );
|
||||
} else {
|
||||
$this->settings->set( 'merchant_id_production', $merchant_id );
|
||||
$this->settings->set( 'merchant_email_production', $merchant_email );
|
||||
}
|
||||
$this->settings->persist();
|
||||
}
|
||||
// phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue