27
API documentation Ver 1. 7 , May 2017 Card payments integration KIP S.A. ul. Św. Marcin 73 /6 61- 808 Poznań www.kipsa.pl www.tpay.com

1. 7 - Tpay.com · demand credit cards payment, ... additional string used in message digest algorithm, ... API Gateway and Transaction panel URLs

  • Upload
    phamque

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

API documentation

Ver 1 7 May 2017

Card payments integration

KIP SA

ul Św Marcin 73 6 61- 808 Poznań

wwwkipsapl wwwtpaycom

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

2

Short description

This paper describes techniques for extending functionality of merchant services in fields of automated and on

demand credit cards payment later referred to as cards API Subscription payments are available also after

necessary timing implementation of on demand requests Integration requires merchant database adaptation

and conducting necessary use cases on test account described in the following chapters

Account setup

Cards API is accessible after merchant verification When required procedures are completed a new bookmark

API will appear in Credit card payments menu in Merchantrsquos Panel (httpssecuretpaycompanel)

First it is necessary to set the following parameters

bull Verification code - additional string used in message digest algorithm max 40 characters

bull New API password - API password keep in mind to make it strong (more than 15 characters)

bull Result URL - url address where to send notifications (with POST method)

bull Positive return URL - url address where to redirect client after successful payment

bull Negative return URL - url address where to redirect client after unsuccessful payment

bull Digest algorithm - type of algorithm used in message communication

All methods described in next chapters whih redirects payer to 3DS link can use additional parameters

bull pow_url ndash url address where to redirect client after successful payment

bull pow_url_blad - url address where to redirect client after unsuccessful payment

to overwrite links declared in merchant panel (This feature works only in production mode)

In API tab there are other readonly values like api key (see chapter 3) and public RSA key - used in direct sale

scenario

Test mode is default set to true This will let developers to test API methods and check system responses

Production mode can be set after successful tests only For technical support please contact at pttpaycom

Our system internal character encoding is UTF-8 Be aware of this fact especially while calculating sign in API

methods

API Gateway and Transaction panel URLs

Cards API Gateway is located under address httpssecuretpaycomapicardsapi_key

api_key is available in Merchantrsquos Panel (API bookmark) - 40-characters length constant string - available after

API account setup All requests have to be made using POST method

1

2

3

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

3

Use cases

Cards API can be used in specified use cases

The client is using Merchant and tpaycom system to perform card payment (also called sale) There are two

ways for performing first payment

1 with method register_sale and redirect client with given sale_auth

2 with method securesale Client pays through payment form directly from Merchantrsquos system

After the first sale is completed Merchant is able to execute on demand payments for specified client ndash but only

if the initial card authorization was processed correctly

The Scheduler can be used as subscription controller triggering payment on demand The scheduling logic has

to be implemented in Merchant system

Be aware of account mode Methods output and notifications delivers parameter test_mode if account is in test

mode You cannot process these messages in production system and do real accounting

In chapter 10 there are libraries code samples and special instructions helpful in system integration

4

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

4

Available methods

bull register_sale

Method used to create sale initialization in tpaycom system Successful request returns sale_auth used to

redirect client to transaction panel Communication scheme is presented below

Dashed lines mean backend communication If payment was correct notification will be send to Merchantrsquos

system (see chapter 6) Method uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) amount

currency numeric 3 digits currency default value from account

settings if not set see chapter 9 for values

order_id string up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card

data for future processing or not if

parameter was send system will not

register client and does not return cli_auth

(also payment on demand with presalesale

method will not be possible)

language string 2 characters language parameter used for transaction

panel and confirmation email content see

chapter 9 for possible values

sign string 40-128 characters message digest

5

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

5

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

sha1(method + name + email + desc + amount + currency + order_id + onetimer + language + verification

code) where + means concatenation

If successfully executed method returns a JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

The parameter sale_auth can now be used to redirect client to payment transaction panel

httpssecuretpaycomcards

with argument sale_auth passed with POST or GET method

Test mode notice

In test mode the transaction panel offers multiple system answers You can choose at the

transaction panel (instead of making a real transaction) to accept or decline payment to test all

paths

In production mode client will be directly redirected to payment gateway with credit card data form

Notification about positive transaction status will be sent to result url which is set in account settings

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

6

bull presale

Method used to create new sale for payment on demand It can be called after receiving notification with cli_auth

(see communication schema in register_sale method) It cannot be used if onetimer option was sent in register_sale or

client has unregistered (by link in email sent by tpaycom after registering clientrsquos credit card or by API)

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits sale currency default value from account

settings if not set see chapter 9 for possible

values

order_id String up to 40 characters value from partner system

