NAME
Business::CyberSource::Response - Response Object
VERSION
version 0.007011
SYNOPSIS
use Try::Tiny;
my $response
= try {
$client->run_transaction( $request )
}
catch {
if ( blessed $_
&& $_->isa('Business::CyberSource::Response::Exception')
) {
if ( $_->is_error ) {
# probably a temporary error on cybersources problem retry
}
}
else {
# log it and investigate
}
};
if ( $response->is_accept ) {
if ( $response->has_auth ) {
# pass to next request or store
$response->request_id;
$response->reference_code;
}
}
elsif ( $response->is_reject ) {
# log it
$response->request_id;
$response->reason_text;
}
else {
# throw exception
}
DESCRIPTION
This response can be used to determine the success of a transaction, as well as receive a follow up request_id
in case you need to do further actions with this.
EXTENDS
Business::CyberSource::Message;
WITH
ATTRIBUTES
is_accept
boolean way of determining whether the transaction was accepted
is_reject
boolean way of determining whether the transaction was rejected
is_error
boolean way of determining whether the transaction was error. Note this is used internally as a response that is an error will throw an exception.
decision
Summarizes the result of the overall request. This is the text, you can check is_accept, is_reject for a more boolean way.
reason_code
Numeric value corresponding to the result of the credit card authorization request.
reason_text
official description of returned reason code.
warning: reason codes are returned by CyberSource and occasionally do not reflect the real reason for the error please inspect the trace request/response for issues
request_token
Request token data created by CyberSource for each reply. The field is an encoded string that contains no confidential information, such as an account or card verification number. The string can contain up to 256 characters.
reference_code
Type: Varying character 50
The merchant reference code originally sent
auth
$response->auth if $response->has_auth;
Type: Business::CyberSource::ResponsePart::AuthReply
purchase_totals
$response->purchase_totals if $response->has_purchase_totals;
Type: Business::CyberSource::ResponsePart::PurchaseTotals
capture
$response->capture if $response->has_capture;
Type: Business::CyberSource::ResponsePart::Reply
credit
$response->credit if $response->has_credit;
Type: Business::CyberSource::ResponsePart::Reply
auth_reversal
$response->auth_reversal if $response->has_auth_reversal;
Type: Business::CyberSource::ResponsePart::Reply
dcc
$response->dcc if $response->has_dcc;
Type: Business::CyberSource::ResponsePart::DCCReply
tax
$response->tax if $response->has_tax;
Type: Business::CyberSource::ResponsePart::TaxReply
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/xenoterracide/business-cybersource/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHOR
Caleb Cushing <xenoterracide@gmail.com>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by HostGator.com.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)