interchange / business-onlinepayment-braintree Goto Github PK
View Code? Open in Web Editor NEWOnline payment processing through Braintree
Online payment processing through Braintree
NAME Business::OnlinePayment::Braintree - Online payment processing through Braintree VERSION Version 0.020 SYNOPSIS use Business::OnlinePayment; $tx = new Business::OnlinePayment('Braintree', merchant_id => 'your merchant id', public_key => 'your public key', private_key => 'your private key', ); $tx->test_transaction(1); # sandbox transaction for development and tests $tx->content(amount => 100, card_number => '4111 1111 1111 1111', expiration => '1212'); $tx->submit(); if ($tx->is_success) { print "Card processed successfully: " . $tx->authorization . "\n"; } else { print "Card was rejected: " . $tx->error_message . "\n"; } DESCRIPTION Online payment processing through Braintree based on Net::Braintree. The documentation for Net::Braintree is located at https://www.braintreepayments.com/docs/perl. NOTES This is supposed to cover the complete Braintree Perl API finally. METHODS submit Submits transaction to Braintree gateway. sale $submit Performs sale transaction with Braintree. Used both for settlement ($submit is a true value) and authorization ($submit is a false value). set_defaults Sets defaults for the Braintree merchant id, public and private key. AUTHOR Stefan Hornburg (Racke), <racke at linuxia.de> BUGS Please report any bugs or feature requests to bug-business-onlinepayment-braintree at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Business-OnlinePayment-Braintree. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. You can find documentation for this module with the perldoc command. perldoc Business::OnlinePayment::Braintree You can also look for information at: * Github issues (report bugs here) https://github.com/interchange/Business-OnlinePayment-Braintree/issues * AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Business-OnlinePayment-Braintree * CPAN Ratings http://cpanratings.perl.org/d/Business-OnlinePayment-Braintree * Search CPAN http://search.cpan.org/dist/Business-OnlinePayment-Braintree/ ACKNOWLEDGEMENTS Grant for the following enhancements (RT #88525): billing address transmission order number transmission refund ability added submit_for_settlement to complete the "sale" action Peter Mottram for the following enhancements (GH #5): Failure status Set failure status from error codes provided by Braintree. CVV Pass cvv to Braintree. Evan Brown (GH #7, #8): Add support for post authorization action. Add support for the void action and the card_token transaction result method. LICENSE AND COPYRIGHT Copyright 2011-2016 Stefan Hornburg (Racke). This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. SEE ALSO Net::Braintree
This page says that The documentation for Net::Braintree is located at https://www.braintreepayments.com/docs/perl.
That's not true anymore (returns error 404)
Is merchant_account_id meant to be passed like this?
[charge gateway=onlinepayment processor=Braintree id="" secret="" merchant_id="" public_key="" private_key="" merchant_account_id="" transaction="" amount=""]
When I do that I get "Merchant account ID is invalid". I ran into this problem previously which is why I used referer. referer is defined in lib/Vend/Payment/BusinessOnlinePayment.pm which allows it to work in place of merchant_account_id in the [charge] tag above.
Is there another variable in BusinessOnlinePayment.pm which you'd rather use?
-- if (exists $content{merchant_account_id}
-- && $content{merchant_account_id}) {
-- $args{merchant_account_id} = $content{merchant_account_id};
++ if (exists $content{referer}
++ && $content{referer}) {
++ $args{merchant_account_id} = $content{referer};
It was necessary for me to make three additional changes in order for Business-OnlinePayment-Braintree to work.
This change is required in order to retrieve the transaction ID properly:
-- $self->authorization($result->transaction->id);
++ $self->order_number($result->transaction->id);
With Braintree there are two account IDs. One ID is associated with your account as a whole and the second ID is associated with an individual "store" within your account. This way they allow you to have multiple stores within a single account. This change is required for compatibility with that layout:
amount => $content{amount},
++ merchant_account_id => $content{referer},
order_id => $content{invoice_number},
This change is required to avoid an "Expiration year is invalid" error on my system:
++ expiration_date => $content{expiration},
-- expiration_month => substr($content{expiration},0,2),
-- expiration_year => substr($content{expiration},2,2),
Interchange stuff:
[charge gateway=onlinepayment processor=Braintree id="" secret="" merchant_id="" public_key="" private_key="" referer="" transaction="" amount=""]
Revision history for Net-Braintree
0.18.0 12/31/2013
Merchant account find API
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.