Download the PHP package andriichuk/bluesnap-php-sdk without Composer
On this page you can find all versions of the php package andriichuk/bluesnap-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andriichuk/bluesnap-php-sdk
More information about andriichuk/bluesnap-php-sdk
Files in andriichuk/bluesnap-php-sdk
Package bluesnap-php-sdk
Short Description A framework-agnostic PHP SDK for the BlueSnap Payment API.
License MIT
Informations about the package bluesnap-php-sdk
BlueSnap PHP SDK
A framework-agnostic PHP 8.5 SDK for the BlueSnap Payment API.
This project is under active development. Its public API may change before the first stable release.
Requirements
- PHP 8.5 or newer
- A PSR-18 HTTP client
- PSR-17 request and stream factories
- BlueSnap sandbox or production API credentials
The SDK deliberately does not depend on Laravel, Symfony, Guzzle, or any other framework. Applications provide their preferred PSR implementations.
Installation
Install a PSR-18 implementation if your project does not already contain one. For example:
Creating a client
Never expose BlueSnap API credentials in client-side code or commit them to source control.
merchantId is required when building Hosted Payment Page URLs. API-only clients may omit it.
Plans
Subscriptions
The payload shape follows BlueSnap's API so new BlueSnap capabilities remain available without waiting for an SDK release.
Hosted Payment Fields tokens
BlueSnap returns the token in the response's Location header. Extract the final path segment only when the Hosted Payment Fields JavaScript integration requires the token value.
For saved-card 3-D Secure flows, use paymentFieldsTokens()->prefill().
Hosted Payment Pages
Hosted Payment Page URLs use the checkout host rather than the API base URI. The SDK defaults to
https://sandbox.bluesnap.com in sandbox and https://checkout.bluesnap.com in production; pass
checkoutHost to Configuration to override that origin.
Use paramEncryption()->encrypt() to encrypt protected parameters such as
thankyou.backtosellerurl, then build the redirect URL with hostedPageUrl(). Parameter encryption
requires a Data Protection Key configured in the BlueSnap merchant console.
The merchant ID lives on Configuration and is validated there; HostedPageRequest validates the
per-checkout values. Building a URL without a merchant ID throws.
The production checkout origin
https://checkout.bluesnap.comis taken from BlueSnap's published examples and has not been exercised against a live production account. Confirm the origin your account is issued and setcheckoutHostexplicitly before going live.
Cashier readiness
The SDK includes the outbound API operations required for a card-based Laravel Cashier package: customers and payment methods, plans, BlueSnap-managed and merchant-managed subscriptions, charge history, plan-switch previews, one-time payments, authorization/capture/reversal, refunds, 3-D Secure token prefill, webhook configuration, and reconciliation queries.
See the Cashier endpoint coverage matrix for the exact mapping and the integration responsibilities that belong in the future Laravel package.
Errors
Non-successful responses throw typed exceptions:
HTTP 401/403, 404, 409, 422, and 429 responses have dedicated exception classes. Other unsuccessful responses throw ApiException. PSR transport failures throw TransportException.
Idempotency
BlueSnap accepts idempotency keys on transactional POST endpoints and retains them for up to 24 hours. Generate the key in your application and reuse the same value only when retrying the same logical request. Keys are limited to 64 characters.
Development
The test suite does not make live BlueSnap requests or require API credentials.
Security
Please do not report security vulnerabilities through public GitHub issues. Until a dedicated security policy is published, contact [email protected].
License
BlueSnap PHP SDK is open-source software licensed under the MIT license.
All versions of bluesnap-php-sdk with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0