Giter Club home page Giter Club logo

business-onlinepayment-braintree's Introduction

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

business-onlinepayment-braintree's People

Contributors

evanernest avatar racke avatar syspete avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

business-onlinepayment-braintree's Issues

merchant_account_id fails

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};

3 critical changes

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=""]

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.