Download the PHP package aflorea4/laravel-netopia-payments without Composer

On this page you can find all versions of the php package aflorea4/laravel-netopia-payments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-netopia-payments

Laravel Netopia Payments

Latest Version on Packagist GitHub Tests Action Status Total Downloads GitHub License PHP Version GitHub Release Date

A Laravel package for integrating with Netopia Payments (Romania) payment gateway.

Requirements

Installation

You can install the package via composer:

Configuration

Publish the configuration file:

This will create a config/netopia.php file in your app that you can modify to set your configuration.

Configuration Options

Add the following variables to your .env file:

Verifying Your Certificate and Private Key

Before using the package in production, it's important to verify that your certificate and private key are valid and working correctly. You can use the following commands to check them:

Verify the Public Certificate

This command should display information about your certificate, including the issuer, validity period, and public key details. If the command returns an error, your certificate may be invalid or corrupted.

Verify the Private Key

This command should display "RSA key ok" if your private key is valid. If it asks for a password, your key may be password-protected, which is not supported by this package.

Test Key Pair Matching

To verify that your public certificate and private key are a matching pair (which is essential for encryption/decryption to work):

Both commands should produce the same MD5 hash. If they don't match, your certificate and private key are not a valid pair, which will cause encryption/decryption failures.

Usage

Creating a Payment Request

Payment Redirect View

Create a view file resources/views/payment/redirect.blade.php:

Handling Payment Notifications

The package automatically registers routes for handling payment notifications:

These routes are handled by the package's internal controller and will dispatch events that you can listen for in your application. You don't need to create these routes yourself.

You can listen for the following events to handle payment notifications:

Creating a Payment Listener

Testing with a Test Transaction

Here's a complete example of how to handle a test transaction of 1.00 RON without using queues or listeners:

1. Create a Controller to Handle the Payment

2. Register the Routes

Note about routes: The example below registers custom routes for payment confirmation and return:

These custom routes are different from the auto-registered package routes (/netopia/confirm and /netopia/return). Use custom routes when:

  1. You want complete control over the payment flow
  2. You need custom logic that isn't covered by the event listeners
  3. You're not using the package's event system

If you're using the package's event system, you can use the auto-registered routes instead.

3. Create the Necessary Views

Create the redirect view as shown in the main usage example, and create success, pending, failed, and error views as needed.

4. Test Card Details

When testing in the sandbox environment, you can use the following test card details to simulate a successful transaction:

5. Testing Process

  1. Make sure your .env file has NETOPIA_LIVE_MODE=false to use the sandbox environment
  2. Visit /payment/initiate to start a test payment of 1.00 RON
  3. You'll be redirected to the Netopia sandbox payment page
  4. Enter the test card details provided above
  5. Complete the 3D Secure verification with password 123456
  6. The payment will be processed, and you'll be redirected back to your return URL
  7. The confirmation endpoint will also receive the payment notification

This approach doesn't use queues or event listeners, making it simpler for testing and development. All payment processing happens synchronously in the controller methods.

Security

The package uses the following security measures:

  1. Request authentication using an API Signature included in the request
  2. Data encryption using RSA keys with AES-256-CBC for symmetric encryption
  3. Secure Sockets Layer (SSL) data transport

Encryption Details

As of version 0.2.6, this package exclusively uses AES-256-CBC encryption for all payment data. This provides stronger security compared to older cipher methods like RC4. When processing payments, the initialization vector (IV) parameter is now required for all decryption operations.

Testing

This package uses PEST for testing. To run the tests, you can use the following command:

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.

The test suite includes:

Writing Tests

If you want to add more tests, you can create them in the tests directory. The package uses PEST's expressive syntax for writing tests. Here's an example of how to write a test for the NetopiaPayments class:

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-netopia-payments with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/support Version ^8.0|^9.0|^10.0
ext-openssl Version *
ext-dom Version *
guzzlehttp/guzzle Version ^7.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aflorea4/laravel-netopia-payments contains the following files

Loading the files please wait ....