Net-Simplify
view release on metacpan or search on metacpan
lib/Net/Simplify/BadRequestException.pm view on Meta::CPAN
package Net::Simplify::BadRequestException;
=head1 NAME
Net::Simplify::BadRequestException - Simplify Commerce exception for bad request errors
=head1 SYNOPSIS
use Net::Simplify;
$Net::Simplify::public_key = 'YOUR PUBLIC KEY';
$Net::Simplify::private_key = 'YOUR PRIVATE KEY';
eval {
my $payment = Net::Simplify::Payment->create(...);
};
if ($@) {
if ($@->isa('Net::Simplify::BadRequestException')) {
printf "API Exception: %s %s\n", $@->message, $@->code;
if ($@->has_field_errors) {
foreach my $e ($@->field_errors) {
printf "Field error: %s %s %s\n", $e->field, $e->code, $e->message;
}
}
}
}
=head1 DESCRIPTION
An exception that is thrown for any API call that fails due to errors in the request. If the request contains field errors
(for example missing fields or constraint violations) a list of field error objects can be obtained giving details on each
error. See the base class L<Net::Simplify::ApiException> for additional of methods.
=head2 METHODS
=head3 has_field_errors()
Whether there are any field errors.
=head3 field_errors()
Returns an array of field errors (L<Net::Simplify::FieldError>).
=head3 stringify()
Returns a string representation of the exception.
=head1 SEE ALSO
L<Net::Simplify>,
L<Net::Simplify::ApiException>,
L<Net::Simplify::FieldError>,
L<http://www.simplify.com>
=head1 VERSION
1.6.0
=head1 LICENSE
Copyright (c) 2013 - 2022 MasterCard International Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
Neither the name of the MasterCard International Incorporated nor the names of its
( run in 0.474 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )