dr-kd / braintree_perl Goto Github PK
View Code? Open in Web Editor NEWThis project forked from braintree/braintree_perl
braintree perl client library
Home Page: https://www.braintreepayments.com
This project forked from braintree/braintree_perl
braintree perl client library
Home Page: https://www.braintreepayments.com
Installing from cpan fails requiring Moose::Role.
Installing Moose::Role before WebService::Braintree is a suitable workaround.
Would you consider moving from Moose to Moo? I tried doing that, there are not that many issues. The only problem is with AdvancedSearchFields package.
Or simply would you accept a PR? :)
t/unit/pod.t ................................. 1/209
# Failed test 'blib/lib/WebService/Braintree/Configuration.pm'
# at /home/jwright/perl5/lib/perl5/Test/Pod.pm line 219.
# blib/lib/WebService/Braintree/Configuration.pm (32): L<text|scheme:...> is invalid according to perlpod
t/unit/pod.t ................................. 149/209 # Looks like you failed 1 test of 209.
t/unit/pod.t ................................. Dubious, test returned 1 (wstat 256, 0x100)
Validations.pm
croaks when supplied with some valid L3 transaction data (shipping amount, discount amount, and shipping from postal code). More info here: https://developers.braintreepayments.com/reference/general/level-2-and-3-processing/required-fields/node
PR to follow.
In WebService::Braintree::Customer, both create()
and find()
are supposed to return a Result object with the customer()
method available, according to the POD. create()
does this as expected, but find()
returns the actual customer object instead.
Looking through the various Gateway modules, most of the find()
methods return a Result object, but three don't:
Changing these three to match the rest will break existing code, but that probably makes more sense than having some modules work one way and some another (which is how I found the inconsistency). The fix is to remove the ->customer
or equivalent call after _make_request
in each module's find()
method.
...
The other braintree apis (python) seem to return the client_token after running base64 on it, this perl library doesn't.
Moo before 1.00600 lacks the 'coerce => 1' feature for attributes
t/unit/00-load.t ............................. 1/? Bailout called. Further testing stopped:
# Failed test 'use WebService::Braintree;'
# at t/unit/00-load.t line 11.
# Tried to use 'WebService::Braintree'.
# Error: Invalid coerce '1' for WebService::Braintree::_::AmexExpressCheckoutCard->subscriptions not a coderef or code-convertible object at /home/perl/perl5/lib/perl5/Method/Generate/Accessor.pm line 642.
Looking at http://matrix.cpantesters.org/?dist=WebService-Braintree%201.1;reports=1#sl=7,1 there are no more pass reports recently. It seems that the sandbox tests are failing. A sample fail report: http://www.cpantesters.org/cpan/report/5dadcdbc-2ecf-11e8-828a-befe28307975
In HTTP.pm, it checks for the Content-Length header to see if we have a valid response, but Braintree recently made a change in their sandbox to not send that header anymore.
Their python module checks for the length of the body instead, and the attached patch does the same (in addition to checking for the header).
https://github.com/braintree/braintree_python/blob/master/braintree/util/http.py#L80
# Failed test 'use WebService::Braintree;'
# at t/00-load.t line 6.
# Tried to use 'WebService::Braintree'.
# Error: Can't locate DateTime/Format/RFC3339.pm in @INC
Error happened in CentOS v7 when I attempted to install WebService::Braintree
by using cpanm
.
I'm getting an ArgumentError when calling:
WebService::Braintree::Transaction->submit_for_settlement($order_id, $amount);
The code in that module sets $params->{'amount'}
to $amount
, and then calls the equivalently-named method in WebService::Braintree::TransactionGateway. That method has a new verify_params call that doesn't have "amount" on its whitelist, which appears to be causing the failure.
On a related note, all three of submit_for_settlement, update_details, and submit_for_partial_settlement have "description" in their whitelist, whereas Braintree appears to be expecting "descriptor" (based on looking at the API docs and the equivalent Ruby gem -- I haven't actually tried using these fields).
#24 will force TLSv1.2. perhaps there is another way but without this (and the latest Net::SSLeay, IO::Socket::SSL) we're still seeing SSLv23 requested.
When trying to use object notation (as per perldoc), Gateway tries to call WebService::Braintree::Config instead of WebService::Braintree::Configuration. (Fails, unable to find new).
Line 46 on Gateway.pm states:
config => WebService::Braintree::Config->new( $args ),
Should read:
config => WebService::Braintree::Configuration->new( $args ),
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.