class WC_Gateway_MyGateway extends WC_Payment_Gateway { public function __construct() { $this->id = 'mygateway'; $this->method_title = 'My Payment Gateway'; $this->method_description = 'Pay using MyGateway API'; $this->has_fields = false; $this->init_form_fields(); $this->init_settings(); add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); } public function process_payment($order_id) { // 1️⃣ Get the WooCommerce order $order = wc_get_order($order_id); // 2️⃣ Prepare API request data $api_key = $this->get_option('api_key'); // Admin saved API key $body = array( 'amount' => $order->get_total(), 'currency' => $order->get_currency(), 'order_id' => $order->get_id(), 'api_key' => $api_key ); // 3️⃣ Send POST request to 3rd-party API $response = wp_remote_post('https://api.yourgateway.com/pay', array( 'method' => 'POST', 'body' => $body, 'timeout' => 60, 'headers' => array('Accept' => 'application/json') )); // 4️⃣ Handle response if (is_wp_error($response)) { wc_add_notice('Payment failed: Unable to connect to payment gateway.', 'error'); return; } $response_body = wp_remote_retrieve_body($response); $result = json_decode($response_body, true); if ($result['status'] === 'success') { // Payment succeeded $order->payment_complete(); // WooCommerce handles stock, emails, etc. return array( 'result' => 'success', 'redirect' => $this->get_return_url($order) ); } else { // Payment failed wc_add_notice('Payment failed: ' . $result['message'], 'error'); return; } } Home -
Group of diverse kids collaborating on a 3D printing project using a laptop and other devices.

Create Your Custom 3D-Printed Keychains

Explore affordable, personalized 3D-printed keychains designed just for you with fast shipping and quality craftsmanship.

Discover the Passion Behind EZlabstudio and its Unique Creations

Founded by Ezra, EZlabstudio transforms personal projects into custom 3D prints, delivering exceptional quality and personalized service to every customer.

3D printing heart design in workshop setting. Perfect for Valentine creativity concepts.

Our Custom 3D Printing Collection

Offering a wide range of options including colors, finishes, and personalized designs for unique keychains and small products.

Spiral Fidget Cone

Price range: $6.00 through $8.00

Smooth spiral fidget cone.

Custom Name Keychain

Price range: $7.00 through $10.00

Custom keychain

Jesus Cross (Keychain / Necklace)

Price range: $8.00 through $11.00

Jesus Cross keychain / necklace

Upload your 3D design file (STL, OBJ, STEP, 3MF). After upload, we will review and send you a custom quote

Get Your Personalized Item Today!

Close-up of a 3D printer creating a hexagonal object in a dimly lit workspace.

Our Recent Works

Close-up of a modern milling machine producing a 3D model rocket, highlighting technology and precision.
Group of diverse kids collaborating on a 3D printing project using a laptop and other devices.
3D printing heart design in workshop setting. Perfect for Valentine creativity concepts.
Close-up of a 3D printer creating a hexagonal object in a dimly lit workspace.
Close-up of a modern milling machine producing a 3D model rocket, highlighting technology and precision.

Join Our Community

Stay Updated on Our Latest Designs!

Subscribe for exclusive offers and be the first to see our new 3D-printed creations.

Scroll to Top
0

Subtotal