diff options
author | gregor herrmann <gregoa@debian.org> | 2015-12-05 19:55:38 +0100 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2015-12-05 19:55:38 +0100 |
commit | b49cc62340ec8535b7351efc60a2287834bf694a (patch) | |
tree | e024ade52a4ea6e22bd57f5b7a156078cdfae11a | |
parent | 15c1e8f4b9032dd1f9663b3f69243702769f8ede (diff) | |
parent | c7d666bbb18b8d77a12d3a1ff0adcfb78b10c9b6 (diff) |
Merge tag 'upstream/3.04'
Upstream version 3.04
-rw-r--r-- | Changes | 7 | ||||
-rw-r--r-- | FraudDetect.pm | 2 | ||||
-rw-r--r-- | META.json | 8 | ||||
-rw-r--r-- | META.yml | 17 | ||||
-rw-r--r-- | Makefile.PL | 5 | ||||
-rw-r--r-- | OnlinePayment.pm | 34 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | notes_for_module_writers_v3 | 56 |
8 files changed, 102 insertions, 31 deletions
@@ -1,12 +1,17 @@ Revision history for Perl extension Business::OnlinePayment. +3.04 Thu Dec 3 12:49:59 PST 2015 + - Partial authorizations + - Doc: Moo is a-okay for module authors + - Doc: update URLs for new domain + 3.03 Tue Apr 29 11:14:25 PDT 2014 - Document Reverse Authorization action - Document expiration is MM/YY and fix the example - Document repository moved from CVS to git - Add avs_code and cvv2_response to build_subs, they're standard fields - Document best-practice eval of the submit() method in example - - Rework build_subs(), thanks to Michal Schwern, closes: CPAN#22073 + - Rework build_subs(), thanks to Michael Schwern, closes: CPAN#22073 3.02 Fri Aug 19 16:20:04 PDT 2011 - Fix fatal error calling ->info('supported_actions') on a gateway that diff --git a/FraudDetect.pm b/FraudDetect.pm index c193239..243bccb 100644 --- a/FraudDetect.pm +++ b/FraudDetect.pm @@ -81,7 +81,7 @@ THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, =head1 SEE ALSO -L<Business::OnlinePayment>, http://420.am/business-onlinepayment +L<Business::OnlinePayment>, http://perl.business/onlinepayment =cut @@ -4,7 +4,7 @@ "Ivan Kohler <ivan-business-onlinepayment@420.am>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921", + "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.150005", "license" : [ "unknown" ], @@ -38,5 +38,9 @@ } }, "release_status" : "stable", - "version" : "3.03" + "resources" : { + "homepage" : "http://perl.business/onlinepayment" + }, + "version" : "3.04", + "x_serialization_backend" : "JSON::PP version 2.27203" } @@ -3,21 +3,24 @@ abstract: unknown author: - 'Ivan Kohler <ivan-business-onlinepayment@420.am>' build_requires: - ExtUtils::MakeMaker: 0 + ExtUtils::MakeMaker: '0' configure_requires: - ExtUtils::MakeMaker: 0 + ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921' +generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.150005' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + version: '1.4' name: Business-OnlinePayment no_index: directory: - t - inc requires: - Net::HTTPS::Any: 0 - Tie::IxHash: 0 -version: 3.03 + Net::HTTPS::Any: '0' + Tie::IxHash: '0' +resources: + homepage: http://perl.business/onlinepayment +version: '3.04' +x_serialization_backend: 'CPAN::Meta::YAML version 0.012' diff --git a/Makefile.PL b/Makefile.PL index 03657c1..20f4ad0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,5 +11,10 @@ WriteMakefile( 'Tie::IxHash' => 0, 'Net::HTTPS::Any' => 0, }, + 'META_MERGE' => { + resources => { + homepage => 'http://perl.business/onlinepayment', + }, + }, #'dist' => {CI => 'ci -l'}, ); diff --git a/OnlinePayment.pm b/OnlinePayment.pm index f3d221c..0b598f1 100644 --- a/OnlinePayment.pm +++ b/OnlinePayment.pm @@ -6,7 +6,7 @@ use Carp; require 5.005; -$VERSION = '3.03'; +$VERSION = '3.04'; $VERSION = eval $VERSION; # modperlstyle: convert the string into a number # Remember subclasses we have "wrapped" submit() with _pre_submit() @@ -19,6 +19,7 @@ my @methods = qw( failure_status fraud_detect is_success + partial_auth_amount maximum_risk path port @@ -381,6 +382,16 @@ just a whole or floating point number (i.e. 26, 26.1 or 26.13). =over 4 +=item partial_auth + +If you are prepared to handle partial authorizations +(see L<partial_auth_amount()|/"partial_auth_amount()"> + in L<TRANSACTION RESULT FIELDS|/"TRANSACTION RESULT FIELDS">), +pass a true value in this field to enable them. + +If this flag is not set, a partial authorization will be immediately reversed +or voided. + =item description A description of the transaction (used by some processors to send @@ -654,6 +665,15 @@ Returns true if the transaction was approved by the gateway, false if it was submitted but not approved, or undef if it has not been submitted yet. +=head2 partial_auth_amount() + +If this transaction was a partial authorization (i.e. successful, but less than +the requested amount was processed), then the amount processed is returned in +this field. + +(When is_success is true but this field is empty or 0, that indicates a normal +full authorization for the entire requested amount.) + =head2 error_message() If the transaction has been submitted but was not accepted, this @@ -790,7 +810,7 @@ Phil Lobbes E<lt>phil at perkpartners dot comE<gt> Copyright (c) 1999-2004 Jason Kohles Copyright (c) 2004 Ivan Kohler -Copyright (c) 2007-2014 Freeside Internet Services, Inc. +Copyright (c) 2007-2015 Freeside Internet Services, Inc. All rights reserved. @@ -799,9 +819,9 @@ the same terms as Perl itself. =head1 HOMEPAGE -Homepage: http://420.am/business-onlinepayment/ +Homepage: http://perl.business/onlinepayment -Development: http://420.am/business-onlinepayment/ng.html +Development: http://perl.business/onlinepayment/ng.html =head1 MAILING LIST @@ -817,11 +837,15 @@ The code is available from our public git repository: Or on the web: http://freeside.biz/gitweb/?p=Business-OnlinePayment.git + Or: + http://freeside.biz/gitlist/Business-OnlinePayment.git Many (but by no means all!) processor plugins are also available in the same repository, see: http://freeside.biz/gitweb/ + Or: + http://freeside.biz/gitlist/ =head1 DISCLAIMER @@ -831,7 +855,7 @@ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. =head1 SEE ALSO -http://420.am/business-onlinepayment/ +http://perl.business/onlinepayment For verification of credit card checksums, see L<Business::CreditCard>. @@ -1,6 +1,6 @@ Copyright (c) 1999-2004 Jason Kohles Copyright (c) 2004 Ivan Kohler -Copyright (c) 2007-2012 Freeside Internet Services, Inc. +Copyright (c) 2007-2015 Freeside Internet Services, Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -16,7 +16,7 @@ system, in order to use it you also need to have at least one backend processing module installed. Homepage: - http://420.am/business-onlinepayment/ + http://perl.business/onlinepayment Search CPAN for backends: http://search.cpan.org/search?m=all&q=Business::OnlinePayment:: diff --git a/notes_for_module_writers_v3 b/notes_for_module_writers_v3 index 1d848f5..86172c5 100644 --- a/notes_for_module_writers_v3 +++ b/notes_for_module_writers_v3 @@ -2,14 +2,17 @@ These are the module writer's notes for v3. See the regular "notes_for_module_writers" file first. -- If your gateway is HTTPS-based, use (or convert to) += Business::OnlinePayment::HTTPS = + + If your gateway is HTTPS-based, use (or convert to) Business::OnlinePayment::HTTPS !! + Note: The correct thing for modern B:OP: gateway modules that need to speak HTTPS to do is to use Business::OnlinePayment::HTTPS and depend on "Net::HTTPS::Any" (since B:OP itself doesn't). -- Handling failures: += Handling failures = - If your processor module encounters a setup problem, communication error or other problem that's prevents the card from even being @@ -31,16 +34,8 @@ These are the module writer's notes for v3. See the regular - "inactive" (inactive card or not authorized for card-not-present) (?) - "decline" (other card/transaction declines only, not other errors) - You should use code like this so your module can work with B:OP versions - before 3.00_04: - - $self->build_subs('failure_status') unless $self->can('failure_status'); - - (or add "failure_status" to your build_subs call if you have one during - initialization) - -- (NEW IN 3.01) Introspection: += (NEW IN 3.01) Introspection = - Add an _info subroutine to your module that returns a hashref of information: @@ -55,6 +50,7 @@ These are the module writer's notes for v3. See the regular 'supported_types' => [ qw( CC ECHECK ) ], 'token_support' => 0, #card storage/tokenization support 'test_transaction' => 0, #set true if ->test_transaction(1) works + 'partial_auth' => 0, #can gateway partial auth (new in 3.04) 'supported_actions' => [ 'Normal Authorization', 'Authorization Only', @@ -65,7 +61,8 @@ These are the module writer's notes for v3. See the regular }; } - # or a more complicated case: + # or a more complicated case with module_notes, different supported actions + # per type, and special void requirements: sub _info { { @@ -78,6 +75,7 @@ These are the module writer's notes for v3. See the regular 'supported_types' => [ qw( CC ECHECK ) ], 'token_support' => 1, 'test_transaction' => 1, + 'partial_auth' => 1, #can gateway partial auth (new in 3.04) 'supported_actions' => { 'CC' => [ 'Normal Authorization', 'Authorization Only', @@ -100,7 +98,7 @@ These are the module writer's notes for v3. See the regular } -- authorization and order_number (NEWLY DOCUMENTED IN 3.01): += authorization and order_number (NEWLY DOCUMENTED IN 3.01) = Gateways will return one or two values from Authorization Only and Normal Authorization transactions that must be submitted back with a @@ -113,3 +111,35 @@ These are the module writer's notes for v3. See the regular value returned from the underlying processing network while "order_number" is a unique tranaction id generated by the gateway. + += Moo (NEWLY DOCUMENTED IN 3.04) = + + Feel free to write gateway modules which use Moo. Please do not require + Moo newer than 0.091011 at this time (until 2018 or so). + + += Partial authorizations (NEWLY DOCUMENTED IN 3.04) = + + If your gateway supports partial authorizations: + + - Declare this in your "sub _info" introspection subroutine: + 'partial_auth' => 1, + + - Add "partial_auth_amount" to your build_subs call in set_defaults, or add + one: + $self->build_subs('partial_auth_amount'); + + - Honor the transaction 'partial_auth' flag as follows: + + If this transaction flag is unset, the application is not expecting to + handle a partial authorzation. So, either set the gateway flag disabling + partial authorizations, or (if your gatweay does not have such a + setting), immediately void any partial authorization received and + return is_success 0. + + If this transaction flag is set, the application can handle a partial + authorization. Make sure the flag to enable them is passed to the + gateway, if necessary. When a partial authorization is received, return + is_success 1, and the amount as "partial_auth_amount": + $self->partial_auth_amount( $partial_amount ); + For normal full authorizations, "partial_auth_amount" must not be set. + + |