Download the PHP package osa-eg/laravel-upayments without Composer
On this page you can find all versions of the php package osa-eg/laravel-upayments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download osa-eg/laravel-upayments
More information about osa-eg/laravel-upayments
Files in osa-eg/laravel-upayments
Package laravel-upayments
Short Description A Laravel package for integrating Upayments gateway.
License MIT
Informations about the package laravel-upayments
Laravel Upayment Integration
A Laravel package for integrating the Upayment payment gateway. It provides a convenient way to interact with the Upayment API, allowing you to create payments, refunds, manage cards, and more.
Installation
-
Require the package using Composer:
Run the following command in your terminal:
-
Publish the configuration file:
-
Configure your environment:
Update your
.env
file with the following:
Configuration
After publishing, the configuration file config/upayments.php will be created. You can modify it according to your needs.
Configuration Options
api_key
: Your Upayments API key.api_base_url
: The base URL for the Upayments API. Use the sandbox URL for testing.logging_channel
: Specifies the logging channel to be used for logging requests and responses. Default is'stack'
.logging_enabled
: Enables or disables logging. Set totrue
to enable logging orfalse
to disable it.
Logging
The package includes logging functionality to help you debug and monitor API requests and responses.
Enabling/Disabling
Logging: You can enable or disable logging by setting the UPAYMENTS_LOGGING_ENABLED value in your .env file to true or false.ging Channel
: Specify the logging channel in your .env file using UPAYMENTS_LOGGING_CHANNEL. This should correspond to a channel defined in your config/logging.php file.
Example Logging Configuration
In your .env file:
In your config/logging.php:
Usage
Basic Usage
-
Add a product and create a payment:
-
Retrieve payment status:
-
Create a refund:
- Multi-vendor refund:
Available Methods
Payment Methods
addProduct($name, $description, $price, $quantity)
setOrder($orderData)
setCustomer($customerData)
setPaymentGateway($source)
setReturnUrl($url)
setCancelUrl($url)
setNotificationUrl($url)
setNotificationType()
//in case setPaymentGateway('create-invoice')
markAsWhiteLabeled()
markAsNoneWhiteLabeled()
createPayment()
setLanguage()
getPaymentStatus($id, $type = 'invoiceId')
checkPaymentButtonStatus()
Refund Methods
createRefund($orderId, $totalPrice, array $optionalParams = [])
getRefundStatus($orderId)
checkSingleRefundStatus($orderId)
deleteRefund($orderId, $refundOrderId)
Multi-Vendor Methods
addRefundVendor(array $vendorData)
createMultiVendorRefund($orderId, array $optionalParams = [])
deleteMultiVendorRefund($generatedInvoiceId, $orderId, $refundOrderId, $refundArn)
Card Management Methods
createCustomerUniqueToken($customerUniqueToken)
addCard($returnUrl, $customerUniqueToken)
retrieveCustomerCards($customerUniqueToken)
Middleware Support
The package includes retry and logging middleware to handle request retries and log requests for debugging purposes.
Unit Tests
To run the tests, use the following command:
Contributing
Feel free to submit issues or pull requests for improvements and bug fixes.
License
The Laravel Upayment Integration package is open-sourced software licensed under the MIT license.
All versions of laravel-upayments with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^8.0|^9.0|^10.0|^11