Update API

This commit is contained in:
Hoang Huu
2019-10-12 09:59:54 +07:00
parent e7b240ef66
commit 82e5de4919
6 changed files with 26 additions and 885 deletions

View File

@@ -360,14 +360,14 @@ function opalestate_update_api_key() {
$response['consumer_secret'] = '';
$response['message'] = __( 'API Key updated successfully.', 'opalestate-pro' );
} else {
$consumer_key = 'ck_' . wc_rand_hash();
$consumer_secret = 'cs_' . wc_rand_hash();
$consumer_key = 'ck_' . opalestate_rand_hash();
$consumer_secret = 'cs_' . opalestate_rand_hash();
$data = [
'user_id' => $user_id,
'description' => $description,
'permissions' => $permissions,
'consumer_key' => wc_api_hash( $consumer_key ),
'consumer_key' => opalestate_api_hash( $consumer_key ),
'consumer_secret' => $consumer_secret,
'truncated_key' => substr( $consumer_key, -7 ),
];