WooCommerce Custom Payment Plugin
-
Hi,
I’m trying to build a custom payment plugin for WooCommerce and I’ve used the follwing document, https://developer.woocommerce.com/2022/07/07/exposing-payment-options-in-the-checkout-block/ .
Now, I’m trying to modify the class-wc-gateway-dummy.php to add payment fields at the checkout. So, the user can enter their paystring. The function below is what I added:
public function payment_fields() {
echo ‘<div id=”custom_payment_fields”><h3>’ . __(‘Pago Pay Details’) . ‘</h3>’;woocommerce_form_field(‘pago_pay_string’, array(
‘type’ => ‘text’,
‘class’ => array(‘form-row-wide’),
‘label’ => __(‘Pago Pay String’),
‘placeholder’ => __(‘Enter your Pago Pay String’),
));woocommerce_form_field(‘total_amount’, array(
‘type’ => ‘number’,
‘class’ => array(‘form-row-wide’),
‘label’ => __(‘Total Amount’),
‘placeholder’ => __(‘Enter the Total Amount’),
));echo ‘</div>’;
}However, I do not see any text option during checkout to enter the pay string. Can you help me figure out what is missing. Thank you.
The topic ‘WooCommerce Custom Payment Plugin’ is closed to new replies.