WordPress.org

Ready to get started?Download WordPress

Forums

Virtue
Woocommerce/Braintree not working with Virture (2 posts)

  1. scohoe
    Member
    Posted 6 months ago #

    Getting an error when I try to checkout using braintree gateway.

    An error occurred, please try again or try an alternate form of payment.
    Failed to create credit card
    81713 : Expiration year is invalid., 81712 : Expiration month is invalid., 81714 : Credit card number is required., 81725 : Credit card must include either number or venmoSdkPaymentMethodCode.

    According to braintree they are receiving the following information :

    "In the log excerpt below, you will see that we are receiving “nil” for the expiration year and month. I would recommend reaching out to the third party plugin for further investigation.

    Parameters: {"customer"=>{"first_name"=>"Johnny", “last_name”=>"Test", “company”=>nil, “phone”=>"7133795896", “email”=>"pigs@scohoe.com", “credit_card”=>{"number"=>"[FILTERED]", “expiration_month”=>nil, “expiration_year”=>nil, “cardholder_name”=>"Johnny Test", “billing_address”=>{"first_name"=>"Johnny", “last_name”=>"Test", “company”=>nil, “street_address”=>"1234 A Test Lane", “extended_address”=>nil, “locality”=>"Houston", “region”=>"TX", “postal_code”=>"77429", “country_code_alpha2”=>"US"}, “options”=>{"verify_card"=>false}, “cvv”=>"[FILTERED]"}}
    "

    The braintree/woocommerce combination works with twenty thirteen, so I have no idea what it's not working with Virtue, any idea what could be happening?

  2. Malevii4
    Member
    Posted 2 months ago #

    Hi, I have problem with "braintree gateway" like scohoe
    I see errors:
    An error occurred, please try again or try an alternate form of payment.
    Failed to create customer
    81713 : Expiration year is invalid., 81712 : Expiration month is invalid., 81714 : Credit card number is required., 81725 : Credit card must include number, paymentMethodNonce, or venmoSdkPaymentMethodCode.

    I use WordPress 3.8.2, WooCommerce 2.1.8, WooCommerce Braintree Gateway 2.1.2 and custom theme

    Maybe I find problem.
    Problem description:
    The problem is that "Braintree Gateway" plugiun read $POST data with mistake.
    Remind I use WooCommerce Braintree Gateway 2.1.2, maybe in oter versions this plugin bug is fixed.
    If you open /wp-content/plugins/woocommerce-gateway-braintree/templates/checkout/braintree-payment-fields.php file, you can see that inputs and select has name like
    '<select name="braintree-cc-exp-month" ... >' on line 66
    or '<select name="braintree-cc-exp-year" ... > on line 72
    But if you open file /wp-content/plugins/woocommerce-gateway-braintree/includes/class-wc-gateway-braintree.php who handle sended $POST data
    you can find something like this
    'number' => $this->get_post( 'number' ),
    'expirationMonth' => $this->get_post( 'month' ),
    'expirationYear' => $this->get_post( 'year' ),
    function get_post($key) only retrieve data from $POST by key see line 755 this file

    So in function get_post() passed not correct parameters. For example get_post( 'month' ) instead of get_post( 'braintree-cc-exp-month' ).

    This is was problem for me.
    Resolve of problem :
    Need to lead to a single mean $POST data and parameters passed to get_post() function
    Namely $this->get_post( 'month' ) replace $this->get_post( 'braintree-cc-exp-month' ) and other field at all places in this file
    List of field for repalce:
    get_post( 'number' ) -> get_post( 'braintree-cc-number' )
    get_post( 'month' ) -> get_post( 'braintree-cc-exp-month' )
    get_post( 'year' ) -> get_post( 'braintree-cc-exp-year' )
    get_post( 'cvv' ) -> get_post( 'braintree-cc-cvv' )

Reply

You must log in to post.

About this Theme

About this Topic