Access Dynamically Inserted Hidden Input within GFPaymentAddOn()?

I’m working on updating a payment plugin that uses card tokens instead of card numbers.

The vendor loads a JS script on that page that has the user input card information. This script then generates a single-use encrypted token that gets submitted for processing instead of the card number.

After the user completes the token generation the script performs two actions:

  1. callback a js function with the response included obscured card number and token
  2. Inserts a hidden field with the id payment_token and value of the token

I could create a JS function that populates a known GF form field with this token data, but it seems to be easier to just read the hidden field that is inserted into the form; but i’m having trouble sorting out how to access this.

Since the input is being dynamically generated and then inserted into the form do I need to create a filter/hook to grab the input and add it to the $entry object?

Is there an easier way?

The values of custom inputs aren’t available in the entry so you need to grab them directly from the $_POST using the input name e.g.

$value = rgpost( 'payment_token' );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.