language string 2 characters language parameter used for confirmation

email content see chapter 9 for possible values

cc string 2 characters commercial code

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + desc + amount + currency + order_id + language + cc + verification code) where + means

concatenation

If successfully executed method returns JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

From now Merchant can charge clients card with sale method with sale_auth

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

7

bull sale

Method used to execute created sale with presale method Sale defined with sale_auth can be executed only once If

the method is called second time with the same parameters system returns sale actual status - in parameter status -

done for correct payment and declined for rejected payment In that case client card is not charged the second time

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string 40 characters sale authorization ID

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1) hash_alg

(method + cli_auth + sale_auth + verification code) where + means concatenation

Passed cli_auth has to match with cli_auth used while creating sale in presale method

If processed correctly method returns the following parameters in JSON format (green values are present with correct

or done status red for declined)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created sale ID

cli_auth string 40 characters client authorization ID

currency numeric 3 digits currency see chapter 9 for more details

amount numeric (2 format) amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclineddone)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(sale_auth + cli_auth + currency + amount + sale_date+ status + reason + verification code)

Test mode notice

Method will return correct status with 50 probability The same concerns declined status In this

case reason value is also randomly picked

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

2

Short description

This paper describes techniques for extending functionality of merchant services in fields of automated and on

demand credit cards payment later referred to as cards API Subscription payments are available also after

necessary timing implementation of on demand requests Integration requires merchant database adaptation

and conducting necessary use cases on test account described in the following chapters

Account setup

Cards API is accessible after merchant verification When required procedures are completed a new bookmark

API will appear in Credit card payments menu in Merchantrsquos Panel (httpssecuretpaycompanel)

First it is necessary to set the following parameters

bull Verification code - additional string used in message digest algorithm max 40 characters

bull New API password - API password keep in mind to make it strong (more than 15 characters)

bull Result URL - url address where to send notifications (with POST method)

bull Positive return URL - url address where to redirect client after successful payment

bull Negative return URL - url address where to redirect client after unsuccessful payment

bull Digest algorithm - type of algorithm used in message communication

All methods described in next chapters whih redirects payer to 3DS link can use additional parameters

bull pow_url ndash url address where to redirect client after successful payment

bull pow_url_blad - url address where to redirect client after unsuccessful payment

to overwrite links declared in merchant panel (This feature works only in production mode)

In API tab there are other readonly values like api key (see chapter 3) and public RSA key - used in direct sale

scenario

Test mode is default set to true This will let developers to test API methods and check system responses

Production mode can be set after successful tests only For technical support please contact at pttpaycom

Our system internal character encoding is UTF-8 Be aware of this fact especially while calculating sign in API

methods

API Gateway and Transaction panel URLs

Cards API Gateway is located under address httpssecuretpaycomapicardsapi_key

api_key is available in Merchantrsquos Panel (API bookmark) - 40-characters length constant string - available after

API account setup All requests have to be made using POST method

1

2

3

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

3

Use cases

Cards API can be used in specified use cases

The client is using Merchant and tpaycom system to perform card payment (also called sale) There are two

ways for performing first payment

1 with method register_sale and redirect client with given sale_auth

2 with method securesale Client pays through payment form directly from Merchantrsquos system

After the first sale is completed Merchant is able to execute on demand payments for specified client ndash but only

if the initial card authorization was processed correctly

The Scheduler can be used as subscription controller triggering payment on demand The scheduling logic has

to be implemented in Merchant system

Be aware of account mode Methods output and notifications delivers parameter test_mode if account is in test

mode You cannot process these messages in production system and do real accounting

In chapter 10 there are libraries code samples and special instructions helpful in system integration

4

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

4

Available methods

bull register_sale

Method used to create sale initialization in tpaycom system Successful request returns sale_auth used to

redirect client to transaction panel Communication scheme is presented below

Dashed lines mean backend communication If payment was correct notification will be send to Merchantrsquos

system (see chapter 6) Method uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) amount

currency numeric 3 digits currency default value from account

settings if not set see chapter 9 for values

order_id string up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card

data for future processing or not if

parameter was send system will not

register client and does not return cli_auth

(also payment on demand with presalesale

method will not be possible)

language string 2 characters language parameter used for transaction

panel and confirmation email content see

chapter 9 for possible values

sign string 40-128 characters message digest

5

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

5

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

sha1(method + name + email + desc + amount + currency + order_id + onetimer + language + verification

code) where + means concatenation

If successfully executed method returns a JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

The parameter sale_auth can now be used to redirect client to payment transaction panel

httpssecuretpaycomcards

with argument sale_auth passed with POST or GET method

Test mode notice

In test mode the transaction panel offers multiple system answers You can choose at the

