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

          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