Skip to content

Commit

Permalink
Merge pull request #3 from veeqtoh/v1.0.3
Browse files Browse the repository at this point in the history
V1.0.3
  • Loading branch information
veeqtoh authored Feb 5, 2025
2 parents 6828393 + 3bb6e14 commit dfbc13e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class PaystackEventListener
*/
public function handle(WebhookReceived $event): void
{
if ($event->payload['type'] === 'invoice.payment_failed') {
if ($event->payload['event'] === 'invoice.payment_failed') {
// Handle the incoming event...
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ protected function handleSubscriptionCreate(array $payload): Response
$plan = $data['plan'] ?? null;
if ($plan) {
$subscription = $user->newSubscription($plan['plan_code'], $plan['name']);
$data['id'] = null;

$subscription->add($data);

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function resume(): static
public function asPaystackSubscription(): mixed
{
try {
$subscriptions = PaystackService::customerSubscriptions($this->user->paystack_id);
$subscriptions = PaystackService::customerSubscriptions($this->user->paystack_customer_id);

if (empty($subscriptions)) {
throw new SubscriptionNotFound('The Paystack customer does not have any subscriptions.');
Expand Down

0 comments on commit dfbc13e

Please sign in to comment.