GFStripe is the class which houses the main functionality of the Gravity Forms Stripe Add-on, it extends the GFPaymentAddOn class which is part of the add-on framework. Below are a few functions which you may find useful when working on your own custom code.


The gf_stripe() function is used to return an instance of the GFStripe class.


Retrieves the feed used to process the entry object. If the Form Object is supplied and an Entry Object isn’t then the first active feed which matches conditional logic will be returned

$feed = gf_stripe()->get_payment_feed( $entry );
  • $entry Entry Object|boolean

    The Entry Object to be checked.

  • $form |boolean

    The Form Object to be used when evaluating feed conditional logic. Defaults to false.

  • Returns Feed Object|boolean

    The feed for this entry or false.


Cancel the Stripe subscription for the customer who was created from the supplied Entry Object.

$result = gf_stripe()->cancel( $entry, $feed );
  • $entry Entry Object

    The Entry Object the subscription/customer was created from.

  • $feed Feed Object

    The Feed Object. Not currently used so you could pass false instead.

  • Returns boolean

    True or false. Indicates if the subscription cancellation was successful.


Removes currency symbol and if required converts the amount to the smallest unit required by the gateway (e.g. dollars to cents).

$amount = gf_stripe()->get_amount_export( $amount, $currency_code );
  • $amount integer|float

    The value to be formatted.

  • $currency_code string

    The currency code.

  • Returns integer|float

    The value which can be safely passed to Stripe.


If necessary convert the amount back from the smallest unit required by the gateway (e.g cents to dollars).

$amount = gf_stripe()->get_amount_import( $amount, $currency_code );


The insert_feed() method can be used to add Stripe feeds.

$feed_id = gf_stripe()->insert_feed( $form_id, $is_active, $meta );
  • $form_id integer

    The ID of the form this feed will be used with.

  • $is_active boolean

    Is this feed active or inactive.

  • $meta Stripe Feed Meta

    An associative array containing the properties which determine the type of transaction which will occur when the feed is processed.

  • Returns integer

    The ID of the new feed.


Add a note to the specified Entry.

gf_stripe()->add_note( $entry_id, $note, $note_type );
  • $entry_id integer

    The ID of the Entry this note should be added to.

  • $note string

    The note to be added.

  • $note_type string

    The type of note to be added. Example values: note, success, or error


Writes a debug message to the log file for the Stripe Add-On. Requires the logging add-on.

gf_stripe()->log_debug( $message );
  • $message string

    The message to be written to the Stripe log.


Writes an error message to the log file for the Stripe Add-On. Requires the logging add-on.

gf_stripe()->log_error( $message );
  • $message string

    The message to be written to the Stripe log.


Include the Stripe API.