I've been working on a camp registration page where an adult registers one or more children for one or more events, with a single Pending contribution to tie it all together (per Xavier's advice here). My API calls successfully create the adult, contribution, children, relationships, participants, and participant payments (a connection to my contribution) without error. However the participants still don't seem to be connected to the payment. When I view a participant record, the total paid shows the full amount with a balance of $0, even though the contribution is $0. When I click View Payments from here, there are no payments to display. When I click Record Payment, I get the error "No payment information found for this record".
Here is a Gist showing just the relevant parts of my code. Any advice is greatly appreciated.