transaction panel (instead of making a real transaction) to accept or decline payment to test all

paths

In production mode client will be directly redirected to payment gateway with credit card data form

Notification about positive transaction status will be sent to result url which is set in account settings

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

6

bull presale

Method used to create new sale for payment on demand It can be called after receiving notification with cli_auth

(see communication schema in register_sale method) It cannot be used if onetimer option was sent in register_sale or

client has unregistered (by link in email sent by tpaycom after registering clientrsquos credit card or by API)

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits sale currency default value from account

settings if not set see chapter 9 for possible

values

order_id String up to 40 characters value from partner system

language string 2 characters language parameter used for confirmation

email content see chapter 9 for possible values

cc string 2 characters commercial code

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + desc + amount + currency + order_id + language + cc + verification code) where + means

concatenation

If successfully executed method returns JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

From now Merchant can charge clients card with sale method with sale_auth

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

7

bull sale

Method used to execute created sale with presale method Sale defined with sale_auth can be executed only once If

the method is called second time with the same parameters system returns sale actual status - in parameter status -

done for correct payment and declined for rejected payment In that case client card is not charged the second time

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string 40 characters sale authorization ID

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1) hash_alg

(method + cli_auth + sale_auth + verification code) where + means concatenation

Passed cli_auth has to match with cli_auth used while creating sale in presale method

If processed correctly method returns the following parameters in JSON format (green values are present with correct

or done status red for declined)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created sale ID

cli_auth string 40 characters client authorization ID

currency numeric 3 digits currency see chapter 9 for more details

amount numeric (2 format) amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclineddone)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(sale_auth + cli_auth + currency + amount + sale_date+ status + reason + verification code)

Test mode notice

Method will return correct status with 50 probability The same concerns declined status In this

case reason value is also randomly picked

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

3

Use cases

Cards API can be used in specified use cases

The client is using Merchant and tpaycom system to perform card payment (also called sale) There are two

ways for performing first payment

1 with method register_sale and redirect client with given sale_auth

2 with method securesale Client pays through payment form directly from Merchantrsquos system

After the first sale is completed Merchant is able to execute on demand payments for specified client ndash but only

if the initial card authorization was processed correctly

The Scheduler can be used as subscription controller triggering payment on demand The scheduling logic has

to be implemented in Merchant system

Be aware of account mode Methods output and notifications delivers parameter test_mode if account is in test

mode You cannot process these messages in production system and do real accounting

In chapter 10 there are libraries code samples and special instructions helpful in system integration

4

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

4

Available methods

bull register_sale

Method used to create sale initialization in tpaycom system Successful request returns sale_auth used to

redirect client to transaction panel Communication scheme is presented below

Dashed lines mean backend communication If payment was correct notification will be send to Merchantrsquos

system (see chapter 6) Method uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) amount

currency numeric 3 digits currency default value from account

settings if not set see chapter 9 for values

order_id string up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card

data for future processing or not if

parameter was send system will not

register client and does not return cli_auth

(also payment on demand with presalesale

method will not be possible)

language string 2 characters language parameter used for transaction

panel and confirmation email content see

chapter 9 for possible values

sign string 40-128 characters message digest

5

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

5

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

sha1(method + name + email + desc + amount + currency + order_id + onetimer + language + verification

code) where + means concatenation

If successfully executed method returns a JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

The parameter sale_auth can now be used to redirect client to payment transaction panel

httpssecuretpaycomcards

with argument sale_auth passed with POST or GET method

Test mode notice

In test mode the transaction panel offers multiple system answers You can choose at the

transaction panel (instead of making a real transaction) to accept or decline payment to test all

paths

In production mode client will be directly redirected to payment gateway with credit card data form

Notification about positive transaction status will be sent to result url which is set in account settings

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

6

bull presale

Method used to create new sale for payment on demand It can be called after receiving notification with cli_auth

(see communication schema in register_sale method) It cannot be used if onetimer option was sent in register_sale or

client has unregistered (by link in email sent by tpaycom after registering clientrsquos credit card or by API)

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits sale currency default value from account

settings if not set see chapter 9 for possible

values

order_id String up to 40 characters value from partner system

language string 2 characters language parameter used for confirmation

email content see chapter 9 for possible values

cc string 2 characters commercial code

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + desc + amount + currency + order_id + language + cc + verification code) where + means

concatenation

If successfully executed method returns JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

From now Merchant can charge clients card with sale method with sale_auth

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

7

bull sale

Method used to execute created sale with presale method Sale defined with sale_auth can be executed only once If

the method is called second time with the same parameters system returns sale actual status - in parameter status -

