• Getting Started
    • Mobile Integration (Android/IOS)
      Enterprise Solutions
      Accept Payments
      Process Payments
      Disbursals
      API References
      Webhooks
      Testing
      Refunds
      Guides
      Other Processes
      Mini Program Platform
        Website Integration

      paytmCaptureImageFromCamera JS API

      Use Case


      This bridge when invoked (assuming that camera permissions are already granted), opens the camera, and once the user clicks a picture, passes data to the web context. To enable the Camera functionality for your PWA in Android you need to implement this JS API Bridge. Without this implementation the camera functionality might not work as intended.

      Note: In iOS no implementation is needed and web methods to invoke / use camera will work. This bridge only enables camera access in Android


      Request Attributes

      Content format: JSON

      ParameterDescriptionRequiredExample Value
      requestCoderequest code for the activity(This is dummy no. , Will be given by Android Dev)Yes8778
      titleTitle to be displayed on activity picker dialogNoPaytm

      Response Attributes

      Success:

      Note: Response comes in json with 'data' as key
      ParameterDescriptionExample Value
      data.base64The base 64 string of the image received1
      data.meta.imageNameImageName100002890.jpg
      data.meta.imageSizeImage size in bytes1941277
      data.meta.imageTypeThis includes image type (jpg, png, etc)"jpg"

      Error Responses:

      ParameterDescriptionExample Value
      errorError2
      messageError messageinvalid parameters

      ERROR CODES

      codeDescription
      2Invalid parameter
      1ERR_MSG


      Request CodeResponse JSON
      
                  const requestObject={
                          requestCode: 8778,
                          title: 'Title to be displayed on activity picker dialog'
                  }
      
                  JSBridge.call('paytmCaptureImageFromCamera',requestObject,
                   function(result) {
                      console.log(JSON.stringify(result))
                 });