feat(payment): add refund and reversal functionality to payment gateways
- Implemented `refund` and `reverse` methods in `PaymentGatewayInterface`. - Added `PaymentRefundResult` class to handle refund operation results. - Enhanced `MockGateway` and `SepGateway` to support refund and reversal operations. - Updated `PaymentManager` to include `refundPayment` and `reversePayment` methods for handling refunds and reversals in transactions. - Modified `ClinicSubscriptionRepository` and `SubscriptionService` to manage subscriptions during refunds. - Added admin API endpoints for processing refunds and reversals. - Updated security headers to allow form actions to the sandbox environment. - Documented the new refund and reversal features in the API documentation.
This commit is contained in:
@@ -53,4 +53,15 @@ class ClinicSubscriptionRepository extends ServiceEntityRepository
|
||||
$this->getEntityManager()->persist($subscription);
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
|
||||
public function findByPayment(\App\Payment\Entity\Payment $payment): ?ClinicSubscription
|
||||
{
|
||||
return $this->findOneBy(['payment' => $payment]);
|
||||
}
|
||||
|
||||
public function remove(ClinicSubscription $subscription): void
|
||||
{
|
||||
$this->getEntityManager()->remove($subscription);
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user