Skip to content

Conversation

@jules-paystack
Copy link

Summary

Resolves #60 Removes the unmaintained yabacon/paystack-php SDK (broken on PHP 8.3+) and replaces it with a lightweight Gateway/PaystackApiClient using curl directly.

Changes

  • Custom API client (Gateway/PaystackApiClient.php) — handles transaction initialization, verification, webhook signature validation, and plugin tracker logging via curl
  • Backward-compatible CSP — replaced csp_whitelist.xml with a PHP-based CspPolicyCollector that works across all Magento 2.4.x versions (the XML version schema changed in 2.4.8)
  • PHP 8.2+ fix — added missing $store property declaration in ConfigProvider to resolve dynamic property deprecation
  • Payment verification fix — fixed strict type comparison (===) for quoteId that caused order status to stay "pending" after successful payment
  • Email error handling — wrapped orderSender->send() in try-catch so email delivery failures don't break the payment verification flow
  • Docker dev environment (dev/) — one-command setup with Magento 2.4.8-p3, OpenSearch, 5 test products with images, and pre-configured Paystack test mode
  • Version bump to 3.0.0

Test plan

  • Inline (popup) payment flow — order moves to "processing"
  • Standard (redirect) payment flow — order moves to "processing"
  • Webhook receives charge.success and updates order
  • Closed payment page without completing — order stays "pending" (correct)
  • Fresh Docker setup from dev/ directory works end-to-end

- Replace the unmaintained yabacon/paystack-php SDK (broken on PHP 8.3+) with a lightweight Gateway/PaystackApiClient using curl directly.
- Replace CSP XML whitelist with PHP-based PolicyCollector for backward compatibility across Magento versions. Fix PHP 8.2+ dynamic property deprecation in ConfigProvider and quoteId type mismatch in payment verification.

Closes PaystackHQ#60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Payment Verification Fails on PHP 8.3+ Due to yabacon/paystack-php Compatibility Issues

1 participant