Browse documentation
How to configure Google Pay
Google Pay does not work directly inside WebViews due to security restrictions. This guide will help you configure your app to properly handle Google Pay payments.
Prerequisites
- Access to your app's advanced configuration
- Basic understanding of JSON configuration
- Familiarity with regex (regular expressions)
Step-by-Step Configuration
Step 1: Enable Special Pop-up for Payment Handling
First, add the following configuration to enable a special pop-up mechanism:
{
"Regex_Social_Login": {
"Regex_Social_Login_Opening_Method": "popup",
"Regex_Social_Login_Rules": [
{
"Regex": ""
}
]
}
}Step 2: Configure Pop-up for Google Pay Links
Update the configuration to specifically target Google Pay URLs:
{
"Regex_Social_Login": {
"Regex_Social_Login_Opening_Method": "popup",
"Regex_Social_Login_Rules": [
{
"Regex": ".*pay\\.google.*"
}
]
}
}Step 3: Extend Configuration for Multiple Payment Methods
You can expand the configuration to support multiple payment platforms:
{
"Regex_Social_Login": {
"Regex_Social_Login_Opening_Method": "popup",
"Regex_Social_Login_Rules": [
{
"Regex": ".*pay\\.google.*"
},
{
"Regex": ".*paypal.*"
},
{
"Regex": ".*venmo.*"
}
]
}
}Step 4: Configure External Link Handling
Ensure that payment URLs are opened outside the app:
{
"Regex_Internal_External": {
"Internal_External_Rules": [
{
"Regex": ".*pay\\.google.*",
"Internal": false
},
{
"Regex": ".*venmo.*",
"Internal": false
},
{
"Regex": ".*paypal.*",
"Internal": false
}
]
}
}Important Notes
- The `.*` in the regex means "match any characters before or after"
- `pay\\.google` specifically targets Google Pay URLs
Troubleshooting
- If payments still don't work, double-check your regex patterns
- Ensure your configuration is correctly applied
- Verify that the pop-up mechanism is enabled
Best Practices
- Always test payment flows thoroughly after configuration
- Keep your app's configuration up to date
- Consult with MobiLoud for specific implementation details