Plugin Directory

Changeset 3130959


Ignore:
Timestamp:
08/05/2024 10:39:06 AM (18 months ago)
Author:
cpsupport
Message:

v 3.2.1

Location:
cloudpayments-gateway-for-woocommerce
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cloudpayments-gateway-for-woocommerce/tags/3.2.1/inc/class-cloud-payments-api.php

    r3130931 r3130959  
    2828          exit('{"error":"empty request"}');
    2929       
    30         if (!$this->CheckHMac()){
     30        if (!$this->CheckHmac()){
    3131          exit('{"error":"access denied"}');
    3232        }
     
    242242    }
    243243 
    244     private function CheckHMac()
     244    private function CheckHmac()
    245245    {
    246246      $headers = $this->detallheaders();
    247       if (!array_key_exists('Content-HMAC', $headers) && !array_key_exists('Content-Hmac', $headers)) {
     247      if (!array_key_exists('Content-Hmac', $headers)) {
    248248        return false;
    249249      }
     
    251251      $s = hash_hmac('sha256', $message, $this->api_pass, true);
    252252      $hmac = base64_encode($s);
    253       return $headers['Content-HMAC'] == $hmac || $headers['Content-Hmac'] == $hmac;
     253      return $headers['Content-Hmac'] == $hmac;
    254254    }
    255255
  • cloudpayments-gateway-for-woocommerce/trunk/inc/class-cloud-payments-api.php

    r3130931 r3130959  
    2828          exit('{"error":"empty request"}');
    2929       
    30         if (!$this->CheckHMac()){
     30        if (!$this->CheckHmac()){
    3131          exit('{"error":"access denied"}');
    3232        }
     
    242242    }
    243243 
    244     private function CheckHMac()
     244    private function CheckHmac()
    245245    {
    246246      $headers = $this->detallheaders();
    247       if (!array_key_exists('Content-HMAC', $headers) && !array_key_exists('Content-Hmac', $headers)) {
     247      if (!array_key_exists('Content-Hmac', $headers)) {
    248248        return false;
    249249      }
     
    251251      $s = hash_hmac('sha256', $message, $this->api_pass, true);
    252252      $hmac = base64_encode($s);
    253       return $headers['Content-HMAC'] == $hmac || $headers['Content-Hmac'] == $hmac;
     253      return $headers['Content-Hmac'] == $hmac;
    254254    }
    255255
Note: See TracChangeset for help on using the changeset viewer.