{
    "mode": "perldoc",
    "parameter": "Business::OnlinePayment",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Business%3A%3AOnlinePayment/json",
    "generated": "2026-06-16T10:21:26Z",
    "synopsis": "use Business::OnlinePayment;\nmy $transaction = new Business::OnlinePayment($processor, %processorinfo);\n$transaction->content(\ntype        => 'Visa',\namount      => '49.95',\ncardnumber => '1234123412341238',\nexpiration  => '06/15',\nname        => 'John Q Doe',\n);\neval { $transaction->submit(); };\nif ( $@ ) {\nprint \"$processor error: $@\\n\";\n} else {\nif ( $transaction->issuccess() ) {\nprint \"Card processed successfully: \". $transaction->authorization().\"\\n\";\n} else {\nprint \"Card was rejected: \". $transaction->errormessage(). \"\\n\";\n}\n}",
    "sections": {
        "NAME": {
            "content": "Business::OnlinePayment - Perl extension for online payment processing\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Business::OnlinePayment;\n\nmy $transaction = new Business::OnlinePayment($processor, %processorinfo);\n$transaction->content(\ntype        => 'Visa',\namount      => '49.95',\ncardnumber => '1234123412341238',\nexpiration  => '06/15',\nname        => 'John Q Doe',\n);\n\neval { $transaction->submit(); };\n\nif ( $@ ) {\n\nprint \"$processor error: $@\\n\";\n\n} else {\n\nif ( $transaction->issuccess() ) {\nprint \"Card processed successfully: \". $transaction->authorization().\"\\n\";\n} else {\nprint \"Card was rejected: \". $transaction->errormessage(). \"\\n\";\n}\n\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Business::OnlinePayment is a generic module for processing payments through online credit card\nprocessors, electronic cash systems, etc.\n",
            "subsections": []
        },
        "CONSTRUCTOR": {
            "content": "new($processor, %processoroptions)\nCreate a new Business::OnlinePayment object, $processor is required, and defines the online\nprocessor to use. If necessary, processor options can be specified, currently supported options\nare 'Server', 'Port', and 'Path', which specify how to find the online processor\n(https://server:port/path), but individual processor modules should supply reasonable defaults\nfor this information, override the defaults only if absolutely necessary (especially path), as\nthe processor module was probably written with a specific target script in mind.\n",
            "subsections": []
        },
        "TRANSACTION SETUP METHODS": {
            "content": "content(%content)\nThe information necessary for the transaction, this tends to vary a little depending on the\nprocessor, so we have chosen to use a system which defines specific fields in the frontend which\nget mapped to the correct fields in the backend. The currently defined fields are:\n\nPROCESSOR FIELDS\nlogin\nYour login name to use for authentication to the online processor.\n\npassword\nYour password to use for authentication to the online processor.\n\nREQUIRED TRANSACTION FIELDS\ntype\nTransaction type, supported types are: CC (credit card), ECHECK (electronic check) and LEC\n(phone bill billing). Deprecated types are: Visa, MasterCard, American Express, Discover,\nCheck. Not all processors support all transaction types.\n\naction\nWhat action being taken by this transaction. Currently available are:\n\nNormal Authorization\nAuthorization Only\nPost Authorization\nReverse Authorization\nVoid\nCredit\nTokenize\nRecurring Authorization\nModify Recurring Authorization\nCancel Recurring Authorization\n\namount\nThe amount of the transaction. No dollar signs or currency identifiers, just a whole or\nfloating point number (i.e. 26, 26.1 or 26.13).\n\nOPTIONAL TRANSACTION FIELDS\npartialauth\nIf you are prepared to handle partial authorizations (see partialauthamount() in\nTRANSACTION RESULT FIELDS), pass a true value in this field to enable them.\n\nIf this flag is not set, a partial authorization will be immediately reversed or voided.\n\ndescription\nA description of the transaction (used by some processors to send information to the client,\nnormally not a required field).\n\ninvoicenumber\nAn invoice number, for your use and not normally required, many processors require this\nfield to be a numeric only field.\n\nponumber\nPurchase order number (normally not required).\n\ntax Tax amount (portion of amount field, not added to it).\n\nfreight\nFreight amount (portion of amount field, not added to it).\n\nduty\nDuty amount (portion of amount field, not added to it).\n\ntaxexempt\nTax exempt flag (i.e. TRUE, FALSE, T, F, YES, NO, Y, N, 1, 0).\n\ncurrency\nCurrency, specified as an ISO 4217 three-letter code, such as USD, CAD, EUR, AUD, DKK, GBP,\nJPY, NZD, etc.\n\nCUSTOMER INFO FIELDS\ncustomerid\nA customer identifier, again not normally required.\n\nname\nThe customer's name, your processor may not require this.\n\nfirstname\nlastname\nThe customer's first and last name as separate fields.\n\ncompany\nThe customer's company name, not normally required.\n\naddress\nThe customer's address (your processor may not require this unless you are requiring AVS\nVerification).\n\ncity\nThe customer's city (your processor may not require this unless you are requiring AVS\nVerification).\n\nstate\nThe customer's state (your processor may not require this unless you are requiring AVS\nVerification).\n\nzip The customer's zip code (your processor may not require this unless you are requiring AVS\nVerification).\n\ncountry\nCustomer's country.\n\nshipfirstname\nshiplastname\nshipcompany\nshipaddress\nshipcity\nshipstate\nshipzip\nshipcountry\nThese shipping address fields may be accepted by your processor. Refer to the description\nfor the corresponding non-ship field for general information on each field.\n\nphone\nCustomer's phone number.\n\nfax Customer's fax number.\n\nemail\nCustomer's email address.\n\ncustomerip\nIP Address from which the transaction originated.\n\nCREDIT CARD FIELDS\ncardnumber\nCredit card number.\n\nexpiration\nCredit card expiration, MM/YY.\n\ncvv2\nCVV2 number (also called CVC2 or CID) is a three- or four-digit security code used to reduce\ncredit card fraud.\n\ncardtoken\nIf supported by your gateway, you can pass a cardtoken instead of a cardnumber and\nexpiration.\n\ntrack1\nTrack 1 on the magnetic stripe (Card present only)\n\ntrack2\nTrack 2 on the magnetic stripe (Card present only)\n\nrecurringbilling\nRecurring billing flag\n\nELECTRONIC CHECK FIELDS\naccountnumber\nBank account number\n\nroutingcode\nBank's routing code\n\naccounttype\nAccount type. Can be (case-insensitive): Personal Checking, Personal Savings, Business\nChecking or Business Savings.\n\nnachaseccode\nNACHA SEC Code for US ACH transactions. 'PPD' indicates customer signed a form giving\nauthorization for the charge, 'CCD' same for a business checking/savings account, 'WEB' for\nonline transactions where a box was checked authorizing the charge, and 'TEL' for\nauthorization via recorded phone call (NACHA script required).\n\naccountname\nAccount holder's name.\n\nbankname\nBank name.\n\nbankcity\nBank city.\n\nbankstate\nBank state.\n\nchecktype\nCheck type.\n\ncustomerorg\nCustomer organization type.\n\ncustomerssn\nCustomer's social security number.\n\nlicensenum\nCustomer's driver's license number.\n\nlicensedob\nCustomer's date of birth.\n\nFOLLOW-UP TRANSACTION FIELDS\nThese fields are used in follow-up transactions related to an original transaction (Post\nAuthorization, Reverse Authorization, Void, Credit).\n\nauthorization\nordernumber\ntxndate\n\nRECURRING BILLING FIELDS\ninterval\nInterval expresses the amount of time between billings: digits, whitespace and units\n(currently \"days\" or \"months\" in either singular or plural form).\n\nstart\nThe date of the first transaction (used for processors which allow delayed start) expressed\nas YYYY-MM-DD.\n\nperiods\nThe number of cycles of interval length for which billing should occur (inclusive of 'trial\nperiods' if the processor supports recurring billing at more than one rate)\n\ntesttransaction()\nMost processors provide a test mode, where submitted transactions will not actually be charged\nor added to your batch, calling this function with a true argument will turn that mode on if the\nprocessor supports it, or generate a fatal error if the processor does not support a test mode\n(which is probably better than accidentally making real charges).\n\nrequireavs()\nProviding a true argument to this module will turn on address verification (if the processor\nsupports it).\n",
            "subsections": []
        },
        "TRANSACTION SUBMISSION METHOD": {
            "content": "submit()\nSubmit the transaction to the processor for completion.\n\nIf there is a gateway communication error or other \"meta\" , the submit method will throw a fatal\nexception. You can catch this with eval {} if you would like to treat gateway co\n",
            "subsections": []
        },
        "TRANSACTION RESULT METHODS": {
            "content": "issuccess()\nReturns true if the transaction was approved by the gateway, false if it was submitted but not\napproved, or undef if it has not been submitted yet.\n\npartialauthamount()\nIf this transaction was a partial authorization (i.e. successful, but less than the requested\namount was processed), then the amount processed is returned in this field.\n\n(When issuccess is true but this field is empty or 0, that indicates a normal full\nauthorization for the entire requested amount.)\n\nerrormessage()\nIf the transaction has been submitted but was not accepted, this function will return the\nprovided error message (if any) that the processor returned.\n\nfailurestatus()\nIf the transaction failed, it can optionally return a specific failure status (normalized, not\ngateway-specific). Currently defined statuses are: \"expired\", \"nsf\" (non-sufficient funds),\n\"stolen\", \"pickup\", \"blacklisted\" and \"declined\" (card/transaction declines only, not other\nerrors).\n\nNote that not all processor modules support this, and that if supported, it may not be set for\nall declines.\n\nauthorization()\nIf the transaction has been submitted and accepted, this function will provide you with the\nauthorization code that the processor returned. Store this if you would like to run inquiries or\nrefunds on the transaction later.\n\nordernumber()\nThe unique order number for the transaction generated by the gateway. Store this if you would\nlike to run inquiries or refunds on the transaction later.\n\ncardtoken()\nIf supported by your gateway, a cardtoken can be used in a subsequent transaction to refer to a\ncard number.\n\ntxndate()\nTransaction date, as returned by the gateway. Required by some gateways for follow-up\ntransactions. Store this if you would like to run inquiries or refunds on the transaction later.\n\nfraudscore()\nRetrieve or change the fraud score from any Business::FraudDetect plugin\n\nfraudtransactionid()\nRetrieve or change the transaction id from any Business::FraudDetect plugin\n\nresponsecode()\nresponseheaders()\nresponsepage()\nThese three fields are set by some processors (especially those which use HTTPS) when the\ntransaction fails at the communication level rather than as a transaction.\n\nresponsecode is the HTTP response code and message, i.e. '500 Internal Server Error'.\n\nresponseheaders is a hash reference of the response headers\n\nresponsepage is the raw content.\n\nresultcode()\nReturns the precise result code that the processor returned, these are normally one letter codes\nthat don't mean much unless you understand the protocol they speak, you probably don't need\nthis, but it's there just in case.\n\navscode()\ncvv2response()",
            "subsections": []
        },
        "MISCELLANEOUS INTERNAL METHODS": {
            "content": "transactiontype()\nRetrieve the transaction type (the 'type' argument to contents()). Generally only used\ninternally, but provided in case it is useful.\n\nserver()\nRetrieve or change the processor submission server address (CHANGE AT YOUR OWN RISK).\n\nport()\nRetrieve or change the processor submission port (CHANGE AT YOUR OWN RISK).\n\npath()\nRetrieve or change the processor submission path (CHANGE AT YOUR OWN RISK).\n",
            "subsections": []
        },
        "HELPER METHODS FOR GATEWAY MODULE AUTHORS": {
            "content": "buildsubs( @subnames )\nBuild setter/getter subroutines for new return values.\n\ngetfields( @fields )\nGet the named fields if they are defined.\n\nremapfields( %map )\nRemap field content (and stuff it back into content).\n\nrequiredfields( @fields )\nCroaks if any of the required fields are not present.\n\ndumpcontents\nsillybool( $value )\nReturns 1 if the value starts with y, Y, t or T. Returns 0 if the value starts with n, N, f or\nF. Otherwise returns the value itself.\n\nUse this for handling boolean content like taxexempt.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "(v2 series)\n\nJason Kohles, email@jasonkohles.com\n\n(v3 rewrite)\n\nIvan Kohler <ivan-business-onlinepayment@420.am>\n\nPhil Lobbes <phil at perkpartners dot com>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 1999-2004 Jason Kohles Copyright (c) 2004 Ivan Kohler Copyright (c) 2007-2018\nFreeside Internet Services, Inc.\n\nAll rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        },
        "HOMEPAGE": {
            "content": "Homepage: http://perl.business/onlinepayment\n\nDevelopment: http://perl.business/onlinepayment/ng.html\n",
            "subsections": []
        },
        "MAILING LIST": {
            "content": "Please direct current development questions, patches, etc. to the mailing list:\nhttp://mail.freeside.biz/cgi-bin/mailman/listinfo/bop-devel/\n",
            "subsections": []
        },
        "REPOSITORY": {
            "content": "The code is available from our public git repository:\n\ngit clone git://git.freeside.biz/Business-OnlinePayment.git\n\nOr on the web:\n\nhttp://git.freeside.biz/gitweb/?p=Business-OnlinePayment.git\nOr:\nhttp://git.freeside.biz/cgit/Business-OnlinePayment.git\n\nMany (but by no means all!) processor plugins are also available in the same repository, see:\n\nhttp://git.freeside.biz/gitweb/\nOr:\nhttp://git.freeside.biz/cgit/\n",
            "subsections": []
        },
        "DISCLAIMER": {
            "content": "THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\nWITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "http://perl.business/onlinepayment\n\nFor verification of credit card checksums, see Business::CreditCard.\n",
            "subsections": []
        }
    },
    "summary": "Business::OnlinePayment - Perl extension for online payment processing",
    "flags": [],
    "examples": [],
    "see_also": []
}