Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,029
    Plugin Contributions
    29

    Default Payment module class extends base, making a payment module.

    In the class name, some payment modules just have the class name, others have the class name and "extends base".
    When is that needed/for what?

    Apart from that, is there any documentation for the construction of/standard functions required in payment modules?
    If not, what would be the best module to use as a reference?
    Steve
    github.com/torvista: Apsona (php7), BackupMySQL Admin/Auto, Product Listing Sorter, Redsys payment module, Spanish Language Pack and more...

  2. #2
    Join Date
    Jul 2012
    Posts
    14,471
    Plugin Contributions
    17

    Default Re: Payment module class extends base, making a payment module.

    The primary benefit of extending the base class that I have seen is the direct use of the notifier system ($this->notify('I_AM_A_NOTIFIER');) instead of having to include the global $zco_notifier variable( global $zco_notifier; $zco_notifier->notify('I_AM_A_NOTIFIER');). Generally speaking, extending a class offers the ability to access methods of that class based on their visibility (protected or public) where if the method is not defined in this class, then it is accessed in the parent class(es).

    As far as methods either expected or available, the payment class identifies the methods that will be checked within the payment module. In some perhaps most cases, the method can be absent and it will default to a value of false, but as I recall there are some methods that are expected and do not have such "ditch out" responses.

    As far as a method to be used as an example, primarily it depends on how the payment method operates. Those that require the order number to exist prior to obtaining payment generally need some sort of unique place holder so that the payment information can be sent, a satisfactory response received and the order committed to the database. Others such as paypal express use transactional information to relate to the payment and do not appear to need the order number as part of the payment request and therefore can process and complete payment before the cart commits the order.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,029
    Plugin Contributions
    29

    Default Re: Payment module class extends base, making a payment module.

    Ok, thanks. That's cleared that up!
    Steve
    github.com/torvista: Apsona (php7), BackupMySQL Admin/Auto, Product Listing Sorter, Redsys payment module, Spanish Language Pack and more...

  4. #4
    Join Date
    Jul 2012
    Posts
    14,471
    Plugin Contributions
    17

    Default Re: Payment module class extends base, making a payment module.

    Quote Originally Posted by torvista View Post
    Ok, thanks. That's cleared that up!
    Really?! Not being facetious? My response cleared up an issue and was understood? :) (for other readers, we have a bit of a history)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,029
    Plugin Contributions
    29

    Default Re: Payment module class extends base, making a payment module.

    Not being facetious in the slightest!!
    Steve
    github.com/torvista: Apsona (php7), BackupMySQL Admin/Auto, Product Listing Sorter, Redsys payment module, Spanish Language Pack and more...

  6. #6
    Join Date
    Jul 2012
    Posts
    14,471
    Plugin Contributions
    17

    Default Re: Payment module class extends base, making a payment module.

    Quote Originally Posted by torvista View Post
    Not being facetious in the slightest!!
    Whew. 1:unknown. :) I always try to answer your questions as you still ask for understanding and try to seek solutions. :) sometimes I am able to help, sometimes not, but I continue to try.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

 

 

Similar Threads

  1. Replies: 1
    Last Post: 12 Dec 2014, 05:37 AM
  2. PHP Fatal error: Class 'SHA' not found - addon payment module
    By wirefram in forum Addon Payment Modules
    Replies: 0
    Last Post: 30 Oct 2011, 05:59 PM
  3. Tutorial on making a new payment module?
    By superprg in forum Addon Payment Modules
    Replies: 3
    Last Post: 16 Jan 2009, 11:21 AM
  4. Table Rate Payment module , where to change base shipping weight?
    By b18cya in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 30 May 2007, 03:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR