Apple Pay web sdk with auth + deferred capture with different amount

Hi @Bryan-Square

Here is the location_id which we are using LR4NE71KHRBY6.

Are the other payment methods working in sandbox? :slightly_smiling_face:

Hi @Bryan-Square

In our APP we are using only GPay, and this works in sandbox only if the Square Application ID has been initialised from the AndroidManifest.xml file


If the same is initialised at the runtime, the solution provided by your team earlier in this conversation is not working as expected.

InAppPaymentsSdk.squareApplicationId = USD_APP_ID

Could you tell use how it doesn’t “work as expected?” According to the team it should be that the application id is the application id, however it got set. :slightly_smiling_face:

Hi @Bryan-Square

Problem Statement :-
Currently our App has Google Payments enabled for US location and we want to roll out GPay in Canada region, hence we have two Square Accounts. Now for implementing the transaction smoothly between the two regions we need to configure the Application ID dynamically at runtime and not from the AndroidManifest.xml file using meta-data tags as the manifest is compiled into the APK and we have Single APK for both the locations.

Location ID Used - LR4NE71KHRBY6

Solution Provided By Square Team :-
You can initialize the In-App Payments SDK by doing InAppPaymentsSdk.squareApplicationId = USD_APP_ID.

Solution implemented :-

  1. We have implemented the above solution in the sandbox environment for both Canada and US region at runtime using below code.
if ("US" == value) {
  squareApplicationId = US_APPLICATION_ID
} else if ("CA" == value) {
  squareApplicationId = CA_APPLICATION_ID

// Initialize the Square In-App Payments SDK with the appropriate application ID
InAppPaymentsSdk.squareApplicationId = squareApplicationId

Here is the error, which we receive after clicking on the GPay button and before we create a nonce. Hence the token is not generated.

  1. We confirmed that the same Canada sandbox credential when initialised from the AndroidManifest.xml file, as per the current SDK documentation, we were able to launch Google Pay screen and the payment was processed successfully.

Can you please let us know are there any other steps to be implemented after this code InAppPaymentsSdk.squareApplicationId = squareApplicationId to make it work.

Or are there any other ways of achieving multiple Square application Id at runtime in single APK.

Let me know if any other details are required.

If you have Google Pay enabled on the US account then it will work in all supported regions including Canada. Is the reason you have two Square accounts is to charge in CAD and USD? :slightly_smiling_face:

Yes, parking is our primary focus, and we have Canadian locations that require transactions in CAD currency. The decision to maintain separate accounts for the USA and Canada stems from business considerations. Our main query pertains to handling two distinct accounts within our Android app using your SDKs.

As a reference, we successfully implemented dynamic initialization of the SQUARE_APPLICATION_ID based on location in our iOS app. We seek a similar capability for our Android app without relying on the AndroidManifest.xml tag.

However, despite trying all the solutions provided in the forum, none of them seem to be effective. We have shared our results, including error screenshots and location IDs, but have received irrelevant responses for the past 24 days.

All we need is to initialize the SQUARE_APPLICATION_ID dynamically based on the location in the Android app so that we can charge users in their respective currencies using Google Pay with two separate Square accounts.

Please reply ASAP

@Bryan-Square Could you please provide your response to the post?

I’ve reached out to the team and am waiting on there reply. Once I hear from the team I’ll provide an update. :slightly_smiling_face:

@Bryan-Square Do you have any update from your team?

@Bryan-Square Could you please let us know if you can arrange a call with your development team so that we can finalize this discussion?