View on
MetaCPAN
Olaf Alders > WebService-PayPal-PaymentsAdvanced-0.000008 > WebService::PayPal::PaymentsAdvanced::Error::HostedForm

Download:
WebService-PayPal-PaymentsAdvanced-0.000008.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.000008   Source   Latest Release: WebService-PayPal-PaymentsAdvanced-0.000022

NAME ^

WebService::PayPal::PaymentsAdvanced::Error::HostedForm - An error message which has been parsed out of a hosted form

VERSION ^

version 0.000008

SYNOPSIS ^

    use Try::Tiny;
    use WebService::PayPal::PaymentsAdvanced;

    my $payments = WebService::PayPal::PaymentsAdvanced->new(...);
    my $response = $payments->create_secure_token(...);

    my $uri;
    try {
        $uri = $payments->hosted_form_uri($response);
    }
    catch {
        die $_ unless blessed $_;
        if (
            $_->isa(
                'WebService::PayPal::PaymentsAdvanced::Error::HostedForm')
            ) {
            log_hosted_form_error(
                message          => $_->message,
                response_content => $_->http_response->content,
            );
        }

        # handle other exceptions
    };

DESCRIPTION ^

This class represents an error which is embedded into the HTML of a hosted form. It will only be thrown if you have enabled "validate_hosted_form_uri" in WebService::PayPal::PaymentsAdvanced.

It extends Throwable::Error and adds one attribute of its own. The message attribute (inherited from Throwable::Error) will contain the error message which was parsed out of the content of the HTML.

METHODS ^

The $error->message(), and $error->stack_trace() methods are inherited from Throwable::Error.

http_response

Returns the HTTP::Response object which was returned when attempting to GET the hosted form.

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)
syntax highlighting: