[Catalyst-commits] r9981 - in trunk/Catalyst-Model-PayPal-IPN: .
lib/Catalyst/Model/PayPal t
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Fri May 1 22:55:50 GMT 2009
Author: caelum
Date: 2009-05-01 22:55:50 +0000 (Fri, 01 May 2009)
New Revision: 9981
Added:
trunk/Catalyst-Model-PayPal-IPN/MANIFEST.SKIP
Removed:
trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t
Modified:
trunk/Catalyst-Model-PayPal-IPN/Changes
trunk/Catalyst-Model-PayPal-IPN/Makefile.PL
trunk/Catalyst-Model-PayPal-IPN/README
trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm
trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t
trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t
Log:
C::M::PayPal::IPN - minor cleanups and release
Modified: trunk/Catalyst-Model-PayPal-IPN/Changes
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/Changes 2009-05-01 22:55:48 UTC (rev 9980)
+++ trunk/Catalyst-Model-PayPal-IPN/Changes 2009-05-01 22:55:50 UTC (rev 9981)
@@ -0,0 +1,4 @@
+Revision history for Catalyst-Model-PayPal-IPN
+
+0.02 2009-05-01 22:55:12
+ - First release.
Added: trunk/Catalyst-Model-PayPal-IPN/MANIFEST.SKIP
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/MANIFEST.SKIP (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/MANIFEST.SKIP 2009-05-01 22:55:50 UTC (rev 9981)
@@ -0,0 +1,5 @@
+# stolen from Devel::REPL
+^(?!script/|examples/|lib/|inc/|t/|Makefile.PL$|README$|MANIFEST$|Changes$|META.yml$)
+.svn/
+.git/
+.swp$
Modified: trunk/Catalyst-Model-PayPal-IPN/Makefile.PL
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/Makefile.PL 2009-05-01 22:55:48 UTC (rev 9980)
+++ trunk/Catalyst-Model-PayPal-IPN/Makefile.PL 2009-05-01 22:55:50 UTC (rev 9981)
@@ -13,5 +13,9 @@
features('Form Encryption' => [ -default => 0, 'Business::PayPal::EWP']);
+if(-e 'MANIFEST.SKIP') {
+ system("pod2text lib/Catalyst/Model/PayPal/IPN.pm > README");
+}
+
auto_install;
WriteAll;
Modified: trunk/Catalyst-Model-PayPal-IPN/README
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/README 2009-05-01 22:55:48 UTC (rev 9980)
+++ trunk/Catalyst-Model-PayPal-IPN/README 2009-05-01 22:55:50 UTC (rev 9981)
@@ -6,31 +6,14 @@
This document describes Catalyst::Model::PayPal::IPN version 0.02
SYNOPSIS
+ lib/MyApp/Model/Paypal/IPN.pm
+
package MyApp::Model::Paypal::IPN;
use strict;
use warnings;
- use base 'Catalyst::Model::PayPal::IPN';
+ use parent 'Catalyst::Model::PayPal::IPN';
- =head1 NAME
-
- MyApp::Model::Paypal::IPN - Catalyst Model
-
- =head1 DESCRIPTION
-
- Catalyst Model.
-
- =head1 AUTHOR
-
- Gavin Henry
-
- =head1 LICENSE
-
- This library is free software, you can redistribute it and/or modify
- it under the same terms as Perl itself.
-
- =cut
-
1;
myapp.yml
@@ -208,12 +191,12 @@
</td>
</tr>
</table>
-
+
DESCRIPTION
This model handles all the latest PayPal IPN vars, and provides an easy
method for checking that the transaction was successful.
- There are also convience methods for generating encrypted and
+ There are also convenience methods for generating encrypted and
non-encrypted PayPal forms and buttons.
See Business::PayPal::IPN for more info.
@@ -236,6 +219,9 @@
<https://www.paypal.com/IntegrationCenter/ic_ipn-pdt-variable-reference.
html>
+ correlation_info
+ Returns a hashref of amount, invoice and custom.
+
form_info
Takes a hashref and returns form data for looping through to create your
form.
@@ -281,7 +267,7 @@
cert: /home/ghenry/MyApp/root/auth/paypal_certs/www.myapp.net.crt
cert_key: /home/ghenry/MyApp/root/auth/paypal_certs/www.myapp.net.key
- paypal_cert: /home/ghenry/MyApp/root/auth/paypal_certs/paypal_sandbox_cert.pem
+ paypal_cert: /home/ghenry/MyApp/root/auth/paypal_certs/paypal_sandbox_cert.pem
Catalyst::Model::PayPal::IPN requires:
Modified: trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm 2009-05-01 22:55:48 UTC (rev 9980)
+++ trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm 2009-05-01 22:55:50 UTC (rev 9981)
@@ -1,8 +1,8 @@
package Catalyst::Model::PayPal::IPN;
use Moose;
-use namespace::clean -except => ['meta'];
use Business::PayPal::IPN;
+use namespace::clean -except => ['meta'];
our $VERSION = '0.02';
our $AUTHORITY = 'cpan:MSTROUT';
@@ -75,7 +75,7 @@
has 'debug_mode' => ( is => 'rw', required => 1, default => sub { 0 } );
has 'encrypt_mode' => ( is => 'rw', required => 1, default => sub { 0 },
- trigger => sub {shift->check_encrypt_mode} );
+ trigger => sub {shift->_check_encrypt_mode} );
has 'cert' => (
is => 'rw',
@@ -115,33 +115,33 @@
is => 'ro',
required => 1,
lazy => 1,
- default => sub { shift->build_ipn_object },
+ default => sub { shift->_build_ipn_object },
);
sub BUILD {
- shift->check_encrypt_mode;
+ shift->_check_encrypt_mode;
}
-sub check_encrypt_mode {
+sub _check_encrypt_mode {
Catalyst::Utils::ensure_class_loaded('Business::PayPal::EWP')
if shift->encrypt_mode;
}
sub ACCEPT_CONTEXT {
my ( $self, $c ) = @_;
- return $c->stash->{ ref($self) } ||= $self->build_context_copy($c);
+ return $c->stash->{ ref($self) } ||= $self->_build_context_copy($c);
}
-sub build_context_copy {
+sub _build_context_copy {
my ( $self, $c ) = @_;
my $copy = bless( {%$self}, ref($self) );
my $req = $c->req;
$copy->req($req);
- $copy->fill_action( $c, $_ ) for qw/postback completion cancellation/;
+ $copy->_fill_action( $c, $_ ) for qw/postback completion cancellation/;
return $copy;
}
-sub fill_action {
+sub _fill_action {
my ( $self, $c, $fill ) = @_;
my $url_meth = "${fill}_url";
my $args_meth = "${fill}_action";
@@ -161,7 +161,7 @@
);
}
-sub build_ipn_object {
+sub _build_ipn_object {
my $self = shift;
local $Business::PayPal::IPN::GTW = $self->paypal_gateway;
my $ipn = Business::PayPal::IPN->new( query => $self->req );
@@ -237,6 +237,8 @@
);
}
+__PACKAGE__->meta->make_immutable;
+
package Catalyst::Model::PayPal::IPN::ErrorHandle;
use Moose;
@@ -246,6 +248,8 @@
sub completed { 0 }
+__PACKAGE__->meta->make_immutable;
+
1;
__END__
@@ -259,34 +263,16 @@
=head1 SYNOPSIS
+ lib/MyApp/Model/Paypal/IPN.pm
+
package MyApp::Model::Paypal::IPN;
use strict;
use warnings;
- use base 'Catalyst::Model::PayPal::IPN';
+ use parent 'Catalyst::Model::PayPal::IPN';
- =head1 NAME
-
- MyApp::Model::Paypal::IPN - Catalyst Model
-
- =head1 DESCRIPTION
-
- Catalyst Model.
-
- =head1 AUTHOR
-
- Gavin Henry
-
- =head1 LICENSE
-
- This library is free software, you can redistribute it and/or modify
- it under the same terms as Perl itself.
-
- =cut
-
1;
-
myapp.yml
paypal:
@@ -321,7 +307,6 @@
- payment
- cancelled
-
MyApp::Controller::Subscribe
=head2 ipn
@@ -470,15 +455,16 @@
This model handles all the latest PayPal IPN vars, and provides an
easy method for checking that the transaction was successful.
-There are also convience methods for generating encrypted and non-encrypted
+There are also convenience methods for generating encrypted and non-encrypted
PayPal forms and buttons.
See L<Business::PayPal::IPN> for more info.
+B<WARNING:> this module does not have real tests yet, if you encounter problems
+please report them via L<http://rt.cpan.org/> .
=head1 INTERFACE
-
=head2 build_paypal_gateway
If debug_mode is on, returns sandbox url, otherwise normal PayPal gateway
@@ -497,6 +483,10 @@
See L<https://www.paypal.com/IntegrationCenter/ic_ipn-pdt-variable-reference.html>
+=head2 correlation_info
+
+Returns a hashref of amount, invoice and custom.
+
=head2 form_info
Takes a hashref and returns form data for looping through to create your form.
@@ -545,12 +535,9 @@
cert: /home/ghenry/MyApp/root/auth/paypal_certs/www.myapp.net.crt
cert_key: /home/ghenry/MyApp/root/auth/paypal_certs/www.myapp.net.key
paypal_cert: /home/ghenry/MyApp/root/auth/paypal_certs/paypal_sandbox_cert.pem
-
Catalyst::Model::PayPal::IPN requires:
-
-
=head1 DEPENDENCIES
L<Moose>
@@ -561,7 +548,6 @@
L<Business::PayPal::EWP>
-
=head1 BUGS AND LIMITATIONS
No bugs have been reported.
@@ -570,7 +556,6 @@
C<bug-catalyst-model-paypal-ipn at rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org>.
-
=head1 AUTHOR
Matt S Trout C<mst at shadowcatsystems.co.uk>
@@ -586,7 +571,6 @@
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
-
=head1 DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
@@ -609,3 +593,5 @@
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
+
+=cut
Deleted: trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t 2009-05-01 22:55:48 UTC (rev 9980)
+++ trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t 2009-05-01 22:55:50 UTC (rev 9981)
@@ -1,13 +0,0 @@
-use Test::More;
-
-BEGIN {
- eval {
- require Test::Distribution;
- };
- if($@) {
- plan skip_all => 'Test::Distribution not installed';
- }
- else {
- import Test::Distribution;
- }
-}
Modified: trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t 2009-05-01 22:55:48 UTC (rev 9980)
+++ trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t 2009-05-01 22:55:50 UTC (rev 9981)
@@ -19,14 +19,52 @@
use warnings;
use Test::More; # last test to print
-eval 'Business::PayPal::EWP';
+eval 'use Business::PayPal::EWP';
plan $@? ( skip_all => 'Business::PayPal::EWP not installed' ) : ( tests => 1 );
TODO: {
local $TODO="PKCS7 block seems to differ each time";
- is(Business::PayPal::EWP::SignAndEncrypt("Testing, 123!","test.key","test.crt","paypal.pem"),join("",<DATA>),"Ran SignAndEncrypt");
+
+ is(
+ Business::PayPal::EWP::SignAndEncrypt(
+ "Testing, 123!","t/test.key","t/test.crt","t/paypal.pem"
+ )
+ ,join("",<DATA>)
+ ,"Ran SignAndEncrypt"
+ );
}
-#########################
-
-
+__DATA__
+-----BEGIN PKCS7-----
+MIIFugYJKoZIhvcNAQcEoIIFqzCCBacCAQExggE6MIIBNgIBADCBnjCBmDELMAkG
+A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3Nl
+MRUwEwYDVQQKEwxQYXlQYWwsIEluYy4xFjAUBgNVBAsUDXNhbmRib3hfY2VydHMx
+FDASBgNVBAMUC3NhbmRib3hfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwu
+Y29tAgEAMA0GCSqGSIb3DQEBAQUABIGAefVM3cA5LMcppoSAY3NSOwEhp3GXf1gE
+4CkBq27oMyY8U+p5QwMrNv9qvXiJcUE7hlpxFL8SrHl7zcgeyeiqO/itcts2YgmP
+Fge24+Mn0iW6RmAS3ibSjbfHH/geT5y0shJ77sK44/8yasmrGFU+zxhApw8g3Nj4
+L8wcbYCZCdUxCzAJBgUrDgMCGgUAMDMGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI
+ySyG8KxV4XWAEAAI497mlUMn5XrnhVQDcnKgggLZMIIC1TCCAj6gAwIBAgIBADAN
+BgkqhkiG9w0BAQQFADA5MRgwFgYDVQQDEw9Jc3NhYyBHb2xkc3RhbmQxHTAbBgkq
+hkiG9w0BCQEWDmlzYWF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qGSIb3DQEJBTEPFw0wOTA1MDEyMTAzNTdaMCMGCSqGSIb3
+DQEJBDEWBBRLD/XlFBsPzaw47r/bf85uXvjvAjANBgkqhkiG9w0BAQEFAASBgBXv
+M0ik9MxoNYAJsWmPgLjyzItOYkf0jDWG+4zey7PJqr0vSD9ht+ydAXWVRG5Iyrnb
+H0Dvsh9ZalUbUpRNOZ+GFMN/6FUTSM8k7f62ijDlUZj6jyZPj4wMRZsBK2k9ZoOo
+1EuIdgwVjGrnFvkcrA6P/5v/3JwpxP7gSum4/J6X
+-----END PKCS7-----
Modified: trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t 2009-05-01 22:55:48 UTC (rev 9980)
+++ trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t 2009-05-01 22:55:50 UTC (rev 9981)
@@ -3,4 +3,4 @@
use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
-all_pod_coverage_ok();
+all_pod_coverage_ok({ also_private => [qr/^(?:BUILD|ACCEPT_CONTEXT)\z/] });
More information about the Catalyst-commits
mailing list