$success, 'failure' => $failure, 'problem' => $problem, ); Plgntls::update_option_safe($option_name, $data); } function update_paypal_credentials_CIPF($request, $option_name, $option_data, $option_default) { Plgntls::debug_infos(); /* * is sandbox or live ? * */ $is_sandbox = false; if (!isset($request['sandbox_or_live'])) { return; } if ($request['sandbox_or_live'] === 'sandbox') { $is_sandbox = true; } else if ($request['sandbox_or_live'] === 'live') { $is_sandbox = false; } else { return; } /* * client id * */ $client_id = ''; if (!isset($request['client_id'])) { return; } else { $client_id = $request['client_id']; } /* * client secret * */ $client_secret = ''; if (!isset($request['client_secret'])) { return; } else { $client_secret = $request['client_secret']; } /* * update the option with new credentials * set_paypal_options_CIPF($is_sandbox, $client_id, $client_secret); */ $data = array( 'is_sandbox' => $is_sandbox, 'client_id' => $client_id, 'client_secret' => $client_secret, ); Plgntls::update_option_safe($option_name, $data); } ?>