We’d recommend using bfjs for the payment capture on your client-side, and using API for everything else.
https://github.com/billforward/billforward-js .