NAME

Business::OnlinePayment::CyberSource::Client - CyberSource Client object for Business::OnlinePayment::CyberSource

VERSION

version 3.000016

SYNOPSIS

  use 5.010;
  use Business::OnlinePayment::CyberSource::Client;

  my $client = Business::OnlinePayment::CyberSource::Client->new();

  my $data = {
    invoice_number => 12345678,
    purchase_totals => {
      currency => 'USD',
      total => 9000,
    },
    bill_to => {
	first_name      => 'Tofu',
	last_name       => 'Beast',
	street1         => '123 Anystreet',
	city            => 'Anywhere',
	state           => 'UT',
	postal_code             => '84058',
	country         => 'US',
	email           => 'tofu@beast.org',
    },
    card => {
	account_number     => '4111111111111111',
	expiration      => { month => 12, year => 2012 },
	security_code => 1111,
    },
  };

  $client->authorize( $data );

  if ( $client->is_success() ) {
  	say "Transaction succeeded!";
  }

DESCRIPTION

Business::OnlinePayment::CyberSource::Client is a wrapper for the Business::CyberSource::Client. It provides a translation layer between the Business::OnlinePayment API and the Business::CyberSource API. While the input parameters and method names follow the conventions Business::CyberSource API, the attribute names follow the Business::OnlinePayment API.

ATTRIBUTES

is_success

use to determine whether or not the transaction succeeded

authorization

The authorization code supplied upon a successful authorization

order_number

This is the CyberSource-generated transaction identifier. It should be used to identify subsequent transactions to authorizations.

$client->capture( { ... service => { request_id => $client->order_number() }, ... } );

card_token

this is currently not supported.

fraud_score

This is currently not supported

fraud_transaction_id

This is currently not supported.

response_code

The HTTP response code

response_headers

A hash of the HTTP response headers

response_page

The HTTP response content

result_code

The processor response value

avs_code

The code returned for the Address Verification Service

cvv2_response

The CVV2 code value

transaction_type

This is the type value supplied to the content method of Business::OnlinePayment::CyberSource

username

The CyberSource account username

password

The CyberSource account API key

test_transaction

Boolean value determining whether transactions should be sent as test transactions or not.

This method should be called after construction but before transactions are performed, unless it is supplied to the constructor.

require_avs

Boolean determining whether or not address verification should be done

server

This holds the value of the CyberSource server to which requests are being made.

port

This holds the port number on which the remote server is communicating.

path

This holds the path component of the remote service URI.

METHODS

authorize

This method should be used to perform an "Authorization Only" transaction.

Parameters:

{
  reference_code  => 44544,
  bill_to         => {
    first_name    => 'John",
    last_name     => 'Doe',
    email         => 'john.doe@example.com',
    street1       => '101 Main Street',
    city          => 'Friendship',
    state         => 'AR',
    zip           => 12345,
    country       => 'US',
  },
  purchase_totals => {
    total         => 9000,
    currency      => 'USD',
  },
}

Returns:

1 on success and 0 otherwise

sale

This method performs the "Normal Authorization" transaction. It combines "Authorization Only" and "Post Authorization".

Parameters:

{
  reference_code  => 44544,
  bill_to         => {
    first_name    => 'John",
    last_name     => 'Doe',
    email         => 'john.doe@example.com',
    street1       => '101 Main Street',
    city          => 'Friendship',
    state         => 'AR',
    zip           => 12345,
    country       => 'US',
  },
  purchase_totals => {
    total         => 9000,
    currency      => 'USD',
  },
}

Returns:

1 on success and 0 otherwise

credit

this method performs a "Credit" transaction.

Parameters:

(For typical credits)

{ reference_code => 44544, bill_to => { first_name => 'John", last_name => 'Doe', email => 'john.doe@example.com', street1 => '101 Main Street', city => 'Friendship', state => 'AR', zip => 12345, country => 'US', }, purchase_totals => { total => 9000, currency => 'USD', }, }

(For follow-on credits)

{ reference_code => 44544, service => { request_id => 1010101 }, # Generated by CyberSource purchase_totals => { total => 9000, currency => 'USD', }, }

Returns:

1 on success and 0 otherwise

capture

This method performs a "Post Authorization" transaction.

Parameters:

{ reference_code => 44544, service => { request_id => 1010101 }, # Generated by CyberSource purchase_totals => { total => 9000, currency => 'USD', }, }

Returns:

1 on success and 0 otherwise

auth_reversal

This method performs a "Void" transaction

Parameters:

{ reference_code => 44544, service => { request_id => 1010101 }, # Generated by CyberSource purchase_totals => { total => 9000, currency => 'USD', }, }

Returns:

1 on success and 0 otherwise

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/xenoterracide/business-onlinepayment-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.

AUTHORS

  • Jad Wauthier <Jadrien dot Wauthier at GMail dot com>

  • Caleb Cushing <xenoterracide@gmail.com>

  • Peter Bowen <peter@bowenfamily.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by HostGator.com.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.