• Resolved jvo33

    (@jvo33)


    Thanks for the great plugin. There is one problem: If a user clicks the “Other” recurring option and then goes back and clicks one of the 3 fixed amounts, when the user clicks “Donate”, PayPal displays the following error message:

    “Invalid Regular period. You must specify valid values for the A3, P3, and T3 parameters for a subscription.”

    If the user clicks a fixed amount radio button a second time and then clicks Donate, it will work. So something odd is happening with the input “a3” value I think.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wp.insider

    (@wpinsider-1)

    Can you please tell me what shortcode you have used so I can test it?

    Thread Starter jvo33

    (@jvo33)

    Here’s the shortode:
    [dntplgn recurring_amt1="35.00" recurring_amt2="50.00" recurring_amt3="100.00" item_name="Center Membership" paypal_email="[email protected]"]

    I think I found the problem in the meantime. When the “Other” radio button is selected, a “click” function is added to the “Submit” button. That click function sets a3 to the value of the “dntplgn_monthly_other_sum” text box. However, when you switch back to one of the preset amount radio buttons, that click function wasn’t being removed. So when you clicked Submit, it was trying to a3 to a null amount. So I added the follow to the end of the “else” block in script.js:

    $( this ).parent( '.dntplgn_donate_monthly' ).children( '.dntplgn_submit_button' ).off('click');

    • This reply was modified 7 years, 3 months ago by jvo33.
    Plugin Author wp.insider

    (@wpinsider-1)

    Thank you. Can you please share the full content of the file that you modified so I can see where exactly you made the change?

    Thread Starter jvo33

    (@jvo33)

    Here is the full script.js, but note that I had to change a lot of the jQuery references because I changed the HTML/CSS of the form somewhat. So those changes aren’t really relevant. Just look for the “.off(‘click’) line.

    /* Donate Plugin Scripts */
    ( function( $ ) {
        $( document ).ready( function() {
            $( '.dntplgn_monthly_other_sum' ).hide();
            $( '.dntplgn_donate_monthly input[ name="a3" ]' ).click( function() {
                if ( $( this ).parent( '.jvlevel' ).find( '#fourth_button' ).attr( 'checked' ) ) {
                    $( this ).parent( '.jvlevel' ).children( '.dntplgn_monthly_other_sum' ).addClass( 'checked' );
                    $( this ).parents( '.dntplgn_donate_monthly' ).find( '.dntplgn_submit_button' ).click( function() {
                        $( this ).parents( '.dntplgn_donate_monthly' ).find( 'input[ name="a3" ]' ).val( $( this ).parents( '.dntplgn_donate_monthly' ).find( '.dntplgn_monthly_other_sum' ).val() );
                    });
                } else {
                    $( this ).parents( '.dntplgn_donate_monthly' ).find( '.dntplgn_monthly_other_sum' ).removeClass( 'checked' );
                    $( this ).parents( '.dntplgn_donate_monthly' ).find( '.dntplgn_monthly_other_sum' ).val( '' );
                    $( this ).parents( '.dntplgn_donate_monthly' ).find( '.dntplgn_submit_button' ).off('click');
                }
            });
            $( '.dntplgn_form_wrapper' ).tabs();
        });
    })(jQuery);
    Plugin Author wp.insider

    (@wpinsider-1)

    This has been fixed in the new release. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Bug in plugin – “Invalid regular period…” from PayPal’ is closed to new replies.