How can I use the Record Payment API effectively?

Is there an api to collect payment as below ?

Did anyone figure this out?