Add support for parallel payments

By default, only chained payment was taken into account with the is_primary parameter giving the total amount for the order.
Fix syntax as suggested by D. Winterbottom
Merged from upstream mods