Support » Plugin: Paid Memberships Pro » Total Failure – Braintree

  • Resolved revdarkwing

    (@revdarkwing)


    Can’t get this plugin to work using this plugin. Having this error and wanting to eliminate all potential theme issues, I installed a clean WP site.. default theme.. no other plugins and set up the plugin with one membership level and used the default pages. Testing in the Braintree sandbox I get this error.
    Braintree tells me that they are not getting any failed attempts so this tells them that the plugin is not sending the subscription attempt to the Braintree portal.
    Failed to create customer. Expiration date is required. Credit card number is required. Credit card must include number, payment_method_nonce, or venmo_sdk_payment_method_code.

    Pretty much at the end of my wits here and am desperate to get these sites going. Any suggestions would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jason Coleman

    (@strangerstudios)

    Sounds like a Javascript error on your checkout page. Could be caused by another theme/plugin on your site or a conflict. Use the chrome debugger/etc to see if there are JS errors.

    Hard to imagine it being from a plugin conflict when there are no other plugins installed and activated or the theme since it’s the default WP theme.
    Braintree is suggesting to me that it is the fault of the plugin. Not sure how to proceed from here because I don’t think I’m skilled enough to use the chrome debugging tools.
    PS: this failure is happened on IE and Firefox as well as chrome.

    Don’t know if pasting the javascript on the submit payment page would help but here it is..
    —————–

    <script type=”text/javascript” src=”http://mydomain.com/wp-content/themes/twentysixteen/js/skip-link-focus-fix.js?ver=20160816″>
    /**
    * Makes “skip to content” link work correctly in IE9, Chrome, and Opera
    * for better accessibility.
    *
    * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/
    */

    ( function() {
    var isWebkit = navigator.userAgent.toLowerCase().indexOf( ‘webkit’ ) > -1,
    isOpera = navigator.userAgent.toLowerCase().indexOf( ‘opera’ ) > -1,
    isIE = navigator.userAgent.toLowerCase().indexOf( ‘msie’ ) > -1;

    if ( ( isWebkit || isOpera || isIE ) && document.getElementById && window.addEventListener ) {
    window.addEventListener( ‘hashchange’, function() {
    var id = location.hash.substring( 1 ),
    element;

    if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
    return;
    }

    element = document.getElementById( id );

    if ( element ) {
    if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
    element.tabIndex = -1;
    }

    element.focus();

    // Repositions the window on jump-to-anchor to account for admin bar and border height.
    window.scrollBy( 0, -53 );
    }
    }, false );
    }
    } )();
    </script>
    <script type=”text/javascript”>

    /* <![CDATA[ */
    var screenReaderText = {“expand”:”expand child menu”,”collapse”:”collapse child menu”};
    /* ]]> */
    </script>
    <script type=”text/javascript” src=”http://mydomain.com/wp-content/themes/twentysixteen/js/functions.js?ver=20160816″>
    /* global screenReaderText */
    /**
    * Theme functions file.
    *
    * Contains handlers for navigation and widget area.
    */

    ( function( $ ) {
    var body, masthead, menuToggle, siteNavigation, socialNavigation, siteHeaderMenu, resizeTimer;

    function initMainNavigation( container ) {

    // Add dropdown toggle that displays child menu items.
    var dropdownToggle = $( ‘<button />’, {
    ‘class’: ‘dropdown-toggle’,
    ‘aria-expanded’: false
    } ).append( $( ‘<span />’, {
    ‘class’: ‘screen-reader-text’,
    text: screenReaderText.expand
    } ) );

    container.find( ‘.menu-item-has-children > a’ ).after( dropdownToggle );

    // Toggle buttons and submenu items with active children menu items.
    container.find( ‘.current-menu-ancestor > button’ ).addClass( ‘toggled-on’ );
    container.find( ‘.current-menu-ancestor > .sub-menu’ ).addClass( ‘toggled-on’ );

    // Add menu items with submenus to aria-haspopup=”true”.
    container.find( ‘.menu-item-has-children’ ).attr( ‘aria-haspopup’, ‘true’ );

    container.find( ‘.dropdown-toggle’ ).click( function( e ) {
    var _this = $( this ),
    screenReaderSpan = _this.find( ‘.screen-reader-text’ );

    e.preventDefault();
    _this.toggleClass( ‘toggled-on’ );
    _this.next( ‘.children, .sub-menu’ ).toggleClass( ‘toggled-on’ );

    // jscs:disable
    _this.attr( ‘aria-expanded’, _this.attr( ‘aria-expanded’ ) === ‘false’ ? ‘true’ : ‘false’ );
    // jscs:enable
    screenReaderSpan.text( screenReaderSpan.text() === screenReaderText.expand ? screenReaderText.collapse : screenReaderText.expand );
    } );
    }
    initMainNavigation( $( ‘.main-navigation’ ) );

    masthead = $( ‘#masthead’ );
    menuToggle = masthead.find( ‘#menu-toggle’ );
    siteHeaderMenu = masthead.find( ‘#site-header-menu’ );
    siteNavigation = masthead.find( ‘#site-navigation’ );
    socialNavigation = masthead.find( ‘#social-navigation’ );

    // Enable menuToggle.
    ( function() {

    // Return early if menuToggle is missing.
    if ( ! menuToggle.length ) {
    return;
    }

    // Add an initial values for the attribute.
    menuToggle.add( siteNavigation ).add( socialNavigation ).attr( ‘aria-expanded’, ‘false’ );

    menuToggle.on( ‘click.twentysixteen’, function() {
    $( this ).add( siteHeaderMenu ).toggleClass( ‘toggled-on’ );

    // jscs:disable
    $( this ).add( siteNavigation ).add( socialNavigation ).attr( ‘aria-expanded’, $( this ).add( siteNavigation ).add( socialNavigation ).attr( ‘aria-expanded’ ) === ‘false’ ? ‘true’ : ‘false’ );
    // jscs:enable
    } );
    } )();

    // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
    ( function() {
    if ( ! siteNavigation.length || ! siteNavigation.children().length ) {
    return;
    }

    // Toggle focus class to allow submenu access on tablets.
    function toggleFocusClassTouchScreen() {
    if ( window.innerWidth >= 910 ) {
    $( document.body ).on( ‘touchstart.twentysixteen’, function( e ) {
    if ( ! $( e.target ).closest( ‘.main-navigation li’ ).length ) {
    $( ‘.main-navigation li’ ).removeClass( ‘focus’ );
    }
    } );
    siteNavigation.find( ‘.menu-item-has-children > a’ ).on( ‘touchstart.twentysixteen’, function( e ) {
    var el = $( this ).parent( ‘li’ );

    if ( ! el.hasClass( ‘focus’ ) ) {
    e.preventDefault();
    el.toggleClass( ‘focus’ );
    el.siblings( ‘.focus’ ).removeClass( ‘focus’ );
    }
    } );
    } else {
    siteNavigation.find( ‘.menu-item-has-children > a’ ).unbind( ‘touchstart.twentysixteen’ );
    }
    }

    if ( ‘ontouchstart’ in window ) {
    $( window ).on( ‘resize.twentysixteen’, toggleFocusClassTouchScreen );
    toggleFocusClassTouchScreen();
    }

    siteNavigation.find( ‘a’ ).on( ‘focus.twentysixteen blur.twentysixteen’, function() {
    $( this ).parents( ‘.menu-item’ ).toggleClass( ‘focus’ );
    } );
    } )();

    // Add the default ARIA attributes for the menu toggle and the navigations.
    function onResizeARIA() {
    if ( window.innerWidth < 910 ) {
    if ( menuToggle.hasClass( ‘toggled-on’ ) ) {
    menuToggle.attr( ‘aria-expanded’, ‘true’ );
    } else {
    menuToggle.attr( ‘aria-expanded’, ‘false’ );
    }

    if ( siteHeaderMenu.hasClass( ‘toggled-on’ ) ) {
    siteNavigation.attr( ‘aria-expanded’, ‘true’ );
    socialNavigation.attr( ‘aria-expanded’, ‘true’ );
    } else {
    siteNavigation.attr( ‘aria-expanded’, ‘false’ );
    socialNavigation.attr( ‘aria-expanded’, ‘false’ );
    }

    menuToggle.attr( ‘aria-controls’, ‘site-navigation social-navigation’ );
    } else {
    menuToggle.removeAttr( ‘aria-expanded’ );
    siteNavigation.removeAttr( ‘aria-expanded’ );
    socialNavigation.removeAttr( ‘aria-expanded’ );
    menuToggle.removeAttr( ‘aria-controls’ );
    }
    }

    // Add ‘below-entry-meta’ class to elements.
    function belowEntryMetaClass( param ) {
    if ( body.hasClass( ‘page’ ) || body.hasClass( ‘search’ ) || body.hasClass( ‘single-attachment’ ) || body.hasClass( ‘error404’ ) ) {
    return;
    }

    $( ‘.entry-content’ ).find( param ).each( function() {
    var element = $( this ),
    elementPos = element.offset(),
    elementPosTop = elementPos.top,
    entryFooter = element.closest( ‘article’ ).find( ‘.entry-footer’ ),
    entryFooterPos = entryFooter.offset(),
    entryFooterPosBottom = entryFooterPos.top + ( entryFooter.height() + 28 ),
    caption = element.closest( ‘figure’ ),
    newImg;

    // Add ‘below-entry-meta’ to elements below the entry meta.
    if ( elementPosTop > entryFooterPosBottom ) {

    // Check if full-size images and captions are larger than or equal to 840px.
    if ( ‘img.size-full’ === param ) {

    // Create an image to find native image width of resized images (i.e. max-width: 100%).
    newImg = new Image();
    newImg.src = element.attr( ‘src’ );

    $( newImg ).on( ‘load.twentysixteen’, function() {
    if ( newImg.width >= 840 ) {
    element.addClass( ‘below-entry-meta’ );

    if ( caption.hasClass( ‘wp-caption’ ) ) {
    caption.addClass( ‘below-entry-meta’ );
    caption.removeAttr( ‘style’ );
    }
    }
    } );
    } else {
    element.addClass( ‘below-entry-meta’ );
    }
    } else {
    element.removeClass( ‘below-entry-meta’ );
    caption.removeClass( ‘below-entry-meta’ );
    }
    } );
    }

    $( document ).ready( function() {
    body = $( document.body );

    $( window )
    .on( ‘load.twentysixteen’, onResizeARIA )
    .on( ‘resize.twentysixteen’, function() {
    clearTimeout( resizeTimer );
    resizeTimer = setTimeout( function() {
    belowEntryMetaClass( ‘img.size-full’ );
    belowEntryMetaClass( ‘blockquote.alignleft, blockquote.alignright’ );
    }, 300 );
    onResizeARIA();
    } );

    belowEntryMetaClass( ‘img.size-full’ );
    belowEntryMetaClass( ‘blockquote.alignleft, blockquote.alignright’ );
    } );
    } )( jQuery );
    </script>
    <script type=”text/javascript” src=”http://mydomain.com/wp-includes/js/wp-embed.min.js?ver=4.6.1″>
    !function(a,b){“use strict”;function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf(“MSIE 10”),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll(“iframe.wp-embedded-content”);for(c=0;c<i.length;c++)if(d=i[c],!d.getAttribute(“data-secret”)){if(f=Math.random().toString(36).substr(2,10),d.src+=”#?secret=”+f,d.setAttribute(“data-secret”,f),g||h)a=d.cloneNode(!0),a.removeAttribute(“security”),d.parentNode.replaceChild(a,d)}else;}}var d=!1,e=!1;if(b.querySelector)if(a.addEventListener)d=!0;if(a.wp=a.wp||{},!a.wp.receiveEmbedMessage)if(a.wp.receiveEmbedMessage=function(c){var d=c.data;if(d.secret||d.message||d.value)if(!/[^a-zA-Z0-9]/.test(d.secret)){var e,f,g,h,i,j=b.querySelectorAll(‘iframe[data-secret=”‘+d.secret+'”]’),k=b.querySelectorAll(‘blockquote[data-secret=”‘+d.secret+'”]’);for(e=0;e<k.length;e++)k[e].style.display=”none”;for(e=0;e<j.length;e++)if(f=j[e],c.source===f.contentWindow){if(f.removeAttribute(“style”),”height”===d.message){if(g=parseInt(d.value,10),g>1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if(“link”===d.message)if(h=b.createElement(“a”),i=b.createElement(“a”),h.href=f.getAttribute(“src”),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener(“message”,a.wp.receiveEmbedMessage,!1),b.addEventListener(“DOMContentLoaded”,c,!1),a.addEventListener(“load”,c,!1)}(window,document);
    </script>

    revdarkwing

    (@revdarkwing)

    Just to put this issue to bed… Braintree support gave me bad info. They said to omit the Client Side Encryption key as it was not necessary.
    Sorry to bother everyone with this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Total Failure – Braintree’ is closed to new replies.