done for correct payment and declined for rejected payment In that case client card is not charged the second time

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string 40 characters sale authorization ID

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1) hash_alg

(method + cli_auth + sale_auth + verification code) where + means concatenation

Passed cli_auth has to match with cli_auth used while creating sale in presale method

If processed correctly method returns the following parameters in JSON format (green values are present with correct

or done status red for declined)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created sale ID

cli_auth string 40 characters client authorization ID

currency numeric 3 digits currency see chapter 9 for more details

amount numeric (2 format) amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclineddone)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(sale_auth + cli_auth + currency + amount + sale_date+ status + reason + verification code)

Test mode notice

Method will return correct status with 50 probability The same concerns declined status In this

case reason value is also randomly picked

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

4

Available methods

bull register_sale

Method used to create sale initialization in tpaycom system Successful request returns sale_auth used to

redirect client to transaction panel Communication scheme is presented below

Dashed lines mean backend communication If payment was correct notification will be send to Merchantrsquos

system (see chapter 6) Method uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) amount

currency numeric 3 digits currency default value from account

settings if not set see chapter 9 for values

order_id string up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card

data for future processing or not if

parameter was send system will not

register client and does not return cli_auth

(also payment on demand with presalesale

method will not be possible)

language string 2 characters language parameter used for transaction

panel and confirmation email content see

chapter 9 for possible values

sign string 40-128 characters message digest

5

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

5

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

sha1(method + name + email + desc + amount + currency + order_id + onetimer + language + verification

code) where + means concatenation

If successfully executed method returns a JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

The parameter sale_auth can now be used to redirect client to payment transaction panel

httpssecuretpaycomcards

with argument sale_auth passed with POST or GET method

Test mode notice

In test mode the transaction panel offers multiple system answers You can choose at the

transaction panel (instead of making a real transaction) to accept or decline payment to test all

paths

In production mode client will be directly redirected to payment gateway with credit card data form

Notification about positive transaction status will be sent to result url which is set in account settings

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

6

bull presale

Method used to create new sale for payment on demand It can be called after receiving notification with cli_auth

(see communication schema in register_sale method) It cannot be used if onetimer option was sent in register_sale or

client has unregistered (by link in email sent by tpaycom after registering clientrsquos credit card or by API)

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits sale currency default value from account

settings if not set see chapter 9 for possible

values

order_id String up to 40 characters value from partner system

language string 2 characters language parameter used for confirmation

email content see chapter 9 for possible values

cc string 2 characters commercial code

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + desc + amount + currency + order_id + language + cc + verification code) where + means

concatenation

If successfully executed method returns JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

From now Merchant can charge clients card with sale method with sale_auth

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

7

bull sale

Method used to execute created sale with presale method Sale defined with sale_auth can be executed only once If

the method is called second time with the same parameters system returns sale actual status - in parameter status -

done for correct payment and declined for rejected payment In that case client card is not charged the second time

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string 40 characters sale authorization ID

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1) hash_alg

(method + cli_auth + sale_auth + verification code) where + means concatenation

Passed cli_auth has to match with cli_auth used while creating sale in presale method

If processed correctly method returns the following parameters in JSON format (green values are present with correct

or done status red for declined)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created sale ID

cli_auth string 40 characters client authorization ID

currency numeric 3 digits currency see chapter 9 for more details

amount numeric (2 format) amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclineddone)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(sale_auth + cli_auth + currency + amount + sale_date+ status + reason + verification code)

Test mode notice

Method will return correct status with 50 probability The same concerns declined status In this

case reason value is also randomly picked

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

5

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

sha1(method + name + email + desc + amount + currency + order_id + onetimer + language + verification

code) where + means concatenation

If successfully executed method returns a JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

The parameter sale_auth can now be used to redirect client to payment transaction panel

httpssecuretpaycomcards

with argument sale_auth passed with POST or GET method

Test mode notice

In test mode the transaction panel offers multiple system answers You can choose at the

transaction panel (instead of making a real transaction) to accept or decline payment to test all

paths

In production mode client will be directly redirected to payment gateway with credit card data form

Notification about positive transaction status will be sent to result url which is set in account settings

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

6

bull presale

Method used to create new sale for payment on demand It can be called after receiving notification with cli_auth

(see communication schema in register_sale method) It cannot be used if onetimer option was sent in register_sale or

client has unregistered (by link in email sent by tpaycom after registering clientrsquos credit card or by API)

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits sale currency default value from account

settings if not set see chapter 9 for possible

values

order_id String up to 40 characters value from partner system

language string 2 characters language parameter used for confirmation

email content see chapter 9 for possible values

cc string 2 characters commercial code

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + desc + amount + currency + order_id + language + cc + verification code) where + means

concatenation

If successfully executed method returns JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

From now Merchant can charge clients card with sale method with sale_auth

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

7

bull sale

Method used to execute created sale with presale method Sale defined with sale_auth can be executed only once If

the method is called second time with the same parameters system returns sale actual status - in parameter status -

done for correct payment and declined for rejected payment In that case client card is not charged the second time

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string 40 characters sale authorization ID

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1) hash_alg

(method + cli_auth + sale_auth + verification code) where + means concatenation

Passed cli_auth has to match with cli_auth used while creating sale in presale method

If processed correctly method returns the following parameters in JSON format (green values are present with correct

or done status red for declined)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created sale ID

cli_auth string 40 characters client authorization ID

currency numeric 3 digits currency see chapter 9 for more details

amount numeric (2 format) amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclineddone)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(sale_auth + cli_auth + currency + amount + sale_date+ status + reason + verification code)

Test mode notice

Method will return correct status with 50 probability The same concerns declined status In this

case reason value is also randomly picked

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

6

bull presale

Method used to create new sale for payment on demand It can be called after receiving notification with cli_auth

(see communication schema in register_sale method) It cannot be used if onetimer option was sent in register_sale or

client has unregistered (by link in email sent by tpaycom after registering clientrsquos credit card or by API)

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits sale currency default value from account

settings if not set see chapter 9 for possible

values

order_id String up to 40 characters value from partner system

language string 2 characters language parameter used for confirmation

email content see chapter 9 for possible values

cc string 2 characters commercial code

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + desc + amount + currency + order_id + language + cc + verification code) where + means

concatenation

If successfully executed method returns JSON formatted answer

Parameter Type

result string here 1

sale_auth string 40 characters

Output example

result1sale_auth388bfd88c893272a8a961f80d28599ae275c819c

From now Merchant can charge clients card with sale method with sale_auth

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

7

bull sale

Method used to execute created sale with presale method Sale defined with sale_auth can be executed only once If

the method is called second time with the same parameters system returns sale actual status - in parameter status -

done for correct payment and declined for rejected payment In that case client card is not charged the second time

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string 40 characters sale authorization ID

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1) hash_alg

(method + cli_auth + sale_auth + verification code) where + means concatenation

Passed cli_auth has to match with cli_auth used while creating sale in presale method

If processed correctly method returns the following parameters in JSON format (green values are present with correct

or done status red for declined)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created sale ID

cli_auth string 40 characters client authorization ID

currency numeric 3 digits currency see chapter 9 for more details

amount numeric (2 format) amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclineddone)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(sale_auth + cli_auth + currency + amount + sale_date+ status + reason + verification code)

Test mode notice

Method will return correct status with 50 probability The same concerns declined status In this

case reason value is also randomly picked

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

7

bull sale

Method used to execute created sale with presale method Sale defined with sale_auth can be executed only once If

the method is called second time with the same parameters system returns sale actual status - in parameter status -

done for correct payment and declined for rejected payment In that case client card is not charged the second time

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string 40 characters sale authorization ID

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1) hash_alg

(method + cli_auth + sale_auth + verification code) where + means concatenation

Passed cli_auth has to match with cli_auth used while creating sale in presale method

If processed correctly method returns the following parameters in JSON format (green values are present with correct

or done status red for declined)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created sale ID

cli_auth string 40 characters client authorization ID

currency numeric 3 digits currency see chapter 9 for more details

amount numeric (2 format) amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclineddone)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(sale_auth + cli_auth + currency + amount + sale_date+ status + reason + verification code)

Test mode notice

Method will return correct status with 50 probability The same concerns declined status In this

case reason value is also randomly picked

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

8

bull refund

Method used to transfer money back to the client The refund can reference to chosen sale (sale_auth) or directly to

client (cli_auth) In both cases amount is adjustable in parameter amount If only cli_auth is sent amount parameter is

required if sale_auth is passed amount and currency is not necessary - system will take default values from the

specified sale With sale_auth refund can be made only once

Request uses the following parameters (red are obligatory and some black also as described above)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID

sale_auth string up to 64 characters sale authorization ID

desc string up to 128 characters sale description

amount numeric (2 format) refund amount

currency numeric 3 digits refund currency

language string 2 characters language parameter used for confirmation email

content see chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code) where +

means concatenation

If processed correctly method returns the following parameters in JSON format (green parameters are present with

correct status red one with declined status)

Parameter Format Description

result string 1 character Set to 1 if request correctly processed

test_mode string 1 character carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40 characters created refund ID

sale_ref string 40 characters sale ID reference (if exists)

order_id string up to 40 characters Merchant optional value present if sale_ref is set

