This repository contains PHP scripts to seamlessly integrate the UddoktaPay payment gateway into your web application. It provides essential functionalities like generating payment URLs, verifying payment statuses, and displaying transaction details.
- Payment Processing: Generate secure payment URLs for transactions.
- Payment Status Verification: Check the status of any transaction.
- Transaction Details Display: Easily show payment confirmation and transaction details.
- functions.php: Core functions for handling payment processing.
- payment.php: Handles the payment form submission and redirects users to the UddoktaPay gateway.
- success.php: Displays transaction details and payment confirmation.
To integrate UddoktaPay, make sure your environment meets these requirements:
- PHP 7.2 or higher: Your server must support PHP 7.2 or newer.
- Web Server: Ensure you have a running web server like Apache or Nginx.
- UddoktaPay API Access: Obtain an API key from UddoktaPay.
git clone <repository-url>
cd <repository-directory>
#### 2. Update API Key
Edit the functions.php file and replace the placeholder API key with your actual UddoktaPay API key:
```bash
$apiKEY = 'YOUR_API_KEY_HERE';
#### 2. Update API Key
Edit the functions.php file and replace the placeholder API key with your actual UddoktaPay API key:
```bash
$apiKEY = 'YOUR_API_KEY_HERE';
#### 3.Configure Redirect URLs
In the same functions.php file, update the following URLs to your success and cancel pages:
'redirect_url' => 'http://yourdomain.com/success.php',
'cancel_url' => 'http://yourdomain.com/failed.php',
#### 4.Create Payment Form
- ** Here’s a basic HTML form for collecting payment information. Ensure the form submits to payment.php:
```bash
<form method="POST" action="payment.php">
<input type="text" name="cname" placeholder="Full Name" required>
<input type="email" name="cemail" placeholder="Email" required>
<input type="number" name="cpayamount" placeholder="Amount" required>
<input type="text" name="corderID" placeholder="Order ID" required>
<input type="hidden" name="cID" value="1"> <!-- Example user ID -->
<button type="submit" name="paynowbtn">Pay Now</button>
</form>
## 🧪 Testing the Integration
- ** Use the UddoktaPay sandbox environment for testing. Simulate payments and verify the results to ensure all functionalities work correctly before going live.
## 🖥️ Deployment
- **Once thoroughly tested, deploy the code to your production server. Remember to update the URLs in functions.php to point to your live domain.
## 📄 Function Descriptions
- ** pay_url($full_name, $email, $amount, $order_id, $user_id): Generates a payment URL based on user and payment details. Returns the URL or an error message.
- ** pay_status($invoice_id): Checks the status of a payment using the invoice ID. Returns the payment status in JSON format or an error message.
## 📚 Example Usage
- ** Check out payment.php and success.php for a clear example of handling payment submissions and displaying results. Follow this structure to ensure compatibility.
## 🧑💻 Support
- ** For any questions or further assistance, feel free to reach out via my Fiverr profile.
## 📝 License
- ** This project is open-source and available under the MIT License. You are free to use, modify, and distribute the code in accordance with the terms of the license.
#UddoktaPay #PHPIntegration #PaymentGateway #PaymentProcessing #TransactionVerification #PaymentURL #PHP7 #WebDevelopment #UddoktaPayAPI #Fiverr #EcommerceIntegration #PaymentConfirmation