sfolador / heidipay
Use HeidiPay services easy with Laravel
1.0
2023-04-17 20:02 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- sammyjo20/saloon-laravel: ^2.0
- sfolador/heidipay-saloon: ^1.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-09 05:48:19 UTC
README
Installation
You can install the package via composer:
composer require sfolador/heidipay
You can publish the config file with:
php artisan vendor:publish --tag="heidipay-config"
This is the contents of the published config file:
return [ 'api_url' => 'https://sandbox-origination.heidipay.com/', 'merchant_key' => 'your merchant key', ];
Usage
$product = CreditInitProduct::from(sku: null, name: "Test", quantity: 1, price: 100, imageThumbnailUrl: null, imageOriginalUrl: null, description: ""); $amount = Amount::from(currency: "EUR", amount: 100, format: AmountFormat::DECIMAL); $products = [$product]; $consumer = Customer::from(email: "sfolador@gmail.com", title: null, firstname: "simone", lastname: "folador", dateOfBirth: null, contactNumber: null, companyName: null, residence: null); $webhooks = Webhooks::from( success: "https://www.example.com/heidi-success", failure: "https://www.example.com/heidi-failure", cancel: "https://www.example.com/heidi-cancel", status: "https://www.example.com/heidi-status", mappingScheme: "default" ); $webhooks->setToken(str()->random(32)); $contractInitDto = ContractInitDto::from(amount: $amount, customer: $consumer, webhooks: $webhooks, products: $products); $hp =\Sfolador\Heidipay\Facades\Heidipay::contract($contractInitDto); dd($hp->dto()); /** * * Sfolador\HeidiPaySaloon\Dto\Response\ContractDto {#479 ▼ // routes/web.php:201 +action: "REDIRECT" +redirect_url: "https://sandbox-checkout.heidipay.com?otc=f8952b8c-919d-4d7f-a54c-70027d5f0a55&fallback=https%3A%2F%2Flaravel-10.test%2Fheidi-failure" +external_contract_uuid: "b3df38c4-6cdb-4224-adb9-6878922721ff" +application_uuid: "07ef7950-3189-4a11-be6e-98b1d88a9340" } */
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.