Multiple tables for different payment transaction
Always, start with the data model, you will get complete picture. I don't get your complete requirements, from my understanding, the following points are written.

Business Requirements:


A user can subscribe more than one course.
A course may subscribed by more than one user.
A user can subscribe more than one membership.
A membership can be subscribed by more than one user.
A user can have more than User Payment.
A user payment must contain atleast one User.


Data Model:

For the above requirements, the logical data model may look like this:



I think now you can keep your common payment info on UserPayment table. Also have a thought about future requirements, in that case, create separate entities for the following entities (examples).


Tax (type, rate, etc).
Price (type, value, etc).
Membership type (fulltime, quaterly, etc).
Course type (technical, design, etc).


Depends on the requirements, the model will change. First understand the requirements completely and start with the conceptual data model. It is a starting point, you will learn more, I hope this will give you an idea. Thanks!.