create function to build the payment object data in js