Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter theabsurdman

    (@theabsurdman)

    Great support! I think that fixes all my problems, thanks again.

    Thread Starter theabsurdman

    (@theabsurdman)

    Can’t really post the URL as the site is in development and we don’t want it spidered yet.

    Could I email it to you privately?

    Thread Starter theabsurdman

    (@theabsurdman)

    Great! I appreciate the rapid response. I can read the $requestData values now, thanks.

    Still not getting my custom field as “required” though, I get this:

    <input class="glsr-input glsr-input-text" id="site-reviews-wherefrom-glsr_6022cc42" name="site-reviews[wherefrom]" type="text" placeholder="Enter home location" required="" value="">

    Strange! I might have to set it with jQuery if all else fails!

    One more question – how does the validation hook return “a custom error message string on failure”?

    /**
     * Perform custom validation here if needed
     * Paste this in your active theme's functions.php file.
     * @param bool $isValid
     * @param array $requestData
     * @return bool|string
     */
    add_filter('site-reviews/validate/custom', function ($isValid, $requestData) {
        // return true on success
        // or return false on failure
        // or return a custom error message string on failure
    	
    	glsr_log($requestData['wherefrom']);
    	
        return $isValid;
    }, 10, 2);

    Thanks again.

    • This reply was modified 4 years, 2 months ago by theabsurdman.
    • This reply was modified 4 years, 2 months ago by theabsurdman.

    I don’t know details but you might be able to add a line to the parameters blocks defined in the paypalapi.php file. This is the code that connects with paypal.

    – Go to “Paypal Express Checkout” in “WordPress Plugins” and click on “Edit”
    – From the right panel select the Plugin file: paypal-express-checkout-classes-paypalapi.php

    rbernabe16:

    it’s this function, starting on line 171:

    function DoExpressCheckout($result) {
    
          $config = HCCoder_PayPalConfig::getInstance();
    
          // FIELDS
          $fields = array(
                  'USER' => urlencode(get_option('paypal_api_username')),
                  'PWD' => urlencode(get_option('paypal_api_password')),
                  'SIGNATURE' => urlencode(get_option('paypal_api_signature')),
                  'VERSION' => urlencode('72.0'),
                  'PAYMENTREQUEST_0_PAYMENTACTION' => urlencode('Sale'),
                  'PAYERID' => urlencode($result['PAYERID']),
                  'TOKEN' => urlencode($result['TOKEN']),
                  'PAYMENTREQUEST_0_AMT' => urlencode($result['AMT']),
    'PAYMENTREQUEST_0_CURRENCYCODE' => urlencode($result['CURRENCYCODE']),
                  'METHOD' => urlencode('DoExpressCheckoutPayment')
              );

    see code snippet above, with the missing line already added.

    Thread Starter theabsurdman

    (@theabsurdman)

    Hi, I fixed it! here’s the step-by-step solution for anybody interested:

    – Go to “Paypal Express Checkout” in “WordPress Plugins” and click on “Edit”
    – From the right panel select the Plugin file: paypal-express-checkout-classes-paypalapi.php
    – Search for “_express-checkout”. there will be 2 instances found.

    – replace each with “_express-checkout&useraction=commit” ie. the code should now read:

    if ( get_option('paypal_environment') == 'sandbox' )
              header('Location: https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token='.$result['TOKEN']);
            elseif ( get_option('paypal_environment') == 'live' )
              header('Location: https://www.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token='.$result['TOKEN']);
            exit;

    – click “Update File”
    – reload your payment page and try an express checkout.
    – when you go the paypal, the “Your rder summary” panel will now display the item totals correctly and there will be a “Pay Now” (not “continue”) button.

    Great plugin now. many thanks to the author.

    Rgds
    john

Viewing 6 replies - 1 through 6 (of 6 total)