Jump to:

113 Posts in 222 Topics by 53 members

Payments and Payment Gateway / APIs

SilverStripe Forums » Payments and Payment Gateway / APIs » Call to a member function setCurrency() on a non-object

This is a forum for discussing SilverStripe can-do payments and their APIs / Gateways.

Moderators: martimiz, Sean, Normann, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2462 Views
  • gakenny
    Avatar
    Community Member
    153 Posts

    Call to a member function setCurrency() on a non-object Link to this post

    Hello,

    I have just being trying out the standalone payment module with payment-test.

    I have enabled the Donation options in PayablesDemoPage.ss and PayableAdmin.php and I can see this listed on the Payments page of the website.

    Clicking the [Make a donation] button brings up the correct form to submit a donation. However completing the form, selecting the currency from the dropdown and submitting renders this error:
    Fatal error: Call to a member function setCurrency() on a non-object in /home/site/public_html/greatbig/sapphire/forms/MoneyField.php on line 104

    Have I configured something incorrectly?

    I have the following versions installed:
    SilverStripe v2.4.1
    Payments v0.3
    Payment-Test v0.1

    Cheers,

    Gary

  • Scott Farmer
    Avatar
    Community Member
    35 Posts

    Re: Call to a member function setCurrency() on a non-object Link to this post

    A bit of late reply, but hopes this helps others.

    I had a similar problem. The solution for me was to enable the Donations extension in the _Config.php file.

    e.g.

    <?php

    Object::add_extension('ProductObject', 'Payable');
    Object::add_extension('Donation', 'Payable');
    //Object::add_extension('Ebook', 'Payable');
    //Object::add_extension('MovieTicket', 'Payable');
    //Object::add_extension('Member', 'ProductBuyer');

    ?>

    Then run /dev/build/?flush=1

    Cheers

    2462 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.