Business::CyberSource::Response - Response Object
version 0.009001
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 }
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.
request_id
Business::CyberSource::Message
boolean way of determining whether the transaction was accepted
boolean way of determining whether the transaction was rejected
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.
Summarizes the result of the overall request. This is the text, you can check is_accept, is_reject for a more boolean way.
Numeric value corresponding to the result of the credit card authorization request.
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 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.
Type: Varying character 50
The merchant reference code originally sent
$response->auth if $response->has_auth;
Type: Business::CyberSource::ResponsePart::AuthReply
$response->purchase_totals if $response->has_purchase_totals;
Type: Business::CyberSource::ResponsePart::PurchaseTotals
$response->capture if $response->has_capture;
Type: Business::CyberSource::ResponsePart::Reply
$response->credit if $response->has_credit;
$response->auth_reversal if $response->has_auth_reversal;
$response->dcc if $response->has_dcc;
Type: Business::CyberSource::ResponsePart::DCCReply
$response->tax if $response->has_tax;
Type: Business::CyberSource::ResponsePart::TaxReply
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.
Caleb Cushing <xenoterracide@gmail.com>
This software is Copyright (c) 2013 by Caleb Cushing <xenoterracide@gmail.com>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Business::CyberSource, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::CyberSource
CPAN shell
perl -MCPAN -e shell install Business::CyberSource
For more information on module installation, please visit the detailed CPAN module installation guide.