Fundraising plugin to use Paypal's "Goods/Services" instead of "Donations"?

So, only two weeks after launching my foundation’s brand new website, with the fantastic Fundraising plugin to accept donations, Paypal has stopped us from receiving any out-of-country donations. We can, however, still receive payments for goods and/or services.

I was wondering if there’s a relatively easy way to switch the Fundraising module’s behavior from “Donate” functionality to “Buy Now”.

Otherwise, purchasing the Fundraising module was not a great investment :slight_frown:

Thanks so much!

Mindy :slight_smile:

  • Vinod Dalvi
    • WP Unicorn

    Hi Mindy,

    Sorry to hear of the problems you are having.

    This will certainly take a bit of trial and error to try to figure it out.

    Therefore in an effort of expediency I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advise for us.

    I have notified him and he will reply on this thread.

    In the meanwhile you can use Manual Payment Gateway for Fundraising from the following path.

    Admin area -> Fundraising -> Settings -> Payments tab

    Cheers,

    Vinod Dalvi

  • Mindy
    • WPMU DEV Initiate

    Hi Vinod,

    Thank you for responding. I took a bit of time and investigated the template files (teimplate-functions.php and paypal.php) and figured out the variables getting sent to Paypal.

    I have managed to get something working by making the following changes:

    In template-functions.php,

    <input type="hidden" name="cmd" value="_donations" />

    became

    <input type="hidden" name="cmd" value="_xclick" />

    and

    if(isset($args['widget_args']['button_type']) && $args['widget_args']['button_type'] == 'default') {
    //Use default PayPal Button

    if(isset($args['widget_args']['small_button']) && $args['widget_args']['small_button'] == 'yes') {
    $content .= '<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest">';
    $content .= '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">';
    } else {
    if(isset($args['widget_args']['show_cc']) && $args['widget_args']['show_cc'] == 'yes') {
    $content .= '<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest">';
    $content .= '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">';
    } else {
    $content .= '<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">';
    $content .= '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">';
    }
    }

    became

    if(isset($args['widget_args']['small_button']) && $args['widget_args']['small_button'] == 'yes') {
    $content .= '<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">';
    $content .= '<input type="image" src="https://www.paypalobjects.com/en_GB/TH/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">';
    } else {
    if(isset($args['widget_args']['show_cc']) && $args['widget_args']['show_cc'] == 'yes') {
    $content .= '<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">';
    $content .= '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">';
    } else {
    $content .= '<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHosted">';
    $content .= '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">';
    }
    }

    Also, in /lib/gateways/paypal.php, I modified the variables related to Paypal donations and changed it to simple purchases:

    if( isset($_SESSION['wdf_recurring']) && $_SESSION['wdf_recurring'] != false ) {
    //$this->add_query('cmd', '_xclick-auto-billing');
    //$this->add_query('&min_amount', 1.00);
    //$this->add_query('&max_amount', $wdf_send_obj->send_amount);
    $nvp = 'cmd=_xclick-subscriptions';
    $nvp .= '&a3='.$_SESSION['wdf_pledge'];
    $nvp .= '&p3=1';
    $nvp .= '&t3='.$_SESSION['wdf_recurring'];
    $nvp .= '&bn=PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted';
    $nvp .= '&src=1';
    $nvp .= '&sra=1';
    $nvp .= '&modify=1';
    } else {
    $nvp = 'cmd=_xclick';
    $nvp .= '&amount='.urlencode($_SESSION['wdf_pledge']);
    $nvp .= '&cbt='.urlencode( isset($settings['paypal_return_text']) ? $settings['paypal_return_text'] : __('Click Here To Complete Your Donation', 'wdf') );
    $nvp .= '&bn=PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted';
    }

    The donor who couldn’t donate just managed to make her payment and it’s recorded in the plugin’s Pledge list. If the developer of this plugin investigates this modification, I would love to know if I’ve set a landmine somewhere… :slight_smile:

    Thanks so much!

  • Vinod Dalvi
    • WP Unicorn

    Hi Mindy,

    Awesome, great to see you found the solution and thank you for sharing it in the community.

    The developer will reply on this providing feedback on your solution.

    I just want to notify you that you are making changes in plugin code and it will be overwritten on updating the plugin so you have to make the same changes again after updating the plugin.

    In this case i suggest you to do it this way:

    Take a backup of your current changed plugin.

    Download the updated version of plugin

    Make required changes in it

    After making changes fully test the changed plugin on your development site.

    If it works fine then upload it on your live site deleting existing one.

    Cheers,

    Vinod Dalvi

  • Maniu
    • Developer

    Hey @mindy

    It looks solid to me, certainly if its working for you:slight_smile: This seems like good workaround for your problem. It seems like good thing to implement as standard feature but i never saw anyone have exact same problem like yours.

    If you are using windows machine, i suggest winmerge program that will help you keep your changes in sync with new version.

    Thanks,

    Maniu

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.