NAME

Business::OnlinePayment::IPayment::Response - Helper class for Ipayment responses

SYNOPSIS

# where %params are the GET parameters
$ipayres = Business::OnlinePayment::IPayment::Response->new(%params);

$ipayres->set_credentials(
                        my_amount   => "5000",
                        my_currency => "EUR",
                        my_userid   => "99999",
                        my_security_key => "testtest",
                       );
ok($ipayres->is_success && $ipayres->is_valid, "Payment looks ok");

DESCRIPTION

ACCESSORS

ret_transtime

Time of transaction.

ret_transdate

Date of the transaction.

ret_errorcode

The error code of 0 means that the transaction was successful. When in a CGI integration mode parameter redirect_needed returned with the value 1 is the only means that all data is correct and a redirect must be running. The return value is meaningful only after a second call.

redirect_needed

This parameter is set if the payment could not be completed because of a redirect necessary.

ret_errormsg

Error message (in German). This is important to propagate to the web interface.

ret_additionalmsg

Additional Error message, sometimes in English, sometimes inexistent.

ret_fatalerror

This value is returned only if an error has occurred.

Based on this value, your shop offer the buyer the option of payment data correct as long as there is no fatal error. Fatal errors are usually disruptions in Bank network or other problems where a new trial is expected no Improvement brings. Your customers, you can in this case, a specific error message

addr_name

Data type: string, maximum 100 characters Name of the buyer. This parameter is required for all payments.

addr_email

Data type: string, maximum 80 characters

E-mail address of the buyer. If this field is filled in, the e-mail address is checked for plausibility.

addr_street
addr_city

City

addr_zip

ZIP code

addr_country

ISO country code (2 chars, not 3 as the documentation says)

Optional contact details

addr_street2

Second street.

addr_state

(USA only), two chars.

addr_telefon

Telephone, max 30 chars

addr_telefax

Telefax, max 30 chars

Payment details

trx_paymentmethod

In this parameter the name of the medium used, payment will be returned. the For example, a credit card type (such as Visa or MasterCard) or ELV.

ret_authcode

Authorization number of third party payment for this transaction or other unique Identification of the payment the payment provider. The parameters may in certain cases be empty.

trx_currency

Currency in which the payment is processed. There are all known three-letter ISO Currency codes allowed. A list of known currency codes, see https://ipayment.de/ under Technik.

Note that the processing of payments in the currency must be agreed with your payment provider.

ret_url_checksum
ret_param_checksum
ret_ip

IP of the client who did the transaction

trx_typ

See transactionType in Business::OnlinePayment::IPayment

ret_trx_number

If the status is SUCCESS, here we have the Unique transaction number (reservation number) of ipayment system. this number is returned in the form of "x-xxxxxxx", where x is a single digit. with this Transaction number, you can perform other actions such as charging or cancellations.

ret_status

The possible values ​​are:

SUCCESS: The transaction has been successfully completed.

ERROR: In transaction processing, an error occurred.

REDIRECT: To further processing must be performed a redirect (3-D secure, verification needed)

trx_paymenttyp

Values: cc (Credit card), elv (ELV), pp (Prepaid payment)

trx_paymentdata_country

In this parameter, if possible, the ISO code of the country returned to the the payment data belongs. The field contains, for example, for credit card payments, the country the card-issuing bank and ELV payments the bank country.

trx_amount

Amount to be debited. Enter the value in the smallest currency unit, for Example cents. Decimal points or other characters except numbers are not allowed.

For example, the amount of EUR 10.00 is given as 1000 cents.

ret_booknr

Used for the checksum and apparently not documented.

trxuser_id

See trxuserId in Business::OnlinePayment::IPayment

trx_remoteip_country

Iso code of the IP which does the transaction

Payment data

Optional data returned by the Ipayment server if the cgi parameter return_paymentdata_details is set to 1 (no SOAP for this, you have to add an hidded input field in the form).

The credit card number is returned masked with the last 4 digits visible.

paydata_cc_cardowner
paydata_cc_number
paydata_cc_typ
paydata_cc_expdate

Setters needed for the hash checking

my_amount

You need to set the my_amount attribute if you want to check the hash.

my_userid

Our trxuser_id

my_currency

Our currency

my_security_key

The security key

shopper_id

The cart->id of the transaction

invoice_text

In payment processing with the below payment provider you can use a Specify text that is sent to the payment provider. This text if the debiting more precisely describe. Depending on the payment providers and credit cards out bender site This text is printed on the card account of the customer and / or dealer. If this parameter is not set, ipayment automatically uses the company name merchant that you specified in the configuration menu ipayment under General Data

This can be sent into the options as options-{invoiceText}>

trx_user_comment

Comment that is stored in the transaction in ipayment system. this comment is not sent to the bank or payment processor.

This can be sent into the options as options-{trxUserComment}>

Storage accessors

datastorage_expirydate

The date as returned by the ipayment server (like: 2008/09/15)

storage_id

The storage id for the current transaction.

trx_issuer_avs_response

AVS related response.p. 62 of the doc

trx_payauth_status

3D-related response, p. 62 of the doc

METHODS

set_credentials(%hash)

As a shortcut, you can set the above attribute using this method

is_success

Return true if the transaction was successful, undef otherwise

is_error

Return true if the transaction raised an error, undef otherwise. You can access the German error message with the accessor ret_errormsg

is_valid

Return true if the servers return a checksum (for this you have to build a session with trx_securityhash for this to work, and you should use the app_security_key).

CGI Name: ret_param_checksum Data type: String

The hash is the md5sum of the concatenation of trxuser_id trx_amount, trx_currency, ret_authcode, ret_booknr and transaction security key.

If one of the fields is empty or not returned, use the empty string.

The checksum is only in case of success of a transaction (ret_errorcode = 0 and redirect_ needed = 0) are available.

perl -e 'use Digest::MD5 qw/md5_hex/;
    print md5_hex("99998" . 5000 . "EUR" . "" . "1-83400472" .  "testtest");'

# => 6bff5d51a44f048e887d1ab7677c4798 and it matches

validation_errors

With this accessor you are able to lookup the validation errors found

raw_url

Accessor for the raw, undecoded url (used for the checksum).

url_is_valid($raw_undecoded_url)

You may ask for the validation of the url, which comes with a checksum attached. For this you should have already provided the security key and you should pass the raw undecoded url as argument.

Alternatively, if you set the attribute raw_url in the constructor or with the accessor, you can call url_is_valid without arguments.

Return false on failure, true on success

Original German doc (left in place because the translation was drunk).

CGI-Name: ret_url_checksum Webservice-Name: - (nicht benötigt) Datentyp: String

Wenn Sie für eine Transaktion eine Anwendung mit einem Security-Key verwendet haben, wird dieser Parameter mit einem MD5-Hash an die Rücksprungs-URL angehängt.

Für die Bildung des Hash wird an die Rücksprungs-URL ein & und der Transaktions-Security- Key der Anwendung angehängt. Für diese Zeichenkette wird die MD5-Prüfsumme generiert. Der ermittelte Hash wird als Parameter ret_url_checksum an die Rücksprungs-URL hinter alle anderen Parameter an das Ende angehängt.

Um die Prüfsumme zu überprüfen müssen Sie den Parameter ret_url_checksum von der vollständigen URL des aufgerufenen Scriptes abschneiden, den Transaktions-Security-Key anhängen und dann die MD5-Prüfsumme ermitteln. Wenn die Prüfsumme nicht mit dem Wert des Parameters ret_url_checksum übereinstimmt, liegt vermutlich eine Manipulation der URL vor.

address_info

Shortcut that combines the cardholder details, separated by a whitespace