Business::OnlinePayment::CashCow - Online payment processing via CashCow
This documentation describes version 0.02 of Business::OnlinePayment::CashCow
my $tx = new Business::OnlinePayment("CashCow"); my $tx = new Business::OnlinePayment("CashCow", { shopid => 'cashcowshopid', }); $tx->content( type => 'Visa', amount => '1129.50', cardnumber => '123456789012', expiration => '1212', name => 'Richie Rich', ); $tx->content( type => 'Visa', amount => '1129.50', cardnumber => '123456789012', expiration => '1212', name => 'Richie Rich', currency => 608, #PHP - Philipine Pesos???? ); $tx->submit(); if ($tx->is_success()) { print "Payment successfull\n"; } else { print "Error: ".$tx->error_message(); }
The CashCow gateway used in this module is the CashCow open source project, which is a C library, please see to Business::CashCow.
The goal of this module is to make a machine to machine credit card transactions. CashCow has several options where you can specify URL for handling online payments directly using CGI scripts.
So in order to avoid this layer and still perform transactions this module was initiated. At the same time the module attempts to follow the defacto standard for the modules in the Business::OnlinePayment namespace.
In order to avoid filtering a HTML response two solutions are doable
Either you can specify the result URLs on the CashCow gateway using the PHP located in the php directory, which output XML, which is more structured and more easily parsed.
If you want to roll your own , please refer to the examples located in the xml directory.
You can also create HTML (or a different XML) output you just need to subclass this class and override the _process_response method.
Dankort E-Dankort (**) VISA/Dankort Eurocard MasterCard Visa Visa Electron JCB Diners (*) American Express (*) Forbrugsforeningen (*) Ikano Finans kort (*) (*) To accept this, you need a Merchant Agreement with the card provider in question. (**) Not supported by this module at this time (SEE: TODO).
This method is located in the SUPER class Business::OnlinePayment and returns a Business::OnlinePayment::CashCow object when called with the string CashCow as parameter to the contructor.
This method is required to be overloaded by Business::OnlinePayment
The method uses HTTPS via Net::SSLeay.
Return 1 upon success and 0 upon failure.
Check is_success for indication of transaction success and error_message in case of transaction failure.
This method overloads the similar method in Business::OnlinePayment
It sets possible defaults required by Business::OnlinePayment::CashCow.
This method is inherited from Business::OnlinePayment
It test the TestFlg form field (SEE: 'Original Formfields', below and 'TODO' below).
This method was overloaded for development reasons only and will eventually be removed.
This is a private method implemented to handle the response, which the author recommends to be and XML formatted response.
The CashCow system is quite flexible and therefore it is not possible to say what fields are mandatory and which are optional, since configurations may differ from shop to shop (SEE: TODO).
shopid
This is the string holding the shopid for the shop configured on the CashCow gateway for the shop you want to access.
This field is regarded to be mandatory hence it is needed to complete a transaction - all requests to a CashCow gateway without a shopid is responded to with an HTTP response code of 304.
These fields are the ones provided by the CashCow gateway. This module complies with the Business::OnlinePayment API v2. so the API described in this module should be used. But fields listed below can be added to the content dataset (SEE: SYNOPSIS) if some extra information is needed - use of some fields however is not recommended since these are redundant with the fields specified in the Business::OnlinePayment API.
foreignorderid
sessionid
cust_name
cust_street
cust_zip
cust_phone
cust_email
cardnum
emonth
eyear
cvc
amount
currency
This field can be use to hold your own orderid for reference.
This field is regarded as defaulting to optional. Can be used freely.
This field can be use to hold a sessionid.
The customer name (full name) - concatenation might be necessary. Cardholders name should go in this field.
This field is regarded as defaulting to optional. Please use: name instead.
The street of the customer address.
This field is regarded as defaulting to optional. Please use: address instead.
The zip code of the customers address.
This field is regarded as defaulting to optional. Please use: zip instead.
The phonenumber of the customer.
This field is regarded as defaulting to optional. Please use: phone instead.
This is the customer email adresse. CashCow has some different options for this parameter. It can either be optional or mandatory and you can even have the CashCow gateway evaluate the email address with the configuration parameter strict which can be set on the gateway.
This field is regarded as defaulting to optional. Please use: email instead.
This field is regarded as defaulting to mandatory. Please use: card_number instead.
The expiration month in two digits, listed on the front of the creditcard.
This field is regarded as defaulting to mandatory. Please use: expiration instead.
The expiration year in two digits, listed on the front of the creditcard.
The 3- or 4-digit control number on the back of a creditcard. The CashCow gateway refers to this as CVC, but the name actually depends on the card in question, but this module sticks to the name CVC eventhough it might be used for:
CVV2 (Visa)
CVC2 (Mastercard)
CID (American Express)
This field is regarded as defaulting to mandatory.
The amount should be provided in english notation, do not use locale if it differs from the using . (dot) as separator. (SEE: SYNOPSIS).
This argument can be used to specify the currency. The currency defaults to 208, which is the numeric currency code for DKK - Danish Krone.
The numeric codes are defined in: ISO4217
See, SEE ALSO section for references.
Implement handling of e-dankort card type
Implement handling of ecredit transactions (default is PBS)
Implement handling of subscribtions
Investigate return values and use of: authorization() and result_code()
Investigate test flags (TestFlg)
Make it possible to control what fields are mandatory and optional. This could be done via the optional processor info parameter to the constructor (SEE: new).
The tests reveal a warning of sorts from Net::SSLeay - it would be nice to have this warning eliminated.
Some warnings are issued due to redefinition of autoloaded subs built by the SUPER class, this would be nice to get out of the way aswell
t/Submit..........ok 1/6Subroutine shopid redefined at (eval 36) line 1. Subroutine testflg redefined at (eval 37) line 1.
Please report issues via CPAN RT:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-OnlinePayment-CashCow
or by sending mail to
bug-Business-OnlinePayment-CashCow@rt.cpan.org
Please be aware that the CashCow gateways URLs are not RFC 2396 compliant, '~' in URLs are not currently supported - might tease during development or similar.
Business::OnlinePayment
Net::SSLeay
http://www.cashcowgateway.com/
http://www.cashcow.dk/
http://420.am/business-onlinepayment/
Business::CashCow
http://www.sti.nasa.gov/cvv.html
http://search.cpan.org/src/JASONK/Business-OnlinePayment-2.01/notes_for_module_writers
Locale::Currency
http://en.wikipedia.org/wiki/ISO_4217
http://www.iso.org/iso/en/prods-services/popstds/currencycodeslist.html
Jonas B. Nielsen, (jonasbn) - <jonasbn@cpan.org>
<jonasbn@cpan.org>
CashCowGateWay is copyright of CashCow ApS
CashCow is copyright of the CashCow association
Business-OnlinePayment-CashCow is (C) by logicLAB 2005
Business-OnlinePayment-CashCow is released under the artistic license
The distribution is licensed under the Artistic License, as specified by the Artistic file in the standard perl distribution (http://www.perl.com/language/misc/Artistic.html).
To install Business::OnlinePayment::CashCow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::OnlinePayment::CashCow
CPAN shell
perl -MCPAN -e shell install Business::OnlinePayment::CashCow
For more information on module installation, please visit the detailed CPAN module installation guide.