Download the PHP package ayvazyan10/ameriabankvpos without Composer
On this page you can find all versions of the php package ayvazyan10/ameriabankvpos. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ayvazyan10/ameriabankvpos
More information about ayvazyan10/ameriabankvpos
Files in ayvazyan10/ameriabankvpos
Package ameriabankvpos
Short Description AmeriaBank VPOS service for Laravel
License MIT
Homepage https://github.com/ayvazyan10/ameriabankvpos
Informations about the package ameriabankvpos
AmeriaBank VPOS Laravel Package
This package provides a simple and convenient integration with AmeriaBank VPOS for Laravel applications.
🚀 Installation
Install the package via Composer.
`
Release the configuration file and database migration.
This will create a [config/ameriabankvpos.php] and [database/migrations] files in your application.
⚙️ Configuration
After publishing the configuration file, you should set your AmeriaBank VPOS credentials/options in the config/ameriabankvpos.php file or in your .env file: `
📚 Usage
Here is an example of how to use the AmeriaBankVPOS facade or helper in your Laravel application: `
📋 Statuses
This package returns the payment status as a string in the status key of the response array. The possible statuses are:
- SUCCESS: The payment approved and can be processed.
- FAIL: The payment failed or was declined.
⚡ All Methods
`
📖 Examples
Below are some examples on how to use the package in different scenarios.
Example 1: Simple Payment
Example 2: Payment with Custom Currency and Language, also redirect to different page
Example 3: Handling the Payment Response
`
Example 4: Getting the Payment Details
`
Example 5: Refunding a specific payment
` This method sends an API request to refund a specific payment partially. It takes two parameters:
$paymentId: The ID of the payment to be refunded. This parameter is required and can be an integer or string value. $refundAmount: The amount to be refunded. This parameter is required and can be an integer or float value. The method returns an associative array with two keys:
"status": Indicates the status of the refund operation. Possible values are "SUCCESS" or "FAIL". "response": Contains the response data from the API. If the refund operation is successful, the response data will contain details about the refunded amount, otherwise it will contain an error message. If an error occurs during the API request, the method will throw an exception with a message describing the error.
Example 6: Canceling payment
` In this example, the cancelPayment method is called with the $paymentId parameter. Inside the try block, the AmeriaBankVPOS::cancelPayment() method is called with the provided payment ID to initiate a payment cancellation operation. The method returns an associative array with two keys: "status" and "response". These keys contain the cancellation status and details respectively.
After calling the cancelPayment method, you can handle the returned details as needed. For example, you can check the "status" key to see if the cancellation was successful or not, and use the "response" key to get more details about the cancellation operation. In case an exception is thrown during the API request, the catch block will be executed and you can handle the error as needed, such as logging it or returning an error response.
Example 7: Binding Payments (Subscribe User Card)
`
🛠️ Extending and Customizing
If you need to extend or customize the package behavior, you can create your own class that extends the AmeriaBankVPOS class and override the methods as needed. Make sure to update the AmeriaBankVPOS alias in config/app.php to point to your custom class.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Author
License
MIT. Please see the license file for more information.