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

Square: Update checkout API parameters

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      The newer versions (2020-02-26 and above) are incompatible with the current set of parameters, however older versions are compatible with the new set. Update SquareApi::buildPayment to use the new set of parameters. change the code starting at line 151 of components/gateways/nonmerchant/square/lib/square_api.php from:

          // Build payment parameters array
          $params = [
              'redirect_url' => $redirect_url,
              'idempotency_key' => !empty($transaction_id) ? $transaction_id : $unique_id,
              'ask_for_shipping_address' => isset($address),
              'order' => [
                  'reference_id' => !empty($transaction_id) ? $transaction_id : $unique_id,
                  'line_items' => $line_items
              ],
              'pre_populate_buyer_email' => $client_email
          ];
      

      To

          // Build payment parameters array
          $idempotency_key = !empty($transaction_id) ? $transaction_id : $unique_id;
          $params = [
              'redirect_url' => $redirect_url,
              'idempotency_key' => $idempotency_key,
              'ask_for_shipping_address' => isset($address),
              'order' => [
                  'idempotency_key' => $idempotency_key,
                  'order' => [
                      'reference_id' => $idempotency_key,
                      'location_id' => $this->location_id,
                      'line_items' => $line_items
                  ],
              ],
              'pre_populate_buyer_email' => $client_email
          ];
      
      

        Activity

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.0.0 Sprint 3 [ 120 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked lower
        abdy Abdy Franco made changes -
        Assignee Abdy Franco [ abdy ]
        abdy Abdy Franco made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        abdy Abdy Franco made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 33 minutes [ 1980 ]
        Worklog Id 14341 [ 14341 ]
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.0.0 Sprint 3 [ 120 ] 5.0.0 Sprint 4 [ 121 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

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

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 33 minutes
              33m

                Agile