Navigation:
        
          
    
   AADE Protocol 
    
   Native Checkout v2 
    
   About Viva 
    
   Getting started 
    
   Payment methods 
    
   Integration reference 
    
   Plugins 
    
   Smart Checkout 
    
   Marketplaces 
    
   Marketplaces - OLD 
    
   Payment tools 
    
   ISV Partner program 
    
   APIs for payments 
    
   Webhooks for payments 
    
   Tutorials 
    
   Code samples for payments 
    
   Issuing 
    
   APIs for APM provisioning 
    
   In-person payments  
    
  - 
   Softpos Apps  
    
  -- 
   Tap on Any Device on Android  
    
  --- 
   Sale request 
    
  --- 
   Pre-auth request 
    
  --- 
   Capture Pre-auth request 
    
  --- 
   Cancel/Refund request 
    
  --- 
   Rebate request 
    
  --- 
   Fast Refund request 
    
  --- 
   Unreferenced Refund 
    
  --- 
   Abort request 
    
  --- 
   Batch request 
    
  --- 
   Reprint request 
      --- Set Mode request 
    
  --- 
   Transaction Details request 
      --- P2P Protocol Activation 
    
  --- 
   Foreground request  
  
    
  --- 
   Set Printing Settings request 
    
  --- 
   Get Printing Settings request 
    
  --- 
   Send Logs request 
    
  --- 
   POS Activation request 
    
  --- 
   Get Activation Code request 
    
  --- 
   Decimal Amount Mode request 
    
  --- 
   Reset request 
  
    
  -- 
   Tap on Any Device on iOS 
  
    
  - 
   Payment Terminal API 
      - Dynamic Currency Conversion 
      - Enable/Disable Multi-merchant 
      - Surcharge 
      - Dynamic Descriptor 
      - Enable/Disable Instalments & Tips 
      - Rebate and Fast Refund 
      - Card Present Tokenization 
      - Mail Order/Telephone Order (MOTO)MOTO payments 
      - Offline Payments 
      - Sample Receipts 
    
  - 
   SDKs 
  
    
   Client case studies 
    
   Release Notes 
    
   Contact & Support 
    
   Fiscalisation 
    
   iris 
         
       
    Foreground request 
    
    
An overview of the Foreground request  message for Android. 
Overview 
👉 The Foreground request is used to bring to the ‘Viva.com Terminal’ application to the foreground when desired. 
The client app must implement a mechanism to send messages using Android intents and URI calls and to receive the result in a custom URI callback.
Foreground request  originating from the client app to bring ‘Viva.com Terminal’ application to foreground. 
Foreground request 
For a typical Foreground request, the client app must provide the following information:
  
    Field 
    Description 
    Example 
    Required 
    Card terminal support 
    Max Length 
    Type 
   
 
  
    scheme 
    The Viva's custom URL scheme, the host and the version. 
    'vivapayclient://pay/v1' 
    ✅ 
     
  
    merchantKey 
    The merchant's key. For successful validation, should not be empty.Deprecated : you may pass any value. 
    'SG23323424EXS3' 
     
  
    appId 
    The client app ID. For successful validation, should not be empty. 
    'com.example.myapp' 
    ✅ 
     
  
    action 
    The parameter to trigger an action. For foreground action, it should be set as 'foreground'. 
    'foreground' 
    ✅ 
     
  
    callback 
    The URI callback that will handle the result. For successful validation, should not be empty. 
    'mycallbackscheme://result' 
    ✅ 
     
 
This action does not send back a response.
The above information elements must create a URI call, i.e.
String  reqStr  =  "vivapayclient://pay/v1" 
		+  "?merchantKey=" MY_MERCHANT_KEY "
 		+ " & appId = com . example . myapp "
 		+ " & action = foreground "
 		+ " & callback = mycallbackscheme: //result";
 Intent  payIntent  =  new  Intent ( Intent . ACTION_VIEW ,  Uri . parse (  reqStr )); 
payIntent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ); 
payIntent . addFlags ( Intent . FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS ); 
startActivity ( payIntent ); Key to card terminal product categories 
To understand the icons used on the above table, see the below table.
  
    Product category 
    Terminal models 
    Icon 
   
 
  
    Android Card Terminals 
    Android Card Terminal Ethernet, Android Card Terminal 4G, Mobile Card Terminal Plus, Mobile Card Terminal. 
     
  
    'Viva.com Terminal' application for Android 
    Mini Card Reader, Pocket Card Terminal connected via Bluetooth or USB to the 'Viva.com Terminal' application for Android. 
     
  
    Linux Card Terminals 
    Countertop, IM20, S900, S800, D200. 
     
 
Get Support 
If you would like to integrate with Viva, or if you have any queries about our products and solutions, please see our Contact & Support