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

Stripe Payments: Update API library to newer version

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.8.0
    • Fix Version/s: 5.9.0-b1
    • Component/s: Gateways
    • Labels:
      None

      Description

      Look into updating Stripe Payments to update the API library to use the latest version of their API.

        Activity

        admin Paul Phillips created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.9.0 Sprint 4 [ 187 ]
        Hide
        jonathan Jonathan Reissmueller added a comment - - edited

        We'll want to explicitly target an api version. The code below targets the currently compatible version but we can update the gateway to handle a more recent version and update to target it.

        In components/gateways/merchant/stripe_payments/stripe_payments.php change

            /**
             * Loads the API if not already loaded
             */
            private function loadApi()
            {
                Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php');
                Stripe\Stripe::setApiKey((isset($this->meta['secret_key']) ? $this->meta['secret_key'] : null));
        
                // Include identifying information about this being a gateway for Blesta
                Stripe\Stripe::setAppInfo('Blesta ' . $this->getName(), $this->getVersion(), 'https://blesta.com');
            }
        

        To

            /**
             * Loads the API if not already loaded
             */
            private function loadApi()
            {
                Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php');
                Stripe\Stripe::setApiKey((isset($this->meta['secret_key']) ? $this->meta['secret_key'] : null));
        
                // Include identifying information about this being a gateway for Blesta
                Stripe\Stripe::setAppInfo('Blesta ' . $this->getName(), $this->getVersion(), 'https://blesta.com');
        
                // Set API version
                Stripe\Stripe::setApiVersion('2022-08-01');
            }
        
        Show
        jonathan Jonathan Reissmueller added a comment - - edited We'll want to explicitly target an api version. The code below targets the currently compatible version but we can update the gateway to handle a more recent version and update to target it. In components/gateways/merchant/stripe_payments/stripe_payments.php change /** * Loads the API if not already loaded */ private function loadApi() { Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php'); Stripe\Stripe::setApiKey((isset($ this ->meta['secret_key']) ? $ this ->meta['secret_key'] : null )); // Include identifying information about this being a gateway for Blesta Stripe\Stripe::setAppInfo('Blesta ' . $ this ->getName(), $ this ->getVersion(), 'https: //blesta.com'); } To /** * Loads the API if not already loaded */ private function loadApi() { Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php'); Stripe\Stripe::setApiKey((isset($ this ->meta['secret_key']) ? $ this ->meta['secret_key'] : null )); // Include identifying information about this being a gateway for Blesta Stripe\Stripe::setAppInfo('Blesta ' . $ this ->getName(), $ this ->getVersion(), 'https: //blesta.com'); // Set API version Stripe\Stripe::setApiVersion('2022-08-01'); }
        jonathan Jonathan Reissmueller made changes -
        Assignee Jonathan Reissmueller [ jonathan ]
        jonathan Jonathan Reissmueller made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 1 hour, 21 minutes [ 4860 ]
        Worklog Id 16657 [ 16657 ]
        jonathan Jonathan Reissmueller made changes -
        Status Open [ 1 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Time Spent 1 hour, 21 minutes [ 4860 ] 1 hour, 41 minutes [ 6060 ]
        Worklog Id 16668 [ 16668 ]
        abdy Abdy Franco made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/Dec/23

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour, 41 minutes
              1h 41m

                Agile