I want to target a specific form to limit it’s payment option ouput. Ultimately the end goal is to have two pages, each with a form on it. One pages form will only display a cash payment option. The other pages form will only display a card payment option. I am trying to use the following example as my starting point:
The card version is working. But the elseif for the bank version is not. Any ideas. Here’s screenshots to show the results and the form id’s are matching. One working as expected, the other is not.
So in testing a few things. I have determined that trying to get just ‘us_bank_account’ doesn’t work. I changed my function to check this a few ways and I can get just card to display, but never just ‘us_bank_account’ to display. Not sure if something isn’t updated in the documentation for this payment type, or if it’s just not allowed to have only the bank option available?
Not sure if I’m reading this right, but this code in the plugin itself may be supporting this theory that it’s not possible?
Line 106 of /includes/payment-element/class-gf-payment-element.php
$payment_methods = $this->payment->get_payment_methods( $feed, $form );
if ( ! empty( $payment_methods ) ) {
// When payment method types are explicitly defined, 'card' must be one of the methods.
$intent_information['payment_method_types'] = array_unique( array_merge( $payment_methods, array( 'card' ) ) );
}