juzaweb / payment-method
Payment method plugin for Juzaweb CMS
Installs: 33
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:juzaweb-plugin
Requires
- league/omnipay: ^3
- omnipay/paypal: ^3.0
This package is auto-updated.
Last update: 2024-10-30 12:00:37 UTC
README
- Paypal Payment support
- Stripe Payment support
Development
Add a payment method
- Create class implement PaymentMethodInterface
<?php // PaymentMethodInterface interface namespace Juzaweb\PaymentMethod\Support; interface PaymentMethodInterface { public function purchase(array $params): PaymentMethodInterface; public function completed(array $params): PaymentMethodInterface; public function isSuccessful(): bool; public function isRedirect(): bool; public function getRedirectURL(): null|string; public function getMessage(): string; public function getPaymentId(): string; public function setPaymentId(string $paymentId): static; public function getAmount(): float; public function setAmount(float $amount): static; }
View example PayPal payment
- Register payment method in PaymentMethodManager
In your HookAction handle
use Juzaweb\PaymentMethod\Contracts\PaymentMethodManager; //... public function handle(): void { $this->addAction(Action::INIT_ACTION, [$this, 'paymentMethodInit']); } public function paymentMethodInit(): void { app()->make(PaymentMethodManager::class)->register( 'paypal', Paypal::class ); }