[Catalyst-commits] r6951 - in trunk/Catalyst-Model-PayPal-IPN: .
lib/Catalyst/Model/PayPal t
ghenry at dev.catalyst.perl.org
ghenry at dev.catalyst.perl.org
Tue Oct 2 16:50:03 GMT 2007
Author: ghenry
Date: 2007-10-02 16:50:03 +0100 (Tue, 02 Oct 2007)
New Revision: 6951
Added:
trunk/Catalyst-Model-PayPal-IPN/Changes
trunk/Catalyst-Model-PayPal-IPN/README
trunk/Catalyst-Model-PayPal-IPN/t/00.load.t
trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t
trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t
trunk/Catalyst-Model-PayPal-IPN/t/paypal.pem
trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t
trunk/Catalyst-Model-PayPal-IPN/t/pod.t
trunk/Catalyst-Model-PayPal-IPN/t/test.crt
trunk/Catalyst-Model-PayPal-IPN/t/test.key
Removed:
trunk/Catalyst-Model-PayPal-IPN/t/01sanity.t
Modified:
trunk/Catalyst-Model-PayPal-IPN/Makefile.PL
trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm
Log:
80% complete. Need to finish tests and docs. Just testing in devel app the now.
Added: trunk/Catalyst-Model-PayPal-IPN/Changes
===================================================================
Modified: trunk/Catalyst-Model-PayPal-IPN/Makefile.PL
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/Makefile.PL 2007-09-30 22:26:05 UTC (rev 6950)
+++ trunk/Catalyst-Model-PayPal-IPN/Makefile.PL 2007-10-02 15:50:03 UTC (rev 6951)
@@ -8,6 +8,7 @@
requires 'Catalyst::Runtime' => '5.7006';
requires 'Moose' => '0.20';
requires 'namespace::clean' => '0.04';
+requires 'Business::PayPal::EWP';
requires 'Business::PayPal::IPN';
requires 'Crypt::SSLeay'; # should be installed by IPN but isn't always
Added: trunk/Catalyst-Model-PayPal-IPN/README
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/README (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/README 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,75 @@
+NAME
+ Catalyst::Model::PayPal::IPN - [One line description of module's purpose
+ here]
+
+VERSION
+ This document describes Catalyst::Model::PayPal::IPN version 0.02
+
+SYNOPSIS
+ use Catalyst::Model::PayPal::IPN;
+
+DESCRIPTION
+INTERFACE
+DIAGNOSTICS
+ "Error message here, perhaps with %s placeholders"
+ [Description of error here]
+
+ "Another error message here"
+ [Description of error here]
+
+ [Et cetera, et cetera]
+
+CONFIGURATION AND ENVIRONMENT
+ Catalyst::Model::PayPal::IPN requires no configuration files or
+ environment variables.
+
+DEPENDENCIES
+ None.
+
+INCOMPATIBILITIES
+ None reported.
+
+BUGS AND LIMITATIONS
+ No bugs have been reported.
+
+ Please report any bugs or feature requests to
+ "bug-catalyst-model-paypal-ipn at rt.cpan.org", or through the web
+ interface at <http://rt.cpan.org>.
+
+AUTHOR
+ Matt S Trout "<mst at shadowcatsystems.co.uk>"
+
+ Gavin Henry "<ghenry at suretecsystems.com>"
+
+LICENCE AND COPYRIGHT
+ Copyright (c) 2007, Matt S Trout, "<mst at shadowcatsystems.co.uk>". All
+ rights reserved.
+
+ Copyright (c) 2007, Gavin Henry "<ghenry at suretecsystems.com>". All
+ rights reserved.
+
+ This module is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself. See perlartistic.
+
+DISCLAIMER OF WARRANTY
+ BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+ FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+ PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+ EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
+ YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+ NECESSARY SERVICING, REPAIR, OR CORRECTION.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+ REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
+ TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+ SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+ 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.
+
Modified: trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm 2007-09-30 22:26:05 UTC (rev 6950)
+++ trunk/Catalyst-Model-PayPal-IPN/lib/Catalyst/Model/PayPal/IPN.pm 2007-10-02 15:50:03 UTC (rev 6951)
@@ -1,174 +1,391 @@
package Catalyst::Model::PayPal::IPN;
use Moose;
-use namespace::clean -except => [ 'meta' ];
+use namespace::clean -except => ['meta'];
use Business::PayPal::IPN;
+use Business::PayPal::EWP qw(SignAndEncrypt);
-our $VERSION = '0.01';
+our $VERSION = '0.02';
our $AUTHORITY = 'cpan:MSTROUT';
extends 'Catalyst::Model';
has 'req' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "req not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "req not provided before use" }
);
has 'business_email' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "business_email not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "business_email not provided before use" }
);
has 'currency_code' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "currency_code not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "currency_code not provided before use" }
);
has 'postback_action' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "postback_action not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "postback_action not provided before use" }
);
has 'postback_url' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "postback_url not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "postback_url not provided before use" }
);
has 'cancellation_action' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "cancellation_action not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "cancellation_action not provided before use" }
);
has 'cancellation_url' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "cancellation_url not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "cancellation_url not provided before use" }
);
has 'completion_action' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "completion_action not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "completion_action not provided before use" }
);
has 'completion_url' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { confess "completion_url not provided before use" }
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { confess "completion_url not provided before use" }
);
-has 'debug_mode' => (is => 'rw', required => 1, default => sub { 0 });
+has 'debug_mode' => ( is => 'rw', required => 1, default => sub { 0 } );
+has 'encrypt_mode' => ( is => 'rw', required => 1, default => sub { 0 } );
+
+has 'cert' => (
+ is => 'rw',
+ required => 0,
+ lazy => 1,
+ default =>
+ sub { confess "cert not provided for encryption" if shift->encrypt_mode }
+);
+
+has 'cert_key' => (
+ is => 'rw',
+ required => 0,
+ lazy => 1,
+ default => sub {
+ confess "cert_key not provided for encryption" if shift->encrypt_mode;
+ }
+);
+
+has 'paypal_cert' => (
+ is => 'rw',
+ required => 0,
+ lazy => 1,
+ default => sub {
+ confess "paypal_cert not provided for encryption"
+ if shift->encrypt_mode;
+ }
+);
+
has 'paypal_gateway' => (
- is => 'rw', required => 1, lazy => 1,
- default => sub { shift->build_paypal_gateway },
+ is => 'rw',
+ required => 1,
+ lazy => 1,
+ default => sub { shift->build_paypal_gateway },
);
has '_ipn_object' => (
- is => 'ro', required => 1, lazy => 1,
- default => sub { shift->build_ipn_object },
+ is => 'ro',
+ required => 1,
+ lazy => 1,
+ default => sub { shift->build_ipn_object },
);
sub ACCEPT_CONTEXT {
- my ($self, $c) = @_;
- return $c->stash->{ref($self)} ||= $self->build_context_copy($c);
+ my ( $self, $c ) = @_;
+ return $c->stash->{ ref($self) } ||= $self->build_context_copy($c);
}
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/;
- return $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/;
+ return $copy;
}
sub fill_action {
- my ($self, $c, $fill) = @_;
- my $url_meth = "${fill}_url";
- my $args_meth = "${fill}_action";
- my @args = @{$self->$args_meth};
- my ($controller, $action_name) = (shift(@args), shift(@args));
- my $action = $c->controller($controller)->action_for($action_name);
- my $uri = $c->uri_for($action => @args);
- $self->$url_meth("${uri}");
+ my ( $self, $c, $fill ) = @_;
+ my $url_meth = "${fill}_url";
+ my $args_meth = "${fill}_action";
+ my @args = @{ $self->$args_meth };
+ my ( $controller, $action_name ) = ( shift(@args), shift(@args) );
+ my $action = $c->controller($controller)->action_for($action_name);
+ my $uri = $c->uri_for( $action => @args );
+ $self->$url_meth("${uri}");
}
sub build_paypal_gateway {
- my $self = shift;
- return ($self->debug_mode
- ? 'https://www.sandbox.paypal.com/cgi-bin/webscr'
- : 'https://www.paypal.com/cgi-bin/webscr');
+ my $self = shift;
+ return (
+ $self->debug_mode
+ ? 'https://www.sandbox.paypal.com/cgi-bin/webscr'
+ : 'https://www.paypal.com/cgi-bin/webscr'
+ );
}
sub build_ipn_object {
- my $self = shift;
- local $Business::PayPal::IPN::GTW = $self->paypal_gateway;
- my $ipn = Business::PayPal::IPN->new(query => $self->req);
- unless ($ipn) {
- $ipn = Catalyst::Model::PayPal::IPN::ErrorHandle->new(
- error => Business::PayPal::IPN->error
- );
- }
- return $ipn;
+ my $self = shift;
+ local $Business::PayPal::IPN::GTW = $self->paypal_gateway;
+ my $ipn = Business::PayPal::IPN->new( query => $self->req );
+ unless ($ipn) {
+ $ipn =
+ Catalyst::Model::PayPal::IPN::ErrorHandle->new(
+ error => Business::PayPal::IPN->error );
+ }
+ return $ipn;
}
sub is_completed {
- my $self = shift;
- return $self->_ipn_object->completed;
+ my $self = shift;
+ return $self->_ipn_object->completed;
}
sub error {
- my $self = shift;
- return unless $self->_ipn_object->isa(
- 'Catalyst::Model::PayPal::IPN::ErrorHandle'
- );
- return $self->_ipn_object->error;
+ my $self = shift;
+ return
+ unless $self->_ipn_object->isa(
+ 'Catalyst::Model::PayPal::IPN::ErrorHandle');
+ return $self->_ipn_object->error;
}
# https://www.paypal.com/IntegrationCenter/ic_ipn-pdt-variable-reference.html
sub buyer_info {
- my $self = shift;
- return unless $self->is_completed;
- return {
- email => $self->req->params->{payer_email},
- company_name => $self->req->params->{payer_business_name},
- phone => $self->req->params->{contact_phone},
- map { ($_ => $self->req->params->{"address_$_"}) }
- qw/name street city zip state country country_code/
- };
+ my $self = shift;
+ return unless $self->is_completed;
+ return _ipn_object->vars();
}
sub correlation_info {
- my $self = shift;
- return {
- amount => $self->req->params->{mc_gross},
- map { ($_ => $self->req->params->{$_}) } qw/invoice custom/
- };
+ my $self = shift;
+ return {
+ amount => $self->req->params->{mc_gross},
+ map { ( $_ => $self->req->params->{$_} ) } qw/invoice custom/
+ };
}
sub form_info {
- my ($self, $args) = @_;
- foreach my $key (qw/amount item_name/) {
- confess "${key} must be defined" unless defined($args->{$key});
- }
- return {
- business => $self->business_email,
- currency_code => $self->currency_code,
- notify_url => $self->postback_url,
- return => $self->completion_url,
- cancel_return => $self->cancellation_url,
- cmd => '_ext-enter',
- redirect_cmd => '_xclick',
- %$args
- };
+ my ( $self, $args ) = @_;
+ foreach my $key (qw/amount item_name/) {
+ confess "${key} must be defined" unless defined( $args->{$key} );
+ }
+ return {
+ business => $self->business_email,
+ currency_code => $self->currency_code,
+ notify_url => $self->postback_url,
+ return => $self->completion_url,
+ cancel_return => $self->cancellation_url,
+ cmd => '_ext-enter',
+ redirect_cmd => '_xclick',
+ %$args
+ };
}
+sub encrypt_form {
+ my ( $self, $args ) = @_;
+
+ confess "encrypt_mode must be enabled" unless $self->encrypt_mode;
+
+ my $form_args = $self->form_info($args);
+
+ # SignAndEncrypt needs CSV key/vals
+ my $form;
+ for my $form_param ( keys %$form_args ) {
+ $form .= $form_param . '=' . $form_args->{$form_param} . ',';
+ }
+
+ return SignAndEncrypt( $form, $self->cert_key, $self->cert,
+ $self->paypal_cert, );
+}
+
package Catalyst::Model::PayPal::IPN::ErrorHandle;
use Moose;
-use namespace::clean -except => [ 'meta' ];
+use namespace::clean -except => ['meta'];
-has 'error' => (is => 'ro', required => 1);
+has 'error' => ( is => 'ro', required => 1 );
sub completed { 0 }
1;
+__END__
+
+=head1 NAME
+
+Catalyst::Model::PayPal::IPN - [One line description of module's purpose here]
+
+
+=head1 VERSION
+
+This document describes Catalyst::Model::PayPal::IPN version 0.02
+
+
+=head1 SYNOPSIS
+
+ use Catalyst::Model::PayPal::IPN;
+
+=for author to fill in:
+ Brief code example(s) here showing commonest usage(s).
+ This section will be as far as many users bother reading
+ so make it as educational and exeplary as possible.
+
+
+=head1 DESCRIPTION
+
+=for author to fill in:
+ Write a full description of the module and its features here.
+ Use subsections (=head2, =head3) as appropriate.
+
+
+=head1 INTERFACE
+
+=for author to fill in:
+ Write a separate section listing the public components of the modules
+ interface. These normally consist of either subroutines that may be
+ exported, or methods that may be called on objects belonging to the
+ classes provided by the module.
+
+
+=head1 DIAGNOSTICS
+
+=for author to fill in:
+ List every single error and warning message that the module can
+ generate (even the ones that will "never happen"), with a full
+ explanation of each problem, one or more likely causes, and any
+ suggested remedies.
+
+=over
+
+=item C<< Error message here, perhaps with %s placeholders >>
+
+[Description of error here]
+
+=item C<< Another error message here >>
+
+[Description of error here]
+
+[Et cetera, et cetera]
+
+=back
+
+
+=head1 CONFIGURATION AND ENVIRONMENT
+
+=for author to fill in:
+ A full explanation of any configuration system(s) used by the
+ module, including the names and locations of any configuration
+ files, and the meaning of any environment variables or properties
+ that can be set. These descriptions must also include details of any
+ configuration language used.
+
+Catalyst::Model::PayPal::IPN requires no configuration files or environment variables.
+
+
+=head1 DEPENDENCIES
+
+=for author to fill in:
+ A list of all the other modules that this module relies upon,
+ including any restrictions on versions, and an indication whether
+ the module is part of the standard Perl distribution, part of the
+ module's distribution, or must be installed separately. ]
+
+None.
+
+
+=head1 INCOMPATIBILITIES
+
+=for author to fill in:
+ A list of any modules that this module cannot be used in conjunction
+ with. This may be due to name conflicts in the interface, or
+ competition for system or program resources, or due to internal
+ limitations of Perl (for example, many modules that use source code
+ filters are mutually incompatible).
+
+None reported.
+
+
+=head1 BUGS AND LIMITATIONS
+
+=for author to fill in:
+ A list of known problems with the module, together with some
+ indication Whether they are likely to be fixed in an upcoming
+ release. Also a list of restrictions on the features the module
+ does provide: data types that cannot be handled, performance issues
+ and the circumstances in which they may arise, practical
+ limitations on the size of data sets, special cases that are not
+ (yet) handled, etc.
+
+No bugs have been reported.
+
+Please report any bugs or feature requests to
+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> >>
+
+Gavin Henry C<< <ghenry at suretecsystems.com> >>
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright (c) 2007, Matt S Trout, C<< <mst at shadowcatsystems.co.uk> >>. All rights reserved.
+
+Copyright (c) 2007, Gavin Henry C<< <ghenry at suretecsystems.com> >>. All rights reserved.
+
+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
+FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
+YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR, OR CORRECTION.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
+LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+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.
Added: trunk/Catalyst-Model-PayPal-IPN/t/00.load.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/00.load.t (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/00.load.t 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,7 @@
+use Test::More tests => 1;
+
+BEGIN {
+use_ok( 'Catalyst::Model::PayPal::IPN' );
+}
+
+diag( "Testing Catalyst::Model::PayPal::IPN $Catalyst::Model::PayPal::IPN::VERSION" );
Added: trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/01.distribution.t 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,13 @@
+use Test::More;
+
+BEGIN {
+ eval {
+ require Test::Distribution;
+ };
+ if($@) {
+ plan skip_all => 'Test::Distribution not installed';
+ }
+ else {
+ import Test::Distribution;
+ }
+}
Deleted: trunk/Catalyst-Model-PayPal-IPN/t/01sanity.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/01sanity.t 2007-09-30 22:26:05 UTC (rev 6950)
+++ trunk/Catalyst-Model-PayPal-IPN/t/01sanity.t 2007-10-02 15:50:03 UTC (rev 6951)
@@ -1,5 +0,0 @@
-use strict;
-use warnings;
-use Test::More tests => 1;
-
-use_ok("Catalyst::Model::PayPal::IPN");
Added: trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/02.encrypt.t 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,31 @@
+#
+#===============================================================================
+#
+# FILE: 02.encrypt.t
+#
+# DESCRIPTION: Test Encryption with Business::PayPal::EWP
+#
+# FILES: ---
+# BUGS: ---
+# NOTES: ---
+# AUTHOR: Gavin Henry (GH), <ghenry at suretecsystems.com>
+# COMPANY: Suretec Systems Ltd.
+# VERSION: 1.0
+# CREATED: 02/10/07 09:26:25 BST
+# REVISION: ---
+#===============================================================================
+
+use strict;
+use warnings;
+
+use Test::More tests => 2; # last test to print
+
+BEGIN { use_ok('Business::PayPal::EWP') };
+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");
+}
+#########################
+
+
+
Added: trunk/Catalyst-Model-PayPal-IPN/t/paypal.pem
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/paypal.pem (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/paypal.pem 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDoTCCAwqgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBmDELMAkGA1UEBhMCVVMx
+EzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRUwEwYDVQQK
+EwxQYXlQYWwsIEluYy4xFjAUBgNVBAsUDXNhbmRib3hfY2VydHMxFDASBgNVBAMU
+C3NhbmRib3hfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0
+MDQxOTA3MDI1NFoXDTM1MDQxOTA3MDI1NFowgZgxCzAJBgNVBAYTAlVTMRMwEQYD
+VQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhTYW4gSm9zZTEVMBMGA1UEChMMUGF5
+UGFsLCBJbmMuMRYwFAYDVQQLFA1zYW5kYm94X2NlcnRzMRQwEgYDVQQDFAtzYW5k
+Ym94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEAt5bjv/0N0qN3TiBL+1+L/EjpO1jeqPaJC1fDi+cC
+6t6tTbQ55Od4poT8xjSzNH5S48iHdZh0C7EqfE1MPCc2coJqCSpDqxmOrO+9QXsj
+HWAnx6sb6foHHpsPm7WgQyUmDsNwTWT3OGR398ERmBzzcoL5owf3zBSpRP0NlTWo
+nPMCAwEAAaOB+DCB9TAdBgNVHQ4EFgQUgy4i2asqiC1rp5Ms81Dx8nfVqdIwgcUG
+A1UdIwSBvTCBuoAUgy4i2asqiC1rp5Ms81Dx8nfVqdKhgZ6kgZswgZgxCzAJBgNV
+BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhTYW4gSm9zZTEV
+MBMGA1UEChMMUGF5UGFsLCBJbmMuMRYwFAYDVQQLFA1zYW5kYm94X2NlcnRzMRQw
+EgYDVQQDFAtzYW5kYm94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNv
+bYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAFc288DYGX+GX2+W
+P/dwdXwficf+rlG+0V9GBPJZYKZJQ069W/ZRkUuWFQ+Opd2yhPpneGezmw3aU222
+CGrdKhOrBJRRcpoO3FjHHmXWkqgbQqDWdG7S+/l8n1QfDPp+jpULOrcnGEUY41Im
+jZJTylbJQ1b5PBBjGiP0PpK48cdF
+-----END CERTIFICATE-----
Added: trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/pod-coverage.t 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,6 @@
+#!perl -T
+
+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();
Added: trunk/Catalyst-Model-PayPal-IPN/t/pod.t
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/pod.t (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/pod.t 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,6 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();
Added: trunk/Catalyst-Model-PayPal-IPN/t/test.crt
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/test.crt (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/test.crt 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,18 @@
+-----BEGIN CERTIFICATE-----
+MIIC1TCCAj6gAwIBAgIBADANBgkqhkiG9w0BAQQFADA5MRgwFgYDVQQDEw9Jc3Nh
+YyBHb2xkc3RhbmQxHTAbBgkqhkiG9w0BCQEWDmlzYWFjQGNwYW4ub3JnMB4XDTA0
+MTIwNjIwMDk0MloXDTE0MTIwNDIwMDk0MlowOTEYMBYGA1UEAxMPSXNzYWMgR29s
+ZHN0YW5kMR0wGwYJKoZIhvcNAQkBFg5pc2FhY0BjcGFuLm9yZzCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEA3LYE/dY5y/svEJAraWV9T4ZsRLb2kvafUFCPqSa5
+I5sNsJiPoJvE7fKkn5NVjwmTbSiip7QvxvP5uhTu0hMD0rNB3kCxphXSoOuaTx4w
+oiN9VNSvjR8GsHeWJwOendVRu8Md7vDe03FaoV0U54iVDm9SapFq+lhdg/YAWBx8
+oc8CAwEAAaOB7DCB6TAdBgNVHQ4EFgQUCkmisNBu+RlHE03sclv7LMPsHNowYQYD
+VR0jBFowWIAUCkmisNBu+RlHE03sclv7LMPsHNqhPaQ7MDkxGDAWBgNVBAMTD0lz
+c2FjIEdvbGRzdGFuZDEdMBsGCSqGSIb3DQEJARYOaXNhYWNAY3Bhbi5vcmeCAQAw
+DwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG
+MBkGA1UdEQQSMBCBDmlzYWFjQGNwYW4ub3JnMBkGA1UdEgQSMBCBDmlzYWFjQGNw
+YW4ub3JnMA0GCSqGSIb3DQEBBAUAA4GBABa744x7/i5DLqYGwHJ659uBlr0BUa1o
+C5PY1N9RDlMiWo/y0+aMNS96HxYs3NKz940ArUplbmCtVqbgzBTMwNm7OosYLXVN
+2hnqF8zeYVPYxp5XsjDfOYFc4r+GySIObUZOiaHaleTyGVnVC2kWyFyM8qoelb6R
+UBTXyarTp+rR
+-----END CERTIFICATE-----
Added: trunk/Catalyst-Model-PayPal-IPN/t/test.key
===================================================================
--- trunk/Catalyst-Model-PayPal-IPN/t/test.key (rev 0)
+++ trunk/Catalyst-Model-PayPal-IPN/t/test.key 2007-10-02 15:50:03 UTC (rev 6951)
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDctgT91jnL+y8QkCtpZX1PhmxEtvaS9p9QUI+pJrkjmw2wmI+g
+m8Tt8qSfk1WPCZNtKKKntC/G8/m6FO7SEwPSs0HeQLGmFdKg65pPHjCiI31U1K+N
+Hwawd5YnA56d1VG7wx3u8N7TcVqhXRTniJUOb1JqkWr6WF2D9gBYHHyhzwIDAQAB
+AoGASCMFxqE6Cr1ySIuWZMBTEKbyxBK4zJfmwi1ShwqtAEIxW0LBztCasNrZi35w
+PGv4z3i0kPOHmhMrz/H/jJHCcYPbEy0o/UWlE2mpD0lyUh1G9JMwdwymSQKyYdS0
+jffBagcVOg9Toe3P3TSVoeWUp9VsDcd1u1Icz/qrIEbY4CECQQDurv1iBxlEQE9I
+Wu9oYAhGl9RJGx9SbbypzTkT2+T28FtYWf4GXKDz3xG7Z5QXN+oETLi7HltsJU37
+tvRsFiY7AkEA7Lk67t7SDshf5h9I7Ll34LVKsLZkXj7qCiu82dZKYsMSAnZKcx4H
+cpv8MXFlSKaOF4HCn2yR02gikyHqGGl1fQJAMhWWJdPHgYLdIBm00voTwnxpl02R
+rQJJ7Heb2obx7L9S6582pq8ZNxM/7Us20AhzmqNewCUGmhLZ4k/pyiR7sQJBAONs
+KRQn+YK+OnOpBrR2kpbNVQ5kjBSHOO3Ai1R0rU4ovnqjDm9+IAWZmjYeDQI5ETXA
+Mixbb9W8q8rSwEXnuzkCQQCttapzYl29vOdTsBMw4KKvj36qojhD33DASCv3c+L7
+vEGRTlnpHKjoK8E4ggqgiDzOMMNGHNciW0EIy2tHHLr8
+-----END RSA PRIVATE KEY-----
More information about the Catalyst-commits
mailing list