This approach uses overloading, i.e. having several functions with the same name but with different argument types.
It’s not true polymorphism: it works only if the type of the payment details (e.g. DebitCard, CreditCard, ...) are known at compile time.
Your app will then needs to foresee different code for handling each type. Typically, you’d end with:
if (...) {
...
p.processPayment(debitcard);
} else if (...) {
...
p.processPayment(creditcard);
} else ....
This leads to a lot of redundant boilerplate code and is difficult to maintain if you’d add a new payment method (e.g. BitCoinWallet or PayPalDetail)
To do it right, abstract on the payment details. Create a general interface, e.g. IPaymentDetail that your payment processor needs. Make CreditCard, DebitCard etc... be implementations of IPaymentDetail. Same for the transaction details and use:
public class PaymentProcessor
{
ITransactionDetail processPayment(IPaymentDetail);
...
}