Is there an example of how to integrate Square into a back end system using Java?

Hi, I'm new to square but not credit card processing.  I'm currently using Authorize.net's Advanced Integration Method (AIM) to charge cards in an eCommerce application from a back end server.  Is there an example of how to integrate Square into a back end system using Java? 

ANet uses code such as:

 

    import net.authorize.*;
    

    import net.authorize.aim.*;

 

    Merchant  merchant_ = Merchant.createMerchant(Environment.SANDBOX, apiLoginID, transactionKey);

   

   Transaction anetTrans = merchant_.createAIMTransaction(anetTransType, new BigDecimal(ccrTrans.amount()));
      
    Result<Transaction> result = (Result<Transaction>) merchant_.postTransaction(anetTrans);
 

 

4,791 Views
Message 1 of 6
Report
1 Solution
Solution

Thanks Sean.  I have it figured out.   It seems like its just a simple HTTPSConnection with a get for the Locations and a post for the transactions.   I'm having other problems getting the nonce for the transaction from SqPaymentForm but that a different challange.

View Solution >

5,575 Views
Message 3 of 6
Report
5 REPLIES 5
Alumni

@zappullae - Let me check with our developer team on this one. 🙃


Sean
he/him/his
Product Manager | Square, Inc.
4,781 Views
Message 2 of 6
Report
Solution

Thanks Sean.  I have it figured out.   It seems like its just a simple HTTPSConnection with a get for the Locations and a post for the transactions.   I'm having other problems getting the nonce for the transaction from SqPaymentForm but that a different challange.

5,576 Views
Message 3 of 6
Report
Alumni

@zappullae - Glad to hear, and I think that Spenser might be helping you out with that thread. 


Sean
he/him/his
Product Manager | Square, Inc.
4,778 Views
Message 4 of 6
Report
Alumni

@zappullae  - Our developer team did share the following details as well: we don't currently have a Java SDK or examples yet, but you may find using the Unirest or OkHttp libraries useful in making calls to our API. If it's helpful, you can use code samples for other languages as a reference (https://docs.connect.squareup.com/articles/code-samples/). We'll forward Java examples and SDKs to the team as a feature request. 


Sean
he/him/his
Product Manager | Square, Inc.
4,777 Views
Message 5 of 6
Report

Thanks.  I decyphered the PHP code and turned it into Java.

4,774 Views
Message 6 of 6
Report