Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

No way to specify the integration ID #94

Closed
mglaman opened this issue Aug 13, 2019 · 9 comments
Closed

No way to specify the integration ID #94

mglaman opened this issue Aug 13, 2019 · 9 comments
Assignees

Comments

@mglaman
Copy link

mglaman commented Aug 13, 2019

There is no way to pass the integration ID in the charge request as integration_id is not present in \SquareConnect\Model\ChargeRequest::$swaggerTypes.

@deanpapastrat deanpapastrat self-assigned this Aug 13, 2019
@deanpapastrat
Copy link
Member

Hey @mglaman, are you referring to client_id or application_id? Square doesn't have an integration_id concept.

@mglaman
Copy link
Author

mglaman commented Aug 13, 2019

@deanpapastrat when we set up the integration for Drupal Commerce we were given an integration ID by our partner manager to help flag Drupal Commerce users which installed our module and setup their OAuth applications. It's been working for a while, but I realized I never open a proper issue 😱

      $charge_request = $charge_request->__toString();
      // The `integration_id` is only valid when live.
      if ($mode == 'live') {
        $charge_request = json_decode($charge_request, TRUE);
        $charge_request['integration_id'] = 'sqi_b6ff0cd7acc14f7ab24200041d066ba6';
        $charge_request = json_encode($charge_request, JSON_PRETTY_PRINT);
      }

      try {
        list($response, $statusCode, $httpHeader) = $api_client->callApi(
          $resourcePath, 'POST',
          $queryParams, $charge_request,
          $headerParams, '\SquareConnect\Model\ChargeResponse'
        );
        if (!$response) {
          return [NULL, $statusCode, $httpHeader];
        }

        /** @var \SquareConnect\Model\ChargeResponse $result */
        $result = ObjectSerializer::deserialize($response, '\SquareConnect\Model\ChargeResponse', $httpHeader);
      }
      catch (ApiException $e) {
        switch ($e->getCode()) {
          case 200:
            $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SquareConnect\Model\ChargeResponse', $e->getResponseHeaders());
            $e->setResponseObject($data);
            break;
        }

        throw $e;
      }

This is what we've had to do instead of just

         $charge_request->offsetSet('integration_id', 'sqi_b6ff0cd7acc14f7ab24200041d066ba6');
         $transactions_api = new TransactionsApi($api_client);
         $result = $transactions_api->charge($this->configuration[$mode . '_location_id'], $charge_request);

@drbyte
Copy link

drbyte commented Aug 13, 2019

Square doesn't have an integration_id concept.

Yes it does. It's just undocumented. It's a partners-only thing.
We had to extend clone the ChargeRequest class and add it ourselves in order for it to work.

I agree with @mglaman -- it'd be preferable if Square built it into their SDK. Thanks Matt for opening the issue! 👍

@mglaman
Copy link
Author

mglaman commented Aug 13, 2019

We had to extend the ChargeRequest class and add it ourselves in order for it to work.

🤔 now that's a much smarter idea!

@deanpapastrat
Copy link
Member

Hey all, wanted to apologize for the misinformation, both of you are 100% right about integration_id. Currently integration_id is not on our list of features to add to the SDKs, but we'd appreciate if you leave a comment in our #feedback channel in the BuildWithSquare Slack 👍

One thing to note: the V2 Payments API does NOT support integration_id at this moment, so please continue to use V2 Transactions until we mention otherwise.

Going to close this out as it's not currently on the roadmap.

@drbyte
Copy link

drbyte commented Aug 16, 2019

Hey all, wanted to apologize for the misinformation, both of you are 100% right about integration_id. Currently integration_id is not on our list of features to add to the SDKs, but we'd appreciate if you leave a comment in our #feedback channel in the BuildWithSquare Slack 👍

One thing to note: the V2 Payments API does NOT support integration_id at this moment, so please continue to use V2 Transactions until we mention otherwise.

Going to close this out as it's not currently on the roadmap.

So ... to be clear, you're saying that supporting your Partner integrations moving forward ... is NOT on your roadmap? And yet you just released an API version that deprecates the feature that does support this part of Partner integrations. Swell.

@deanpapastrat
Copy link
Member

It's not currently on our roadmap for the existing SDKs, such as this one, but we're slowly working on improving our SDKs across the board and that'd be a feature request we can take back to the team.

We will be supporting integration_id the V2 Payments API in the future, but it's not in the launch today, so I wanted to make sure you didn't accidentally upgrade and run into issues.

We're definitely listening to the feedback though, and I'd very, very strongly urge you to tell your partner manager at Square that this is critical for you so we can prioritize it.

@deanpapastrat
Copy link
Member

Please feel free to join the Slack channel we have and DM me (dean-square) - I'd be happy to setup a meeting with our product manager so you can share your feedback with him.

@drbyte
Copy link

drbyte commented Aug 17, 2019

Dean, thanks for the update.

As you've implied, the bigger issues here are not really a discussion suitable for github.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants