From af4dca3ee40dd3ce82641e9b4bed23dabc9735c8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 24 Dec 2022 23:55:07 +0100 Subject: [PATCH] start adding payment api wrapper --- Api/Payment/Charge.php | 27 ++++++ Api/Payment/PaymentAbstract.php | 157 ++++++++++++++++++++++++++++++++ Api/Payment/PaymentFactory.php | 27 ++++++ Api/Payment/Stripe.php | 77 +++++++++++++--- 4 files changed, 275 insertions(+), 13 deletions(-) diff --git a/Api/Payment/Charge.php b/Api/Payment/Charge.php index e69de29bb..a513ceec9 100644 --- a/Api/Payment/Charge.php +++ b/Api/Payment/Charge.php @@ -0,0 +1,27 @@ +con = new \Stripe\StripeClient($apiKey); } - public function createCharge(int $customer, Charge $charge) {} - public function refundCharge(int $customer, int $charge) {} - public function listCharges(int $customer) {} + /** + * {@inheritdoc} + */ + public function createCharge(int $customer, Charge $charge) : void {} - public function addPaymentMethod(int $customer, mixed $paymentMethod) {} - public function removePaymentMethod(int $customer, int $paymentMethod) {} - public function modifyPaymentMethod(int $customer, mixed $paymentMethod) {} - public function listPaymentMethods(int $customer) {} + /** + * {@inheritdoc} + */ + public function refundCharge(int $customer, Charge $charge) : void {} - public function addSubscription(int $customer, mixed $subscription) {} - public function removeSubscription(int $customer, int $subscription) {} - public function modifySubscription(int $customer, mixed $subscription) {} - public function listSubscriptions(int $customer) {} + /** + * {@inheritdoc} + */ + public function listCharges(int $customer, \DateTime $start, \DateTime $end) : void {} + + /** + * {@inheritdoc} + */ + public function addPaymentMethod(int $customer, mixed $paymentMethod) : void + { + $this->con->paymentMethods->attach(); + } + + /** + * {@inheritdoc} + */ + public function removePaymentMethod(int $customer, mixed $paymentMethod) : void {} + + /** + * {@inheritdoc} + */ + public function modifyPaymentMethod(int $customer, mixed $paymentMethod) : void {} + + /** + * {@inheritdoc} + */ + public function listPaymentMethods(int $customer) : void {} + + /** + * {@inheritdoc} + */ + public function addSubscription(int $customer, mixed $subscription) : void {} + + /** + * {@inheritdoc} + */ + public function removeSubscription(int $customer, mixed $subscription) : void {} + + /** + * {@inheritdoc} + */ + public function modifySubscription(int $customer, mixed $subscription) : void {} + + /** + * {@inheritdoc} + */ + public function listSubscriptions(int $customer) : void {} }