order_id refers to sale identified by sale_ref ID

cli_auth string 40 characters client authorization ID sent if onetimer option was

not set when creating client and client was not

unregistered

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits currency code see chapter 9 for more details

amount numeric (2 format) refund amount with sale_auth cannot be larger

than twice of reffered sale

date string YYYY-MM-DD HHmmss date of accountingunregistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

9

status string Payment processing status (correct declined)

reason string 2 characters reason of rejection (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code) Parameter status is randomly picked in test mode

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

10

bull securesale

This method allows Merchant to host payment form on his website and perform sale without any client redirection to

tpaycom system Securesale method supports 3-D Secure which is an additional security layer for

online credit and debit card transactions This approach requires special security considerations We support secure

communication by encrypting card data (card number validity date and cvvcvs number) on client side (javascript)

with Merchants public RSA key and send it as one parameter (card) to our API gate A valid SSL certificate on domain

is required Application flow is presented below for clarification

1 Generate webpage with your public RSA key in javascript

2 While sending payment form insert new input with encrypted card data using your public key clear inputs with card

data so only encrypted data will be sent and submit form

3 In backend prepare parameters and use securesale method

4 Inform client about payment result

Card cipher is made from string

card number|expiry date(MMYY or MMYYYY)|cvv or cvc|host

eg 1234567891234567|0517|123|httpsmerchantwebsitecom

We have published code samples libraries and instructions to give some insights on the process Please take a look

at chapter 10 to see how it works out of the box and start fast implementing your integration The library used in

example has limit of 117 input characters for encryption

Method uses the following parameters

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

card string encrypted client card data

name string up to 64 characters client name

email string up to 64 characters client email

desc string up to 128 characters sale description

amount numeric (2 format) sale amount

currency numeric 3 digits currency code see chapter 9

order_id String up to 40 characters value from partner system

onetimer numeric 1 digit eg

onetimer=1

Flag describing whether save client card data

for future processing or not if parameter was

sent system will not register client and does

not return cli_auth (no on demand payment

will be possible)

language string 2 characters language parameter see chapter 9

cc string 2 characters commercial code

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

11

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card

+ name + email + desc + amount + currency + order_id + onetimer + language + cc + enable_pow_url +

verification code) where + means concatenation

There are two ways for performing payment

a) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

12

b) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

13

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

14

bull deregister

Method used to deregister client card data from system Client can also do it himself from link in email after payment

- if onetimer was not set - in that case system will sent notification (see chapter 6) After successful deregistration

Merchant can no more charge clients card

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

cli_auth string 40 characters client authorization ID from notifications

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + cli_auth + language + verification code) where + means concatenation

If input parameters are correct and client was deregistered method returns the following parameters in JSON format

Parameter Value

result 1

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

15

bull visacheckout_prepare

Method used to prepare Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter used in email template see

chapter 9 for possible values

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + verification code) where + means concatenation

If processed correctly method returns the following parameters in JSON format

Green values are present only when Visa Checkout data is correct

Parameter Format Description

result string 1 character set to 1 if request correctly processed

summary_data array Visa Checkout Summary

Payment Data format

summary Visa Checkout data connected with

passed Call Id

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

16

bull visacheckout_finish

Method used to finish Visa Checkout payment

Request uses the following parameters (red are obligatory)

Parameter Format Description

api_password string up to 40 characters API password set in Merchant panel

method string one of available method name

call_id string Visa Checkout Call Id

language string 2 characters language parameter see chapter 9

enable_pow_url Numeric 1 digit eg

enable_pow_url=1

If parameter was sent system will redirect a

cutomer to the merchant site after payment

1 ndash redirect Adress is set in Merchant Panel

summary_data array Visa Checkout

Summary Payment Data

format

Modified summary_data parameter received

from visacheckout_prepare Can be used

when the total amount or other parameters

changea in the order process

sign string 40-128 characters message digest

Sign is calculated from cryptographic hash function set in Merchantrsquos Panel (default SHA-1)

hash_alg (method + call_id + language + enable_pow_url + verification code) where + means

concatenation

summary_data has format compliant with Visa Checkout Summary Payment Data

Itrsquos structure is described in Visa Checkout documentation at

httpsdevelopervisacomproductsvisa_checkoutguidesextracting-consumer-data

The example table with this format can be found at

httpsdevelopervisacomproductsvisa_checkoutreferencevisa_checkout__get_payment_data_api

Below is the example

creationTimeStamp 1397847423768

partialShippingAddress

countryCode US

postalCode 94404

paymentInstrument

billingAddress

Code US

city Foster City

firstName Joe

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

17

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

