Skip to content

stripe-form-in.inc.php incorrectly looking for %%source_token%% in templates #510

Closed

Description

@raamdev

A user reports on WordPress.org:

I think there is a bug in the latest version of stripe-form-in.inc.php on line 601:

$custom_template = $custom_template && stripos($custom_template, '%%source_token%%') !== FALSE ? $custom_template : ''; // Custom template must be up-to-date.

It looks like its checking to see if the custom template path has the string %%source_token%%. The path would pretty much never have that string.

I imagine it should be checking if the contents (not the path) of that file has the string %%source_token_summary%% (not %%source_token%%).

This applies on line 346, 450, and 601.

I had to comment out this line so that I could use a custom template.

Here's line 601 in stripe-form-in.inc.php (note that this line repeats several times in this file).

@jaswsinc I reviewed the code and concur that the Stripe templates in s2member-pro/includes/templates/forms/ do not include %%source_token%% but rather %%source_token_summary%%, so that line in stripe-form-in.inc.php looks wrong to me too.


Support threads referencing this issue

Activity

  1. raamdev commented on Mar 6, 2015

    @raamdev
    ContributorAuthor
  2. jaswrks commented on Mar 6, 2015

    @jaswrks
    Contributor

    Copy that. Thank you! ~ Taking a closer look.

  3. jaswrks commented on Mar 6, 2015

    @jaswrks
    Contributor

    🙈 I don't how I could have gotten this any more wrong.
    I'll have a short-term patch available momentarily. Very sorry.

  4. added 2 commits that reference this issue on Mar 6, 2015
  5. jaswrks commented on Mar 6, 2015

    @jaswrks
    Contributor

    Short-Term Patch

    Please download this updated file and upload it to your WordPress installation. Allowing this updated file to overwrite your existing copy of: /s2member-pro/includes/classes/gateways/stripe/stripe-form-in.inc.php ~ This will allow custom templates which are up-to-date; i.e., those which contain %%source_token_summary%% to work as intended.

  6. jaswrks commented on Mar 6, 2015

    @jaswrks
    Contributor

    Next Release Changelog:

    • (s2Member Pro) Stripe Pro-Forms: This release corrects a bug first introduced in the last release that prevented custom templates for Stripe Pro-Forms from working as intended. Please see this GitHub issue if you'd like additional details.
  7. raamdev commented on Mar 6, 2015

    @raamdev
    ContributorAuthor

    @jaswsinc Thank you! I'll go ahead and update those WordPress.org support threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions