build/payment.go
func (b *PaymentBuilder) Mutate(muts ...interface{}) {
	for _, m := range muts {
		if _, ok := m.(PayWithPath); ok {
			b.PathPayment = true
			break
		}
	}

	for _, m := range muts {
		var err error
		switch mut := m.(type) {
		case PaymentMutator:
			if b.PathPayment {
				err = mut.MutatePayment(&b.PP)
			} else {
				err = mut.MutatePayment(&b.P)
			}
		case OperationMutator:
			err = mut.MutateOperation(&b.O)
		default:
			err = errors.New("Mutator type not allowed")
		}

		if err != nil {
			b.Err = err
			return
		}
	}
}
func (b *PaymentBuilder) Mutate(muts ...interface{}) {
	for _, m := range muts {
		if _, ok := m.(PayWithPath); ok {
			b.PathPayment = true
			break
		}
	}

	for _, m := range muts {
		var err error
		switch mut := m.(type) {
		case PaymentMutator:
			if b.PathPayment {
				err = mut.MutatePayment(&b.PP)
			} else {
				err = mut.MutatePayment(&b.P)
			}
		case OperationMutator:
			err = mut.MutateOperation(&b.O)
		default:
			err = errors.New("Mutator type not allowed")
		}

		if err != nil {
			b.Err = err
			return
		}
	}
}
// Mutate applies the provided mutators to this builder's payment or operation.