Plugin Directory

Changeset 2808474


Ignore:
Timestamp:
11/01/2022 07:31:22 AM (3 years ago)
Author:
chipasia
Message:

Standardize to secret-key terms

Location:
chip-for-woocommerce/tags/1.1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chip-for-woocommerce/tags/1.1.3/api.php

    r2807585 r2808474  
    1111class WC_Chip_API
    1212{
    13     public function __construct($private_key, $brand_id, $logger, $debug)
     13    public function __construct($secret_key, $brand_id, $logger, $debug)
    1414    {
    15         $this->private_key = $private_key;
     15        $this->secret_key = $secret_key;
    1616        $this->brand_id = $brand_id;
    1717        $this->logger = $logger;
     
    6565    private function call($method, $route, $params = [])
    6666    {
    67         $private_key = $this->private_key;
     67        $secret_key = $this->secret_key;
    6868        if (!empty($params)) {
    6969            $params = json_encode($params);
     
    7676            [
    7777                'Content-type' => 'application/json',
    78                 'Authorization' => 'Bearer ' . $private_key,
     78                'Authorization' => 'Bearer ' . $secret_key,
    7979            ]
    8080        );
  • chip-for-woocommerce/tags/1.1.3/chip-for-woocommerce.php

    r2807585 r2808474  
    110110            if (!$this->cached_api) {
    111111                $this->cached_api = new WC_Chip_API(
    112                     $this->settings['private-key'],
     112                    $this->settings['secret-key'],
    113113                    $this->settings['brand-id'],
    114114                    new ChipWCLogger(),
     
    221221                    'default' => '',
    222222                ),
    223                 'private-key' => array(
     223                'secret-key' => array(
    224224                    'title' => __('Secret key', 'chip-for-woocommerce'),
    225225                    'type' => 'text',
     
    473473
    474474        public function can_refund_order( $order ) {
    475             $has_api_creds = $this->get_option( 'enabled' ) && $this->get_option( 'private-key' ) && $this->get_option( 'brand-id' );
     475            $has_api_creds = $this->get_option( 'enabled' ) && $this->get_option( 'secret-key' ) && $this->get_option( 'brand-id' );
    476476
    477477            return $order && $order->get_transaction_id() && $has_api_creds;
Note: See TracChangeset for help on using the changeset viewer.