How do I choose required fields when integrating MarketPress with PayPal PayFlow?

Hi,

We're trying to figure out how to customize which fields the user is required to submit to our payment sign-up form (which is driven by MarketPress and PayPal PayFlow in combination).

Here's the kicker: while it's trivial to set the required fields when you're using a hosted PayPal form (i.e. you can just adjust this through the manager.paypal.com portal), it turns out to be a lot more nonobvious when you are NOT using hosted forms (as we are not).

Is there some trick to doing this in MarketPress? Nothing obvious about this is in the documentation, from what we can tell...

Thanks for your help with this!

  • aecnu
    • WP Unicorn

    Greetings dave_llorens,

    Thank you for bringing this to our attention and though custom coding is beyond the scope of the support we provide here, we do try to help if we can.

    Have you folks tried to modify the file payflow.php with the fields you desire - located in the \marketpress\marketpress-includes\plugins-gateway folder?

    Please advise.

    Cheers, Joe

  • Dave Llorens
    • Flash Drive

    Hi Joe,

    Thank for getting in touch with us so quickly.

    We actually hadn't known to look in payflow.php, and were kind of surprised overall that the only way to do this was to go into the PHP code itself; has MarketPress ever considered adding a feature to add/remove required fields using only the WordPress plugin dashboard?

    That being said: after taking a look at payflow.php, am I assuming correctly that to add additional required fields, we will want to edit the function process_payment_form, adding one new statement of the following form (to give just one example),

    if (!is_email($_POST['email']))
    $mp->cart_checkout_error('Please enter a valid Email Address.', 'email');

    before the call to do_action( 'mp_billing_process' ); for each required field we want to add?

    Many thanks for your help with this!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.