Here is the location_id which we are using LR4NE71KHRBY6.
Are the other payment methods working in sandbox?
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
<meta-data
android:name="sqip.SQUARE_APPLICATION_ID"
android:value="CA_APPLICATION_ID"/>
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.
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 :-
- 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.
- 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.
<meta-data
android:name="sqip.SQUARE_APPLICATION_ID"
android:value="CA_APPLICATION_ID"/>
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?
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.
@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?
What isn’t working based on what the team’s recommended solution? Are you not able to programmatically set the application ID instead of XML to initialize the In-App Payments SDK to country specific application ID for tokenizing the the card?
@Bryan-Square
Are you not able to programmatically set the application ID instead of XML to initialize the In-App Payments SDK to country specific application ID for tokenizing the the card?
==> YES, thats correct. When we try your recommended solution. After we click on Google Pay button, we end up with following screen. Please read last 35 days comments for better understanding the issue.
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 35 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 only Google Pay with two separate Square accounts.
PLEASE SHARE THE SOLUTION or SOURCE CODE WHICH IS WORKING FOR YOUR TEAM. WE WOULD LIKE TO TRY THAT APP RIGHT AWAY. THIS WOULD BE A GREAT HELP!!!
Please reply ASAP
Is it just Google Pay that’s failing. Is the regular card input when initialized this way working?
We are not considering card payment in our usecase. We only use Google pay.
Also we are not sure the card payment whether works or not.
@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?