We'll create fresh WordPress site with GunTab Payment Gateway installed. You have 20 minutes to test the plugin after that site we'll be deleted.
GunTab is the only transaction platform built for firearm and ammunition e-commerce. It enables you pay and get paid safely online. Learn more at GunTab.com.
Alter the invoice data before it gets sent to GunTab:
use GunTab\Api\GunTab\Abstracts\Invoice;
function guntabAlterInvoice(Invoice $invoice, \WC_Order $order) {
// Your code
return $invoice;
}
add_filter('guntab_alter_invoice', 'guntabAlterInvoice');
Alter the order status when the status must change due to a webhook request from GunTab:
function getNewOrderStatus(string $suggestedStatus, \stdClass $jsonDataFromGunTab) {
// Your code
return 'wc-complete'; // Choose a different WooCommerce order status based on $jsonDataFromGunTab->status
}
add_filter('guntab_get_new_order_status', 'getNewOrderStatus', 10, 2);<h3>Actions</h3>
Called when GunTab sends a request to your webhook endpoint. It runs after the plugin processes the request:
function your_function_name(\WC_Order $order, \stdClass $postedJsonData) {
// Your code
}
add_action('guntab_on_webhook', 'your_function_name', 10, 2);