Giter Club home page Giter Club logo

Comments (5)

robmcvey avatar robmcvey commented on August 23, 2024

I do like this yes, as we add more methods, versions and endpoints are becoming messy!

How about Lib/PaypalClassic.php and Lib/PaypalREST.php and then the main plugin Lib/Paypal.php simply abstracts all the methods?

As long as the main plugin methods are uniform and don't include any messy configuration, this could be a good move!

I'll start a new branch and separate the test cases accordingly for now, then we can see how best to split the logic.

from cakephp-paypal.

zot24 avatar zot24 commented on August 23, 2024

Cool mate!

I'm just creating more and more methods for the REST API like payment with and without creditcard, get stored credit card and more.

I'll push it on my fork and then I'll merge with your new approach and do a pull request against you again :)

from cakephp-paypal.

zot24 avatar zot24 commented on August 23, 2024

Hi Rob!

Sorry for the delay.

What do you think about splitting the logic like this (is kind of what you said here)?

split-logic branch

from cakephp-paypal.

robmcvey avatar robmcvey commented on August 23, 2024

Yes that looks like a step in the right direction! How do you think we can approach testing though? I noticed many new private methods which had no public interface nor were being called from the main public methods - so testing these is going to be impossible.

Do you think there is also a way of reducing the number of files needed? What was the intention behind including a Controller/Component?

from cakephp-paypal.

zot24 avatar zot24 commented on August 23, 2024

I was looking made easy use the library on our CakePHP projects something like by adding another layer over the Lib files:

// That way the library to use will be autoinitialize in the component
// and we'll be using an interface to do all the call agaist either the classic api or the rest api
public $components = array('Paypal => array(config => array('api' => 'rest')));

$this->Paypal->doPaypalPayment($object):

$this->Paypal->doCreditCardPayment($object):

About testing the private method we can do it by using a proxy class or something like that.

from cakephp-paypal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.