drewjoh / phppaypal Goto Github PK
View Code? Open in Web Editor NEWA PHP class to make it easy to interact with PayPal, especially Website Payments Pro.
Home Page: drewjoh.com/wiki/code/classes/phppaypal
A PHP class to make it easy to interact with PayPal, especially Website Payments Pro.
Home Page: drewjoh.com/wiki/code/classes/phppaypal
You have 'token' as a required field, but PayPals API docs say 'After you have collected the information, call the CreateRecurringPaymentsProfile API for each profile to be created. TheCreateRecurringPaymentsProfile request must contain all required credit card information and must not contain a value for the TOKEN field.'
I found the following on: https://github.com/drewjoh/phpPayPal/wiki/Setup
$paypal = new Paypal($config, true); // true = LIVE Server
All evidence points to true being the sandbox
'nest_billing_date' => 'NEXTBILLINGDATE',
'next_billing_date' => 'NEXTBILLINGDATE',
The constructor is not proper -- you shouldn't necessarily include a conditional inside a constructor. I would recommend simply allowing the user to pass those private variables to the new class upon declaring it. IE: Remove the constructor and at the top of the class include commented out sample settings for both sandbox and live. Then inform user to pass these vars to the class upon declaration. Is there a better alternative?
API version 53 uses different item vars, etc.
You should update the http://drewjoh.com/wiki/code/classes/phppaypal wiki with related links to github rather than google code. Otherwise you're pointing people to github from there, and from here you're pointing them back to google code. And so forth. It would lead to unwanted confusion.
I assume proxy / return and cancel url's are optional.
Hence:
$this->USE_PROXY = isset($config['use_proxy']) ? $config['use_proxy']:FALSE ;
$this->PROXY_HOST = isset($config['proxy_host']) ? $config['proxy_host']:NULL ;
$this->PROXY_PORT = isset($config['proxy_port']) ? $config['proxy_port']:NULL;
$this->return_url = isset($config['return_url']) ? $config['return_url'] :NULL;
$this->cancel_url = isset($config['cancel_url']) ? $config['cancel_url'] :NULL;
Awsome class btw :)
Hi!
Recently, I saw that format_response() always copies the variables which are given for a 'DoReferenceTransaction' response and doesn't make any differences of the response type. So format_response() should have a parameter $type like generateNVPString().
However, thanks for the nice work! Very helpful!
First off, thanks for writing and sharing a great piece of code! In testing, I discovered that the items were not being displayed on the Express Checkout screen, a problem that was easily fixed, once I figured out how to do it. I simply copied your items processing loop from the do_direct_payment method into the set_express_checkout() method.
As a side note, I actually started with the version of the items processing loop found in do_express_checkout_payment(), but got an error because the TAXAMT NVP was missing from the output. The do_direct_payment() method included this NVP, so I used it instead, but it looks to me like TAXAMT might ought to have been included in do_express_checkout_payment() as well. I haven't completed testing on my implementation, so I don't know whether it will make any difference in my application or not. In any case, I wonder if you might want to consider moving the items processing loop to its own function, which would make problems such as this easier to fix. You may very well have good reasons for not doing it this way - just thought I'd make the suggestion. Thanks again and keep up the good work!
Line 908 is currently:
'cvv2_match' => 'AVV2MATCH',
But should be
'cvv2_match'=>'CVV2MATCH',
Line 897 -- period should be a comma.
As title, I wonder know this project status.
Some issues and PRs need to be reviewed, concerned and merged.
@drewjoh, could you concern this issue if possible at your available time? Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.