Olaf Alders 🐫
and 2 contributors

NAME

WebService::PayPal::PaymentsAdvanced::Mocker::SilentPOST - Easily mock Silent POST transactions

VERSION

version 0.000008

SYNOPSIS

    use LWP::UserAgent;
    use WebService::PayPal::PaymentsAdvanced::Mocker::SilentPOST;

    my $mocker
        = WebService::PayPal::PaymentsAdvanced::Mocker::SilentPOST->new();

    my $ua = LWP::UserAgent->new(...);
    $ua->post(
        '/silent-post-url',
        $mocker->paypal_success,
        'X-Forwarded-For' => '173.0.81.65'
    );

paypal_success

Returns a HashRef of POST params which can be used to mock a successful PayPal authorization.

credit_card_success

Returns a HashRef of POST params which can be used to mock a successful credit card authorization.

credit_card_auth_verification_success

Returns a HashRef of POST params which can be used to mock a successful zero dollar credit card authorization.

credit_card_duplicate_invoice_id

Returns a HashRef of POST params which can be used to mock a unsuccessful credit card payment. In this case you've sent an invoice ID which is already attached to a previously successful transaction.

DESCRIPTION

Use these methods to get a HashRef of params which you can POST to your application's silent POST endpoint. Keep in mind that if you have IP validation enabled you'll either need to spoof the originating IP of the request or disable the IP validation in test mode. I'd encourage you to do the former, if at all possible.

AUTHOR

Olaf Alders <olaf@wundercounter.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by MaxMind, Inc..

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)