Skip to content

Commit

Permalink
common interface that all payment gateway clients will implement
Browse files Browse the repository at this point in the history
  • Loading branch information
felixojiambo committed Dec 16, 2024
1 parent af0c527 commit ac402aa
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.finpay.payment_service.gateways;

import com.finpay.payment_service.dtos.PaymentRequest;
import com.finpay.payment_service.dtos.PaymentGatewayResponse;
import com.finpay.payment_service.dtos.RefundRequest;
import com.finpay.payment_service.dtos.RefundGatewayResponse;

public interface PaymentGateway {

/**
* Processes a payment through the specific gateway.
*
* @param paymentRequest The payment details.
* @return The response from the payment gateway.
*/
PaymentGatewayResponse processPayment(PaymentRequest paymentRequest);

/**
* Processes a refund through the specific gateway.
*
* @param refundRequest The refund details.
* @return The response from the refund gateway.
*/
RefundGatewayResponse processRefund(RefundRequest refundRequest);
}

0 comments on commit ac402aa

Please sign in to comment.