Support » Plugin: WooCommerce Stripe Payment Gateway » Custom Fields in Checkout with Apple Pay

  • Resolved Andreas Münch

    (@andreasmuench)


    Hi there!

    We have mandatory custom fields in our checkout process that are validated in the ‘woocommerce_checkout_process’ action hook.
    The issue is, that with Apple Pay (Payment Request) the custom field data does not get posted with the ajax call in stripe-payment-request.js in the function processSource()

    Is there a way to add our custom field data to the POST data?
    I could not find any.
    A solution would be to add a filter for the data object in the JS function getOrderData() in the same file stripe-payment-request.js

    Thanks for a hint and/or a future update to make custom checkout fields work with Apple/Google Pay!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Ross V. a11n

    (@rossviviano)

    Automattic Happiness Engineer

    Hi there,

    This is a fairly complex development topic, so I’m going to leave it open for a bit to see if anyone is able to jump in to help you out.

    I can also recommend the following places for more development-oriented questions:

    WooCommerce Slack Community: https://woocommerce.com/community-slack/
    Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/
    Stripe API docs: https://stripe.com/docs/api/

    Best,

    Ross

    Plugin Support Ross V. a11n

    (@rossviviano)

    Automattic Happiness Engineer

    Hi again,

    It doesn’t look like anyone’s chiming in, so I’m going to mark this as resolved. Your best bet would be to reach out to one of the avenues in my previous response.

    Best,

    Ross

    Thread Starter Andreas Münch

    (@andreasmuench)

    Hi @rossviviano ,

    yes, this is surely a development topic, that´s why I thought asking the plugin developers would be a good idea 😉

    Anyway, we sort of “hacked” the plugin so the custom data does not get lost with Apple Pay.

    A clean solution would heve been nicer, though

    onedigitalfarm

    (@onedigitalfarm)

    Hi @andreasmuench
    Can you share a hint of your “hack”? Thank you!

    Thread Starter Andreas Münch

    (@andreasmuench)

    Hi @onedigitalfarm ,

    as far as I remember I made a copy of the stripe-payment-request.js and added a filter function in there (as described in my first post).
    Then I dequeued the original JS file and enqueued the “hacked” one which is located in a separate plugin.
    In another JS file I then injected the custom fields to be added.
    Of course this would not have to be in another JS file, but in case the original stripe-payment-request.js gets an update, it´s easier to just re-add that one line with the filter function.
    Hope that helps!

    onedigitalfarm

    (@onedigitalfarm)

    Thank you @andreasmuench. I wish it was a little simpler 😉
    It seems like it’s a common feature request.

    Thread Starter Andreas Münch

    (@andreasmuench)

    @onedigitalfarm me too, but unfortunately it seems there are no developers working at automattic 😀

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    I’d only add to suggest this on the ideas board. -> http://ideas.woocommerce.com/forums/133476-woocommerce

    I hope the more noise made for a feature like this the closer it is to reality. Also, from the level of discussion here I think you all would be comfortable submitting a pull request to the Stripe plugin repo anyway with your suggested changes?

    https://github.com/woocommerce/woocommerce-gateway-stripe

    Thanks for bringing the idea up here!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Custom Fields in Checkout with Apple Pay’ is closed to new replies.