binSixDigits 371449

cardArts

cardArt [

baseImageFileName httpspng

height 50

width 77

]

cardFirstName Joe

cardLastName Tester

expirationDate

month 10

year 2015

expired false

id

issuerBid null

lastFourDigits 1221

nameOnCard Joe Tester

nickName

paymentType

cardBrand VISA

cardType CREDIT

verificationStatus VERIFIED

paymentRequest

currencyCode USD

customData

nvPair [

name customName1

value customValue1

name customName2

value customValue2

]

discount 5

giftWrap 10

merchantRequestId 898

misc 5

orderId testorderID

promoCode testCampaignId

shippingHandling 5

subtotal 80

tax 5

total 100

riskData

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

18

advice Unavailable

avsResponseCode Y

cvvResponseCode M

score 0

shippingAddress

city Foster City

countryCode US

firstName Joe

id =

lastName Tester

line1

personName Joe Tester

postalCode 94404

stateProvinceCode CA

verificationStatus NOT_VERIFIED

userData

encUserId

userEmail Checkout094192gmailcom

userFirstName Checkout

userFullName Checkout Team

userLastName Team

userName 7084410557

When some data change between visacheckout_prepare and visacheckout_finish you should sent

the changed data with the summary_data table You can only send to tpaycom the data that

actually changes (ie only the amount ) but you need to send it in the summary_data json

structure Other fields if not changed donrsquot have to be sent

There are two ways for performing payment

c) Pay by card without 3D- Secure

If input parameters are correct request is processed correctly and the entered card doesnt have the 3D-Secure

option enabled method returns the following parameters in JSON format

Green color means that parameter is present only with correct status

red one only with declined status

Parameter Format Description

result string 1 character Set to 1 if request correctly processed however

status of payment can differ from correct see

status parameter

test_mode string 1 character optional set to value of 1 if account is in test

mode Otherwise test_mode is not present

sale_auth string 40 characters created sale ID

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

19

cli_auth string 40 characters optional client authorization ID present if

onetimer was not send

card string 8 characters shortcut for client card number eg 5678

currency numeric 3 digits sale currency code

amount numeric (2 format) sale amount

date string YYYY-MM-DD HHmmss date of payment

status string payment status (correctdeclined)

reason string 2 characters reason of rejection code (see chapter 8)

sign string 40-128 characters message digest

sign = hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + reason + verification

code)

Test mode notice

You should pass the card number 4111 1111 1111 1111 Other card data can be fake (cvccvv

expiry date) Method will return correct status if year of card valid date is less then (now(year) + 10)

otherwise declined status outputs Error appears if year will be greater than (now(year) + 15) or

expiry date will be in the past

d) Pay by card with 3D-Secure

If input parameters are correct request is processed correctly and the card has enabled the 3D-Secure method

returns the following parameter in JSON format

Parameter Format Description

3ds_url string up to 120 characters Unique link to 3D- Secure authentication

An example 3ds url is presented below

httpscardstpaycomtdsphpauth=2587bf3a98dfa699ef9d01eba38359b7

bull The best way to implement 3DS is to open a link to 3D-Secure authentication in new window If this

method is used parameter lsquoenable_pow_urlrsquo should be sent with value 1 After a correct authorization a

customer will be redirected to the Merchantrsquos Site Return URL is set in Merchantrsquos Panel

bull Do not use an inline frame to implement the 3D-Secure authentication on Merchantrsquos Site In this case some

banks can block 3DS authorization

After positive client payment system sends notification to Result URL set in Merchantrsquos Panel

All parameters are described in the table

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

20

Parameter Format Description

type string sale

test_mode string 1 character carry value of 1 if account has test mode otherwise

parameter not sent

sale_auth string 40 characters created sale ID

order_id string up to 40

characters

Merchant optional value

cli_auth string 40 characters client authorization ID sent if onetimer option is not set

when creating client and client has not been deregistered

(himself or by api)

card string 8 characters shortcut for client card number eg 5678

currency numeric currency code see chapter 9

