Download the PHP package piyushjaiswal/paysprint without Composer
On this page you can find all versions of the php package piyushjaiswal/paysprint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download piyushjaiswal/paysprint
More information about piyushjaiswal/paysprint
Files in piyushjaiswal/paysprint
Package paysprint
Short Description Paysprint API integration for Laravel
License MIT
Informations about the package paysprint
Paysprint API Integration for Laravel
This package integrates Paysprint API for various services like recharge, bill payments, DTH, LIC, Fastag, and more into a Laravel application.
Installation
To install this package, follow these steps:
Step 1: Install via Composer
Run the following command in your Laravel project directory to install the package:
Step 2: Publish the Configuration File
Once the package is installed, publish the configuration file to set up your API keys and URLs:
This will create a file called config/paysprint.php where you can customize your Paysprint API settings.
Configuration config/paysprint.php This is the configuration file where you set up your Paysprint API environment. After publishing the configuration file, you will find it in config/paysprint.php. Below is an explanation of the configuration options:
Step 3: Update Your .env File
In your Laravel project's .env file, add the following environment variables for your Paysprint API credentials:
API_MODE: The mode in which the API should operate. It can be either 'uat' (User Acceptance Testing) or 'live'. API_LIVE_URL: The base URL for the live Paysprint API. API_UAT_URL: The base URL for the UAT Paysprint API. API_AUTHORISED_KEY: The API authorized key, which will be provided by Paysprint. SPRINT_PARTNER_ID: Your partner ID for generating JWT tokens. SPRINT_JWT_KEY: The secret key used for generating JWT tokens.
Step 4: Use the Package
Available API Methods
1. IP Check Service
Description:
This service checks whether the current request's IP address is authorized via the Paysprint API.
Method:
if response is success
else
Available API Methods
2. Cash Balance Check Service
Description:
This service retrieves the current cash balance from the Paysprint API.
Method:
if response is success
else
Available API Methods
- Get Operators Description: The Get Operator Service allows you to fetch the list of available operators for a specific service (e.g., mobile, DTH, etc.).
Method:
- HLR Check Service for Mobile Description: The HLR (Home Location Register) Check Service allows you to verify the status of a mobile number before proceeding with a recharge.
Method:
Usage Example:
json
{"status":true,"response_code":1,"info":{"operator":"Jio","circle":"UP West"},"message":"Successful"} json { "status": true, "response_code": 1, "info": [ { "MonthlyRecharge": 499, "Balance": "11.27", "customerName": "EFDSF AXA", "status": "Active", "NextRechargeDate": "11-12-2024", "lastrechargeamount": "1500", "lastrechargedate": "2024-09-08T18:38:10.337", "planname": "Royale Sports Kids HSM HD" } ], "message": "Fetch Successful" } json { "status": true, "response_code": 1, "data": { "operators": [ { "operator_id": "1", "operator_name": "Tata Power" }, { "operator_id": "2", "operator_name": "Adani Electricity" }, { "operator_id": "3", "operator_name": "BSES Rajdhani" } ] } } json { "status": false, "response_code": 2, "message": "Failed to fetch operators" } json { "status": true, "response_code": 1, "billAmount": "200.00", "dueDate": "2024-10-10", "customerName": "John Doe", "message": "Bill fetched successfully" } json { "status": false, "response_code": 2, "message": "Failed to fetch bill" } json
{ "status": true, "response_code": 1, "message": "Payment successful", "transaction_id": "TXN123456789" } json
{ "status": false, "response_code": 2, "message": "Payment failed" } json
{ "status": true, "responsecode": 1, "transactionStatus": "Success", "message": "Payment was successful" } json
{ "status": false, "responsecode": 2, "message": "Payment status not found" } json { "status": true, "response_code": 1, "billAmount": "500.00", "dueDate": "2024-10-10", "policyHolderName": "John Doe", "message": "Bill fetched successfully" } json { "status": false, "response_code": 2, "message": "Failed to fetch bill" } json { "status": true, "response_code": 1, "message": "Payment successful", "transaction_id": "TXN123456789" } json { "status": false, "response_code": 2, "message": "Payment failed" } json { "status": true, "response_code": 1, "transactionStatus": "Success", "message": "Payment was successful" } json { "status": false, "response_code": 2, "message": "Payment status not found" } json { "status": true, "response_code": 1, "operators": [ { "operator_id": "1", "operator_name": "ICICI Fastag" }, { "operator_id": "2", "operator_name": "SBI Fastag" } ] } json { "status": false, "response_code": 2, "message": "Failed to fetch operators" } json { "status": true, "response_code": 1, "billAmount": "1000.00", "dueDate": "2024-12-15", "vehicleNumber": "KA01AB1234", "message": "Bill fetched successfully" } json { "status": false, "response_code": 2, "message": "Failed to fetch bill" } json { "status": true, "response_code": 1, "message": "Payment successful", "transaction_id": "TXN123456789" } json { "status": false, "response_code": 2, "message": "Payment failed" } json { "status": true, "response_code": 1, "transactionStatus": "Success", "message": "Payment was successful" } json { "status": false, "response_code": 2, "message": "Payment status not found" } json
{ "status": true, "response_code": 1, "operators": [ { "operator_id": "1", "operator_name": "Indane" }, { "operator_id": "2", "operator_name": "Bharat Gas" } ] } json
{ "status": false, "response_code": 2, "message": "Failed to fetch operators" } json
{ "status": true, "response_code": 1, "billAmount": "750.00", "dueDate": "2024-12-15", "consumerNumber": "9876543210", "message": "Bill fetched successfully" } json
{ "status": false, "response_code": 2, "message": "Failed to fetch bill" } json
{ "status": true, "response_code": 1, "message": "Payment successful", "transaction_id": "TXN123456789" } json
{ "status": false, "response_code": 2, "message": "Payment failed" } json
{ "status": true, "response_code": 1, "transactionStatus": "Success", "message": "Payment was successful" } json
{ "status": false, "response_code": 2, "message": "Payment status not found" } json { "status": true, "response_code": 1, "operators": [ { "operator_id": "1", "operator_name": "Municipality Operator 1" }, { "operator_id": "2", "operator_name": "Municipality Operator 2" } ] } json { "status": false, "response_code": 2, "message": "Failed to fetch operators" } json { "status": true, "response_code": 1, "billAmount": "2000.00", "dueDate": "2024-12-15", "consumerNumber": "1234567890", "message": "Bill fetched successfully" } json { "status": false, "response_code": 2, "message": "Failed to fetch bill" } json { "status": true, "response_code": 1, "message": "Payment successful", "transaction_id": "TXN123456789" } json { "status": false, "response_code": 2, "message": "Payment failed" } json { "status": true, "response_code": 1, "transactionStatus": "Success", "message": "Payment was successful" } json { "status": false, "response_code": 2, "message": "Payment status not found" } json
{ "status": true, "response_code": 1, "message": "OTP sent successfully" } json
{ "status": false, "response_code": 2, "message": "Failed to generate OTP" } json
{ "status": true, "response_code": 1, "message": "Payment successful", "transaction_id": "TXN123456789" } json
{ "status": false, "response_code": 2, "message": "Payment failed" } json
{ "status": true, "response_code": 1, "transactionStatus": "Success", "message": "Payment was successful" } json
{ "status": false, "response_code": 2, "message": "Payment status not found" } json
{ "status": true, "response_code": 1, "message": "OTP resent successfully" } json
{ "status": false, "response_code": 2, "message": "Failed to resend OTP" } json
{ "status": true, "response_code": 1, "message": "Refund claimed successfully" } json
{ "status": false, "response_code": 2, "message": "Refund claim failed" }
### How to Use the Services
Ensure your config/paysprint.php file contains the correct authorised_key and JWT token configuration.
Inject or instantiate the respective service (IPCheckService, CashBalanceService, MobileDTHRechargeService) wherever needed in your application.
Call the respective method to execute the desired action (IP check, cash balance check, recharge, etc.).
### Contributing
Feel free to fork this repository, submit pull requests, and report issues if you encounter any.
### License
This package is open-sourced software licensed under the MIT license.