x

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);
 

 

Tags (1)
3,406 Views
Message 1 of 6
Report
1 Best Answer

Best Answer

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 Best Answer >

4,190 Views
Message 3 of 6
Report
5 REPLIES 5
Square

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


Sean
he/him/his
Product Manager | Square, Inc.
3,396 Views
Message 2 of 6
Report

Best Answer

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.

4,191 Views
Message 3 of 6
Report
Square

@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.
3,393 Views
Message 4 of 6
Report
Square

@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.
3,392 Views
Message 5 of 6
Report

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

3,389 Views
Message 6 of 6
Report