amount numeric (2

format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + test_mode + sale_auth + order_id + cli_auth + card + currency + amount + date + status + verification

code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

Response for correct notification processing

result1

Test mode notice

In test mode transaction panel offers choice of system answer for transactions with 3D-Secure

authentication You can choose to accept or decline payment to test all paths

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

21

bull check

Method which can be used to ping our API server to establish a monitoring service on Merchant system

To use it just call our API directly with the following parameters

Parameter Format Description

api_password string Merchant API password

method string Value in this case should be ldquocheckrdquo

Method returns

ldquoresultrdquordquo1rdquo

when tpaycom cards API is operating correctly

Otherwise it returns errors described in documentation

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

22

Notifications

There are few cases when system sends notification to Result URL set in Merchantrsquos Panel

bull after first client payment (after using register_sale method)

bull after sale refund and deregister method if triggered not through API (eg through Merchantrsquos Panel)

Currently notifications are sent only for correct payments and successful deregitrations

In table below there are specified available parameters for different methods Method sale and register_sale has the

same column - sale

Parameter Format Description sale refund deregister

type string method type (sale refund deregister)

test_mode string 1

character

carry value of 1 if account has test mode

otherwise parameter not sent

sale_auth string 40

characters

created salerefund ID

sale_ref string 40

characters

sale ID reference (if exists)

order_id string up to 40

characters

Merchant optional value present in refund

if sale_ref is set order_id refers to sale

identified by sale_ref ID With sale order_id

refers to sale_auth ID

cli_auth string 40

characters

client authorization ID sent if onetimer

option is not set when creating client and

client has not been deregistered (himself or

by api)

card string 8

characters

shortcut for client card number eg

5678

currency numeric currency code see chapter 9

amount numeric

(2 format)

amount

date string YYYY-

MM-DD

HHmmss

date of accountingderegistering

status string Payment processing status one of (correct

declined)

sign string 40-128

characters

message digest

Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1)

hash_alg(type + tes_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status +

reason + verification code)

The parameters are sent with POST method Merchant system have to response to notification by printing array in

JSON format

6

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

23

Response for correct notification processing is

result1

Response in case of error occurs is

result0errorerr_desc

In err_desc (optional) Merchant can put error description from his system

If Merchantrsquos system response will be different than the ones presented above tpaycom will repeat sending the

notifications (up to 12 times)

Because of that it is crucial to always check if sale_auth was already processed in Merchantrsquos database (for

salerefund)

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

24

Error codes and response format

If any error occurs in method request to cards API the following array in JSON format will be produced

Parameter Description

result set to 0

err_code one of the codes in table below

err_desc optional string gives additional details about error

For example

result0err_code9err_descgeneral

The err_code can take the following values

Error code Error description

1 account disabled

2 account not fully configured

3 method call limit exceeded

4 incorrect parameters

5 incorrect sign

6 client not found

7 specified method not found

8 client card expired

9 processing error

10 authorization error

11 service temporarily unavailable

12 client denied permission to charge his card

13 encrypted card data cannot be used again with securesale

14 incorrect card encryption format

15 denied parameters - check documentation

16 amount exceeded limit

17 action already in progress - can happen in concurrent sale

method with the same parameters This error means bad

Merchant application design and needs to be fixed

Error response is printed only when provided API key and API password If these two parameters are incorrect

or API calls limit was reached empty answer will be produced with http 404 header

Notice

Error response for any method comes from tpaycom system and means an error occurred in preprocessing

For methods with status output parameter (correctdeclined) and result=1 request was processed by Elavon

and acceptedrejected by their system

7

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

25

Rejection codes

Error code Error description

00 Response block on Elavon level (unexpected error)

0102 Vocal authorization required

03 Invalidinsufficient card data

0407 Card reserved

05135761 Payment type MOTOeCommerce not activated or limit exceeded

12 Invalid transaction

14 Invalid card number

30 Invalid data format of authorization message

41 Card marked as lost

43 Card marked as stolen

51 Insufficient funds

54 Card outdated

59 Fraud suspicion

65 Card usage limit exceeded

78 New not activated card

82N7 Invalid CVV code

99 Invalid API password

8

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

26

Available currencies and languages

Currencies

Value Currency name

985 PLN

826 GBP

840 USD

978 EUR

203 CZK

578 NOK

208 DKK

752 SEK

756 CHF

Languages

Value Language

pl polish

en english

es spanish

it italian

ru russian

fr french

9

10

11

12

13

14

9

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0

Krajowy Integrator Płatności Spoacutełka Akcyjna z siedzibą w Poznaniu przy ul Św Marcin 736 wpisana do rejestru przedsiębiorcoacutew Krajowego Rejestru Sądowego prowadzonego

przez Sąd Rejonowy Poznań ndash Nowe Miasto i Wilda w Poznaniu VIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem KRS 0000412357 numer NIP

7773061579 REGON 300878437 kapitał zakładowy 4 798 50000 PLN (wpłacony w całości)

Card payments integration

27

15

Additional resources

- integrationzip - simple website demonstrating directsale method and using library Merchantclassphp

- Merchantclassphp - (included in integrationzip) library wrapping tpaycom cards API (php language) -

cards_directsalepdf - instruction regarding integrationzip

- PHP libraries available on httpsgithubcomtpay-comtpay-php

10

0