Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pakasir Sdk Laravel Package

fadhila36/pakasir-sdk

Laravel SDK type-safe untuk integrasi Pakasir Payment Gateway: QRIS, Virtual Account multi-bank, dan PayPal. Dilengkapi kalkulasi fee otomatis, timeout/retry, logging, Events, Notifications, serta verifikasi webhook anti-spoofing.

View on GitHub
Deep Wiki
Context7
v2.0.0

We are thrilled to announce the official release of v2.0.0 of the Pakasir Laravel SDK!

This is a major upgrade that completely modernizes the package codebase to align with PHP 8.3+ and Laravel 11 / 12 / 13+ standards, introducing robust enterprise features, strict type safety, automatic event dispatching, and secure webhook verification.


🚨 BREAKING CHANGES & UPGRADE GUIDE

To adopt v2.0.0, please note the following breaking architectural improvements:

  • PHP Version Support: Elevated minimum required PHP version to ^8.3. PHP 8.1 and 8.2 are no longer supported.
  • Laravel Version Support: Elevated minimum required Laravel version to ^11.0. Laravel 10.0 is no longer supported (EOL).
  • Strict Response DTOs: All client methods now return strict, type-safe, immutable PHP 8.3 readonly Data Transfer Objects (DTOs) instead of raw associative arrays.
    • createPayment() returns TransactionCreateResponse DTO.
    • detailPayment(), cancelPayment(), simulationPayment() return TransactionDetailResponse DTO.
    • verifyWebhook() returns WebhookPayload DTO.

🚀 Key Features

1. Webhook Spoofing Protection (Double-Check Security)

Since Pakasir webhooks do not support cryptographic signatures, v2.0.0 introduces an automated, highly secure double-check validation. When you invoke verifyWebhook(), the SDK:

  1. Validates the basic schema structure, project slug, and expected payment amount.
  2. Automatically makes a secure back-channel API call to the Pakasir servers to fetch the transaction detail and verify that the payment state is genuine, preventing webhook spoofing attacks.

2. Enterprise Connection Handling

We have introduced configurable HTTP client settings in config/pakasir.php to handle flaky networks:

  • timeout: Set custom connection and response timeouts.
  • retry_attempts / retry_delay: Automatically retry failed requests with modern exponential delay handling.
  • logging_enabled: Real-time logging of all outbound payment streams and inbound responses directly to Laravel logs for debugging.

3. Out-of-the-Box Laravel Events & Notifications

  • Lifecycle Events: The SDK now dispatches native Laravel events to hook into your business workflows:
    • TransactionCreated
    • TransactionCanceled
    • WebhookReceived
    • PaymentCompleted
  • Payment Notifications: A new PaymentLinkNotification class is included to easily send payment links to your customers via Email or Database notifications.

4. Smart Enums & QRIS Helper

  • Modernized PaymentMethod backed enums with built-in fee logic and minimum transaction amount rules.
  • Added QRISHelper helper class to analyze, format, and sanitize EMVCo standard QR codes.

🛠️ Refactored Clean Architecture

  • Dependency Injection: Registered container alias Fadhila36\Pakasir\Contracts\PakasirInterface to enable full interface binding.
  • IDE Friendly: Fully upgraded Facade with complete PHPDocs supporting autocompletion in PhpStorm, VSCode, and other editors.
  • Strict Typing Enforced: Enforced declare(strict_types=1) across all components, styled with laravel/pint, and verified green on PHPStan Level 8.
  • Modern CI Matrix: Modernized GitHub Actions to run automated testing with Pest 4.0 and PHPUnit 12.0 on PHP 8.3–8.4 and Laravel 11–13.

📦 Installation & Setup

  1. Install the package:
    composer require fadhila36/pakasir-sdk
    ```bash
    
    
  2. Publish the configuration:
php artisan vendor:publish --provider="Fadhila36\Pakasir\PakasirServiceProvider" --tag="config"

3.⚡** Quick Example**

use Fadhila36\Pakasir\Enums\PaymentMethod;
use Fadhila36\Pakasir\Facades\Pakasir;
// Create a QRIS transaction (Returns a TransactionCreateResponse DTO)
$transaction = Pakasir::createPayment(
    PaymentMethod::QRIS, 
    'ORDER-1001', 
    50000
);
// Access properties in a type-safe manner
echo $transaction->paymentUrl;
echo $transaction->qrisString;

Full Changelog: https://github.com/Fadhila36/pakasir-sdk/compare/v1.0.0...v2.0.0

v1.0.0

Release v1.0.0 - Initial Release of Pakasir SDK

🎉 We are excited to announce the first official release of the Pakasir Laravel SDK!

This package provides a lightweight and fluent way to integrate Pakasir Payment Gateway into your Laravel applications.

🚀 Key Features

  • Easy Integration: Simple API to create transactions and manage payments.
  • Multiple Payment Methods: Full support for QRIS, Virtual Accounts (BNI, BRI, CIMB, Mandiri, Permata, etc.), and PayPal.
  • Automatic Fee Calculation: Built-in helpers to calculate transaction fees automatically.
  • Type Safety: Includes PaymentMethod Enums for reliable coding.
  • Simulation Mode: Helpers to simulate transactions during development.

📦 Compatibility

  • PHP: ^8.1
  • Laravel: ^10.0 | ^11.0 | ^12.0

🛠 Installation

composer require fadhila36/pakasir-sdk

⚡ Quick Example

use Fadhila36\Pakasir\Enums\PaymentMethod;
use Fadhila36\Pakasir\Facades\Pakasir;

// Create a QRIS transaction
$transaction = Pakasir::createPayment(
    PaymentMethod::QRIS, 
    'ORDER-1001', 
    50000
);

📜 Documentation Check out the full documentation for more details:

Integration Guide Development Guide

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky