145 lines
4.4 KiB
Plaintext
145 lines
4.4 KiB
Plaintext
=== Custom Payment Gateway ===
|
|
Contributors: ALUXB
|
|
Tags: woocommerce, payment, paypal, gateway
|
|
Requires at least: 5.8
|
|
Tested up to: 6.3
|
|
Requires PHP: 7.4
|
|
Stable tag: 1.1.0
|
|
License: GPLv2 or later
|
|
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
A custom WooCommerce payment gateway that redirects to a standalone payment website with PayPal integration.
|
|
|
|
== Description ==
|
|
|
|
This plugin adds a custom payment gateway to WooCommerce that redirects customers to a standalone payment processing website. The payment website handles PayPal transactions securely and returns the customer back to WooCommerce with the payment status.
|
|
|
|
**Features:**
|
|
|
|
* Seamless integration with WooCommerce checkout
|
|
* Redirects to standalone payment website
|
|
* Secure PayPal payment processing
|
|
* Automatic order status updates
|
|
* Test mode for development
|
|
* Debug logging capabilities
|
|
* Webhook support for payment notifications
|
|
|
|
== Installation ==
|
|
|
|
1. Upload the plugin files to the `/wp-content/plugins/custom-payment-gateway` directory, or install the plugin through the WordPress plugins screen directly.
|
|
2. Activate the plugin through the 'Plugins' screen in WordPress
|
|
3. Go to WooCommerce → Settings → Payments
|
|
4. Enable "Custom Payment Gateway"
|
|
5. Click "Manage" to configure the settings
|
|
6. Enter your payment website URL
|
|
7. Save changes
|
|
|
|
== Configuration ==
|
|
|
|
**Required Settings:**
|
|
|
|
* **Title**: The payment method name shown to customers (e.g., "PayPal Payment")
|
|
* **Description**: Text shown to customers during checkout
|
|
* **Payment Website URL**: The URL of your standalone payment website (e.g., https://payment.yoursite.com/payment)
|
|
|
|
**Optional Settings:**
|
|
|
|
* **Test Mode**: Enable to use test/sandbox environment
|
|
* **Debug Log**: Enable to log all gateway activities for troubleshooting
|
|
|
|
== Payment Flow ==
|
|
|
|
1. Customer proceeds to checkout on WooCommerce
|
|
2. Selects "Custom Payment Gateway" as payment method
|
|
3. Customer is redirected to the standalone payment website with order details
|
|
4. Customer completes payment via PayPal
|
|
5. Customer is redirected back to WooCommerce
|
|
6. Order status is automatically updated based on payment result
|
|
|
|
== Webhook Configuration ==
|
|
|
|
Your standalone payment website should send webhook notifications to:
|
|
`https://yoursite.com/?wc-api=custom_payment_gateway`
|
|
|
|
Webhook payload should be JSON:
|
|
```json
|
|
{
|
|
"order_id": 123,
|
|
"transaction_id": "ABC123XYZ",
|
|
"status": "completed"
|
|
}
|
|
```
|
|
|
|
== URL Parameters ==
|
|
|
|
When redirecting to the payment website, the following parameters are sent:
|
|
|
|
* `wc_order_id` - WooCommerce order ID
|
|
* `total` - Order total amount
|
|
* `currency` - Currency code (e.g., USD, EUR)
|
|
* `description` - Order description
|
|
* `customer_email` - Customer email address
|
|
* `return_url` - URL to return after successful payment
|
|
* `cancel_url` - URL to return if payment is cancelled
|
|
* `_wpnonce` - Security nonce
|
|
|
|
== Frequently Asked Questions ==
|
|
|
|
= Does this work with PayPal? =
|
|
|
|
Yes, this gateway is designed to work with a standalone payment website that processes PayPal payments.
|
|
|
|
= Can I test payments without going live? =
|
|
|
|
Yes, enable "Test Mode" in the gateway settings and use PayPal sandbox credentials on your payment website.
|
|
|
|
= Where can I find the debug logs? =
|
|
|
|
Enable "Debug log" in settings. Logs are stored in: WooCommerce → Status → Logs
|
|
|
|
= How do I handle payment returns? =
|
|
|
|
The plugin automatically handles returns from your payment website. Your payment website should redirect back to the `return_url` with appropriate parameters.
|
|
|
|
== Changelog ==
|
|
|
|
= 1.1.0 =
|
|
* Added Text for Success and Failed orders
|
|
*
|
|
|
|
= 1.0.0 =
|
|
* Initial release
|
|
* Basic payment gateway functionality
|
|
* Redirect to standalone payment website
|
|
* PayPal integration support
|
|
* Webhook handler
|
|
* Debug logging
|
|
|
|
== Upgrade Notice ==
|
|
|
|
= 1.0.0 =
|
|
Initial release of Custom Payment Gateway.
|
|
|
|
== Support ==
|
|
|
|
For support, please contact: support@yoursite.com
|
|
|
|
== Technical Requirements ==
|
|
|
|
* WordPress 5.8 or higher
|
|
* WooCommerce 5.0 or higher
|
|
* PHP 7.4 or higher
|
|
* Standalone payment processing website
|
|
* HTTPS/SSL certificate (required for production)
|
|
|
|
== Integration with Your Payment Website ==
|
|
|
|
Your payment website should:
|
|
|
|
1. Accept GET parameters from WooCommerce (order_id, total, currency, etc.)
|
|
2. Process payment via PayPal
|
|
3. Send webhook notification to WooCommerce
|
|
4. Redirect customer back to return_url with payment status
|
|
|
|
Example redirect after successful payment:
|
|
`https://yourstore.com/checkout/order-received/123/?key=wc_order_xyz&cpg_return=1&order_id=123&transaction_id=ABC123&payment_status=success` |