Published on : June 11, 2020

Create a new service under Loan Services

Loan service URL : https://loantap.in/wp-admin/edit.php?post_type=loan_service

Do the necessary checks and return error if fails.

start the process

[do.@process]

Run the module of the current process definition

[service.run service='all_process.ekyc' /]

set the active process type by reference

[ref.add active_process ref_to=cprocess_ekyc /]

Prepare data in @process.data.body to execute 3rd Party API

Initiate the process

[active_process.initiate o.set=template.payload/]

Return if there is error in the payload

[template.return template.payload c.aw2_error="template.payload"/]

Merge the payload data in @process.data

Create an entry in process meta, call the service: cprocess.process.meta

Sample entries for multiple processes

Sample entry for a single processes

Return if there is error while creating the process

Prepare meta data for lapp_processes

Delete the existing entry from lapp_processes (This is optional based on your requirement)

[clapp_process.delete reference_id=<lapp_id> coll_id='khosla-ekyc' o.set=template.lapp_process_ack/]

Create entry in lapp_processes

[clapp_process.create meta=<lapp_process_meta array> coll_id='khosla-ekyc' o.set=template.lapp_process_ack/]

Sample entry

If required, prepare meta data for lapp_meta

Update the lapp_meta

[clapp.update lapp_id=<lapp_id> meta=<lapp_meta array> o.set=template.lapp_ack/]

Prepare the turnaround meta data

create a turnaround entry against the process, call the service: process_turnaround.entry

Set ack

[template.set ack.status='success' ack.message='<your message>' (any other data you would like to return) /]

Return ack

[template.return template.ack/]