make bogus gateway match actual gateways. ie. don't assign profile id for failed payments

fix handling of retry payments and multiple payments

fixes #5499