Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-3505

Add option to disable ACH/CC payments for new Order signups

    Details

      Description

      When a user signs up from the Order system, a new client is created and sets a few override settings. This needs to be updated to set additional setting overrides for whether to allow ACH/CC payments, which are settings already in the core.

        Activity

        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        This task will add a configurable setting to the Order plugin to control this behavior. In the interim, however, it is possible to disable ACH/CC payments from being created/accepted on signup via the Order plugin by updating a couple files.

        1. Update /app/models/clients.php, i.e. Clients::create
          • Find ~line 128
            $fields = [
                'autodebit', 'autosuspend', 'default_currency', 'inv_address_to',
                'inv_method', 'language', 'tax_exempt', 'tax_id', 'username_type',
                'send_registration_email', 'receive_email_marketing'
            ];
            
          • Add the "payments_allowed_ach" and "payments_allowed_cc" settings to that list, i.e.:
            $fields = [
                'autodebit', 'autosuspend', 'default_currency', 'inv_address_to',
                'inv_method', 'language', 'tax_exempt', 'tax_id', 'username_type',
                'send_registration_email', 'receive_email_marketing',
                'payments_allowed_ach', 'payments_allowed_cc'
            ];
            
        2. Update /plugins/order/controllers/signup.php, i.e. Signup::index
          • Find ~line 88
            $client_info['settings'] = [
                'username_type' => $this->post['username_type'],
                'tax_id' => ($show_client_tax_id == 'true' ? $this->post['tax_id'] : ''),
                'default_currency' => $this->SessionCart->getData('currency'),
                'language' => $company_settings['language'],
                'receive_email_marketing' => (isset($this->post['receive_email_marketing'])
                    ? $this->post['receive_email_marketing']
                    : 'false'
                )
            ];
            
          • Add the "payments_allowed_ach" and "payments_allowed_cc" settings to that list and set them to "false" to disable them automatically for any new signups, i.e.:
            $client_info['settings'] = [
                'username_type' => $this->post['username_type'],
                'tax_id' => ($show_client_tax_id == 'true' ? $this->post['tax_id'] : ''),
                'default_currency' => $this->SessionCart->getData('currency'),
                'language' => $company_settings['language'],
                'receive_email_marketing' => (isset($this->post['receive_email_marketing'])
                    ? $this->post['receive_email_marketing']
                    : 'false'
                ),
                'payments_allowed_ach' => 'false',
                'payments_allowed_cc' => 'false'
            ];
            

        On the client's profile page, under "Payment Accounts", there is a widget cog icon that, when clicked, takes you to set these settings for the client. This will allow staff to re-enable ACH/CC payment accounts manually after they've signed up.

        Show
        tyson Tyson Phillips (Inactive) added a comment - This task will add a configurable setting to the Order plugin to control this behavior. In the interim, however, it is possible to disable ACH/CC payments from being created/accepted on signup via the Order plugin by updating a couple files. Update /app/models/clients.php, i.e. Clients::create Find ~line 128 $fields = [ 'autodebit', 'autosuspend', 'default_currency', 'inv_address_to', 'inv_method', 'language', 'tax_exempt', 'tax_id', 'username_type', 'send_registration_email', 'receive_email_marketing' ]; Add the "payments_allowed_ach" and "payments_allowed_cc" settings to that list, i.e.: $fields = [ 'autodebit', 'autosuspend', 'default_currency', 'inv_address_to', 'inv_method', 'language', 'tax_exempt', 'tax_id', 'username_type', 'send_registration_email', 'receive_email_marketing', 'payments_allowed_ach', 'payments_allowed_cc' ]; Update /plugins/order/controllers/signup.php, i.e. Signup::index Find ~line 88 $client_info['settings'] = [ 'username_type' => $ this ->post['username_type'], 'tax_id' => ($show_client_tax_id == ' true ' ? $ this ->post['tax_id'] : ''), 'default_currency' => $ this ->SessionCart->getData('currency'), 'language' => $company_settings['language'], 'receive_email_marketing' => (isset($ this ->post['receive_email_marketing']) ? $ this ->post['receive_email_marketing'] : ' false ' ) ]; Add the "payments_allowed_ach" and "payments_allowed_cc" settings to that list and set them to "false" to disable them automatically for any new signups, i.e.: $client_info['settings'] = [ 'username_type' => $ this ->post['username_type'], 'tax_id' => ($show_client_tax_id == ' true ' ? $ this ->post['tax_id'] : ''), 'default_currency' => $ this ->SessionCart->getData('currency'), 'language' => $company_settings['language'], 'receive_email_marketing' => (isset($ this ->post['receive_email_marketing']) ? $ this ->post['receive_email_marketing'] : ' false ' ), 'payments_allowed_ach' => ' false ', 'payments_allowed_cc' => ' false ' ]; On the client's profile page, under "Payment Accounts", there is a widget cog icon that, when clicked, takes you to set these settings for the client. This will allow staff to re-enable ACH/CC payment accounts manually after they've signed up.

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              31/Mar/20

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours, 56 minutes
              2h 56m

                Agile