Plugin Directory

Changeset 2302622


Ignore:
Timestamp:
05/11/2020 12:17:11 PM (6 years ago)
Author:
spektrainc
Message:

Added sub accounts to settings

Location:
spektra/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • spektra/trunk/readme.txt

    r2276449 r2302622  
    6868* Prefill customer data from billing details
    6969
     70= 1.0.4 =
     71* Added sub accounts to settings
     72
    7073== Upgrade Notice ==
    7174
     
    7982Prefill customer data from billing details
    8083
     84= 1.0.1 =
     85Receive Payments in Sub Account
     86
    8187
    8288== Arbitrary section ==
  • spektra/trunk/spektra-wc-gatway.php

    r2276445 r2302622  
    6464                $this->private_key = $this->livemode ? $this->get_option( 'private_key' ) : $this->get_option( 'test_private_key' );
    6565                $this->public_key = $this->livemode ? $this->get_option( 'public_key' ) : $this->get_option( 'test_public_key');
     66               
     67                $this->sub_account_enabled = $this->get_option( 'sub_account_enabled' ) === 'yes';
     68                $this->sub_account = $this->get_option( 'sub_account' );
    6669
    6770                if ($this->livemode) {
     
    132135                        'description' => 'This is your live private key generated from your Spektra dashboard'
    133136                    ),
     137                    'sub_account_enabled' => array(
     138                        'title'       => 'Use Sub Account',
     139                        'label'       => 'Use Sub Account',
     140                        'type'        => 'checkbox',
     141                        'description' => 'If enabled, all payments will be received in your sub-account indicated below',
     142                        'default'     => 'no'
     143                    ),
     144                    'sub_account' => array(
     145                        'title'       => 'Sub Account',
     146                        'type'        => 'text',
     147                        'description' => 'Sub Account name from your Spektra dashboard'
     148                    ),
    134149                    'livemode' => array(
    135150                        'title'       => 'Production mode',
     
    246261
    247262                $order_description = implode(', ', $order_array);
     263
     264                $sub_account_name = '';
     265
     266                if ($this->sub_account_enabled){
     267                    if (isset($this->sub_account) && $this->sub_account !== ''){
     268                        $sub_account_name = $this->sub_account;
     269                    }
     270                }
    248271               
    249272                $postdata ="{
     
    256279                    },
    257280                    \"description\":\"{$order_description}\",
     281                    \"spektraAccountName\":\"{$sub_account_name}\",
    258282                    \"successURL\":\"{$successUrl}\",
    259283                    \"cancelURL\":\"{$cancelUrl}\"
Note: See TracChangeset for help on using the changeset viewer.