Comments (5)
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.
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.
Hi Rob!
Sorry for the delay.
What do you think about splitting the logic like this (is kind of what you said here)?
from cakephp-paypal.
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.
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)
- Should we use the Paypal Rest API SDK PHP? HOT 2
- Internal Error HOT 3
- suspected error function/update suggestion: storeCreditCard() HOT 2
- Notify Url not working HOT 3
- Currency on direct payment. HOT 3
- Payment not debited to personal account. HOT 1
- HELP! HOT 3
- Not support quantity HOT 2
- 3.x? HOT 4
- How to send money to another paypal email from paypal account
- how to track credit card transaction in paypal
- PaypalRedirectException is never thrown due to an empty $parsed['TOKENβ] on line 413 HOT 4
- Help: payerId and token
- can you provide it for cakephp 3 i need urgently
- Returned Token? HOT 1
- storeCreditCard Response HOT 1
- Express Checkout SSL problem on MAMP 3.5 HOT 3
- Payments to multiple accounts HOT 1
- Payment Problem: You must pass a valid order array HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cakephp-paypal.