Business::CyberSource::Request::DCC - CyberSource DCC Request Object
version 0.004003
my $CYBS_ID = 'myMerchantID'; my $CYBS_KEY = 'transaction key generated with cybersource'; use Business::CyberSource::Request; my $factory = Business::CyberSource::Request->new({ username => $CYBS_ID, password => $CYBS_KEY, production => 0, }); my $dcc_req = $factory->create( 'DCC', { reference_code => '1984', currency => 'USD', credit_card => '5100870000000004', cc_exp_month => '04', cc_exp_year => '2012', total => '1.00', foreign_currency => 'EUR', }); my $dcc_res = $dcc_req->submit; my $auth_req = $factory->create( 'Authorization', { reference_code => '1984', first_name => 'Caleb', last_name => 'Cushing', street => 'somewhere', city => 'Houston', state => 'TX', zip => '77064', country => 'US', email => 'xenoterracide@gmail.com', credit_card => '5100870000000004', total => '1.00', currency => 'USD', foreign_currency => 'EUR', foreign_amount => $dcc_res->foreign_amount, exchange_rate => $dcc_res->exchange_rate, cc_exp_month => '04', cc_exp_year => '2012', dcc_indicator => 1, exchange_rate_timestamp => $dcc_res->exchange_rate_timestamp, }); my $auth_res = $auth_req->submit; my $cap_req = $factory->create( 'Capture', { reference_code => '1984', total => '1.00', currency => 'USD', foreign_currency => 'EUR', foreign_amount => $dcc_res->foreign_amount, exchange_rate => $dcc_res->exchange_rate, dcc_indicator => 1, request_id => $auth_res->request_id, exchange_rate_timestamp => $dcc_res->exchange_rate_timestamp, }); my $cap_res = $cap_req->submit; my $cred_req = $factory->create( 'FollowOnCredit', { reference_code => '1984', total => '1.00', currency => 'USD', foreign_currency => 'EUR', foreign_currency => $dcc_res->foreign_currency, foreign_amount => $dcc_res->foreign_amount, exchange_rate => $dcc_res->exchange_rate, dcc_indicator => 1, request_id => $cap_res->request_id, exchange_rate_timestamp => $dcc_res->exchange_rate_timestamp, });
This object allows you to create a request for Direct Currency Conversion.
Reader: foreign_amount
Type: MooseX::Types::Common::Numeric::PositiveOrZeroNum
Reader: client_env
Type: Str
Additional documentation: provided by the library
Reader: cybs_wsdl
Type: MooseX::Types::Path::Class::File
Reader: comments
Reader: trace
Writer: _trace
Type: XML::Compile::SOAP::Trace
Reader: password
Type: MooseX::Types::Common::String::NonEmptyStr
This attribute is required.
Additional documentation: your SOAP transaction key
Reader: cybs_api_version
Reader: cvn
Type: MooseX::Types::CreditCard::CardSecurityCode
Additional documentation: Card Verification Numbers
Reader: cc_exp_month
Type: MooseX::Types::Varchar::Varchar[2]
Additional documentation: Two-digit month that the credit card expires in. Format: MM.
Reader: total
Additional documentation: Grand total for the order. You must include either this field or item_#_unitPrice in your request
Reader: username
Type: MooseX::Types::Varchar::Varchar[30]
Additional documentation: Your CyberSource merchant ID. Use the same merchantID for evaluation, testing, and production
Reader: credit_card
Type: MooseX::Types::CreditCard::CreditCard
Additional documentation: Customer's credit card number
Reader: card_type
Type: MooseX::Types::CyberSource::CardTypeCode
Additional documentation: Type of card to authorize
Reader: reference_code
Type: MooseX::Types::Varchar::Varchar[50]
Reader: cv_indicator
Type: MooseX::Types::CyberSource::CvIndicator
Additional documentation: Flag that indicates whether a CVN code was sent
Reader: currency
Type: MooseX::Types::Locale::Currency::CurrencyCode
Reader: production
Type: Bool
Additional documentation: 0: test server. 1: production server
Reader: exchange_rate
Reader: exchange_rate_timestamp
Reader: full_name
Type: MooseX::Types::Varchar::Varchar[60]
Reader: cc_exp_year
Type: MooseX::Types::Varchar::Varchar[4]
Additional documentation: Four-digit year that the credit card expires in. Format: YYYY.
Reader: cybs_xsd
Reader: foreign_currency
Additional documentation: Billing currency returned by the DCC service. For the possible values, see the ISO currency codes
Reader: client_name
Reader: client_version
Reader: items
Type: ArrayRef[MooseX::Types::CyberSource::Item]
Instantiates a DCC request object, see the attributes listed below for which ones are required and which are optional.
Actually sends the required data to CyberSource for processing and returns a Business::CyberSource::Response object.
Business::CyberSource::Request
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) 2011 by Caleb Cushing.
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.