inital commit
This commit is contained in:
36
app/Services/Payment/Payment.php
Normal file
36
app/Services/Payment/Payment.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Payment;
|
||||
|
||||
class Payment
|
||||
{
|
||||
|
||||
private array $paymentData = [];
|
||||
private PaymentInterface $payment;
|
||||
|
||||
public function __construct(PaymentInterface $payment, $inputData)
|
||||
{
|
||||
$this->paymentData = $inputData;
|
||||
$this->payment = $payment;
|
||||
}
|
||||
|
||||
public function pay()
|
||||
{
|
||||
return $this->payment->makePayment($this->payment->prepareData($this->paymentData));
|
||||
}
|
||||
|
||||
public function makeRecurringPayment()
|
||||
{
|
||||
return $this->payment->makeRecurringPayment($this->paymentData);
|
||||
}
|
||||
|
||||
public function deleteSubscription()
|
||||
{
|
||||
return $this->payment->deleteRecurringPayment($this->paymentData);
|
||||
}
|
||||
public function getSubscriptionInfoBySubscriptionId()
|
||||
{
|
||||
return $this->payment->getRecurringInfoBySubscriptionId($this->paymentData);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user