Transaction API is deprecated as of latest release 2.20191217.1 of SDK

Created on 8 January 2020, almost 5 years ago
Updated 27 October 2023, about 1 year ago

I am getting the following php debug message with both charges and refunds. According to this issue I posted, this is because of Transaction API being deprecated in the latest release 2.20191217.1. These are the errors:

User deprecated function: �[33mCalling deprecated API: TransactionsApi.charge�[0m in SquareConnect\Api\TransactionsApi->charge() (line 191 of /*/*/*/code/sites/all/libraries/square/lib/Api/TransactionsApi.php).

User deprecated function: �[33mCalling deprecated API: TransactionsApi.createRefund�[0m in SquareConnect\Api\TransactionsApi->createRefund() (line 300 of /*/*/*/code/sites/all/libraries/square/lib/Api/TransactionsApi.php).

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States DustinYoder

    I guess there is still no way to use Square payments in D7? Just checking if there is any progress on this.

  • 🇺🇸United States DustinYoder

    I have taken a week and completely re-wrote the Drupal 7 module. It is working with the Square PHP SDK version: "27.0.0.20230517".
    It uses the Web SDK at https://web.squarecdn.com/v1/square.js for embedding the form and creating the token. I currently have this working on sandbox with cardonfile and commerce_recurring. It is still rough, but I'm wondering if this would still be considered 'Square Connect' and should I contribute to this module, or where would this go? I have refund, and card delete working. I did not complete void, and I don't think this Square api supports editing an existing card on file.
    I would love help finishing and polishing this module and could use help knowing where to put this code because I'm not currently using Git and would possibly contribute it but can't afford to spend too much more time on this. Unless someone wants to help sponsor development to get this completed.
    This ended up being quite a rewrite, there is so much that needed to be changed, but my test site is fairly complex, so I think it is probably 80% complete at this point since I needed the cardonfile functionality.
    Thanks for the advice.

  • 🇺🇸United States GaryDev

    Hello All,
    Dustin, what is the status of your updated module for Square Payments, please?

  • 🇺🇸United States DustinYoder

    I am using it currently but still have two known bugs I'm working on today. I think it is a little rough, but it keeps getting better. Square now requires using discounts rather than negative line items so I had to fix that. I am having some issue currently with the JS on the order payment add form, but am hopeful to fix that today. Some kind of 'await' issue with the multiple 'attach' behaviors that fire. I have only tested with my exact setup so far, however, so probably unstable. But I can see why this hasn't been done already. Almost the entire module needed to be modified in some way. I will try to post when I have it running for a bit with no issues on my customer's site.

  • 🇺🇸United States DustinYoder

    My version of this module does now seem to be working in my instance fairly well. I fixed several bugs with discounts and tax rounding etc, etc. I'm sure there are more possible bugs, but we are processing something like 5 or more successful transactions each day, so I would consider helping others test this on their site. Probably need to monitor it for a little and just make sure things are working. But I would possibly be willing to help with that for some kind of fee.

  • 🇺🇸United States GaryDev

    Greetings All,
    Dustin, I'll take you up on the suggestion. I need to implement a replacement. I'm a willing participant in the experiment. Please let me know what needs to happen to move forward and install your module in my site.

    Thanks,
    Gary

  • 🇺🇸United States GaryDev

    Bump

  • 🇺🇸United States DustinYoder

    GaryDev has now successfully installed and is using my updated Square module for D7. It seems like we have better install docs now and this might actually be usable for others if anyone is interested. It uses the new SDK for Square and did require an complete rewrite of the module.

  • 🇺🇸United States DustinYoder

    So here is a zip file of the completely rewritten module. GaryDev has helped test and do some instructions updating. I am simply putting the code out here in hopes that someone will make a new branch with this. It is not technically Square Connect at this point so maybe just a new module? I just spent a lot of time on this and can't put too much more into it. But it is a shame if it isn't made available.

    This module uses the new oauth2 api. The api library changes each month for square, so we might have to update more code in the module. I think we have it set to allow anything after the version I used to build it. But reach out if there issues installing and getting it to work.

Production build 0.71.5 2024