ComNpay

API

Introduction

The web services available:
  • must be called in POST (Content-type x-www-form-urlencoded)
  • will return JSON formatted responses
API access rules :
  • please anticipate that ComNpay can add new fields to JSON responses
  • some API might need our permission to be used (payment/aliasDebit for example)

HTTPS/SSL

  • Web service calls must be encrypted using the TLSv1.1 or TLSv1.2 protocols. The SSLv2, SSLv3 and TLSv1.0 protocols are not authorized.
  • The authorized encryption algorithms (ciphers) are the following:
    • HIGH: high encryption cipher suites (Algorithms with encryption keys equal to or longer than 128 bits)
    • MEDIUM: medium encryption cipher suites
    • RSA
  • The following encryption algorithms should be prioritised:
    • TLS_RSA_WITH_AES_256_CBC_SHA
    • TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA

Payment

Debit

Debit Web service

https://secure.comnpay.com:60000/rest/payment/debit

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
transactionRef Customer reference number for the transaction Maximum length 40
cardType Type of card CB, VISA, MC
cardNumber Card number  
cardExpirationDate Card expiration date YYMM format
cvv Visual cryptogram  
amount Debit amount In cents
force3ds Forces or prevents use of 3DS 1 to force 3DS, 0 for the standard case (threshold, geo-filtering)
Origin Origin of payment (URL of your website) URL to be declared in your URL
ip Customer's IP address Used for geofilter
customer Customer / Buyer Form Example of a customer form

Finalize debit after 3DS authentication

Step 1:

3DS payment in web services starts as a "conventional" payment by calling the "payment/debit" API. 3DS triggering will be done depending on the threshold defined in your portal, or it can be forced using the force3ds parameter.

If 3D Secure interrogation is required (because of threshold or forcing), the payment response will contain:
  • The "actionCode" field with the value "AUTH_3DS_REQUISE"
  • The transaction.verifyEnrollment3dsActionUrl field with the URL to which the cardholder is to be redirected
  • The transaction.verifyEnrollment3dsMd and transaction.verifyEnrollment3dsPareq fields in order to push pareq and md information to the authentication page

Example:

{
    "ok":1,
    "message":"ok",
    "transaction":{
        "transactionId":2630,
        "amount":200,
        [...]
        "verifyEnrollment3dsMd":"fUebB6kN11L8qY2v2JeU",
        "verifyEnrollment3dsPareq":"mS2i8y6R1L60yX6aH3971qN9jX64VwxBbmM9bM4iN9lV7mL5fM4e56pLBeA5xC1wV0dM0lz5pV4jkM4Y6hJ0dOFaW6xE8dU9vDGi",
        "verifyEnrollment3dsActionUrl":"https://homologation.comnpay.com/3ds.html",
        "verifyEnrollment3dsMpi":"Y"
    },
    "responseCode":"200",
    "actionCode":"AUTH_3DS_REQUISE"
}

Step 2:

Then redirect your customer to the URL provided by the verifyEnrollment3dsActionUrl parameter, adding the following parameters to your POST request:
  • MD
  • PaReq
  • TermUrl: URL to which the customer will be redirected after 3DS authentication

Exemple :

<form action="https://homologation.comnpay.com/3ds.html"
        id="3ds" method="post">
 <input type="hidden" name="TermUrl"
        value="http://www.votresite.com/retour3ds.html"/>
 <input type="hidden" name="MD"
        value="fUebB6kN11L8qY2v2JeU"/>
 <input type="hidden" name="PaReq"
        value="mS2i8y6R1L60yX6aH3971qN9jX64VwxBbmM9b..."/>
</form>

Step 3:

During the redirection to your website, you will recover the MD and PaRes parameters in POST. These parameters must then be returned to ComNpay, while finalizing the payment:

https://secure.comnpay.com:60000/rest/payment/end3dsDebit

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
transactionRef Customer reference of the transaction  
pares Value of the “pares” field Returned in the form after 3DS authentication
md Value of the “MD” field Returned in the form after 3DS authentication

Create alias

Web service to create a card alias (simple print, without payment)

https://secure.comnpay.com:60000/rest/alias/create

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
cardType Type of card CB, VISA, MC
cardNumber Card number  
cardExpirationDate Card expiration date YYMM format
cvv Visual cryptogram  
origin Origin of payment (URL of your website) URL to be declared in your URL

Debit with alias

Web service for debiting an alias (see card holder).

https://secure.comnpay.com:60000/rest/payment/aliasDebit

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
transactionRef Customer reference number for the transaction Maximum length 40
alias Card alias  
cvv CVV of the card to ask the customer You do not have to store it on your application, but ask it to the customer
amount Debit amount In cents
force3ds Forces or prevents use of 3DS 1 to force 3DS, 0 for the standard case (threshold, geo-filtering)
origin Origin of payment (URL of your website) URL to be declared in your URL
ip Buyer's IP address Used by the geo-filtering module
customer Customer / Buyer Form Example of a customer form

Credits/Refunds

Web service for crediting an initial debit. The amount of the credit must be less than or equal to the initial debit. Several credits can be performed in a single transaction, if the total amount does not exceed the initial debit.

https://secure.comnpay.com:60000/rest/payment/refund

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
transactionRef Customer reference number for the transaction  
amount Credit amount In cents

Payment response

{
    "ok": 1,
    "message": "Paiement accepte",
    "transaction": {
        "transactionId": 6145,
        "amount": 1590,
        "ok": 1,
        "confirmed": 1,
        "cardAlias": "02EF4AFB171F94D2D560A2423BBBE306B0CBB6DE94686918BA0D0E54DB25635F",
        "cardEndDate": "1612",
        "cardTruncatedNumber": "111122XXXXXX4444",
        "cardType": "CB",
        "binCountryCode": "FR",
        "transactionDate": "20130628164913",
        "rejectDate": null,
        "responseCode": "200",
        "message": "Paiement accepte",
        "transactionRef": "1440685092164304",
        "type": "D",
        "ask3ds": 0,
        "auth3dsCode": null,
        "auth3dsMessage": null,
        "enrollment3dsCode": null,
        "enrollment3dsMessage": null,
        "askAutor": 1,
        "autorCode": "00",
        "autorNumber": "1234",
        "verifyEnrollment3dsMd": null,
        "verifyEnrollment3dsPareq": null,
        "verifyEnrollment3dsActionUrl": null,
        "verifyEnrollment3dsMpi": null,
        "source": "API",
        "origin": "mywebsite.com",
        "initLogin": 10000012345,
        "memo1Clic": false,
        "subAccount": null,
        "customer": {
            "road": null,
            "zipCode": null,
            "email": "tjanvier@comnpay.com",
            "lastName": null,
            "country": null,
            "firstName": null,
            "quality": null,
            "phone": null,
            "city": null,
            "meetingDate": null,
            "vatNumber": null,
            "fiscalCode": null
        },
        "payperlink": {
            "payperlinkId": "18542911b61b2701873acb9ae25790eb",
            "paymentType": "D",
            "beginDate": "20180704161544",
            "endDate": "20180704161852",
            "maxQuantity": 1,
            "language": null,
            "urlOk": null,
            "urlNok": null,
            "productReference": null,
            "productLabel": null,
            "amount": 14600,
            "customer": null,
            "creationDate": "20180704161544",
            "deferredPaymentDate": null,
            "suppressionDate": null,
            "nbPayments": 1,
            "template": null,
            "deadlinePeriod": null,
            "nextDeadlineDate": null,
            "deadlineFrequency": 0,
            "deadlineDay": 0,
            "timetableEndDate": null
        }
    },
    "responseCode": "200"
}

Duplicate tickets

Web services for publishing duplicate tickets in the formats:
  • HTML (character string)
  • PDF (file encoded in base 64)

https://secure.comnpay.com:60000/rest/receipt/getHtml

https://secure.comnpay.com:60000/rest/receipt/getPdfBase64

POST parameters, identical for the 2 web services:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
transactionRef Customer reference number of the transaction  

Return: character string (HTML text, or file encoded in base 64 for PDF)

Pre-authorization

What is pre-authorization?

This function lets you confirm the validity of a payment card and make sure the customer is solvent, without having debited their account.

The merchant can take 3 possible actions within the time imparted:
  • Actually debit the pre-authorized amount
  • Cancel the pre-authorization
  • Only use a portion of the amount

Opening a pre-authorization

https://secure.comnpay.com:60000/rest/preauthorization/open

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
preauthorizationRef Customer reference number for pre-authorization Maximum length 40
cardType Type of card CB, VISA, MC
cardNumber Card number  
cardExpirationDate Card expiration date YYMM format
cvv Visual cryptogram  
amount Pre-authorization amount In cents
origin Origin of payment (URL of your website) URL to be declared in your URL
ip Buyer's IP address Used by the geo-filtering module
customer Customer / Buyer Form Example of a customer form

Finalize preauthorization after 3DS authentication

Same way as the debit one, with the API:

https://secure.comnpay.com:60000/rest/preauthorization/end3ds

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
preauthorizationRef Customer reference number for pre-authorization  
pares Value of the “pares” field Returned in the form after 3DS authentication
md Value of the “MD” field Returned in the form after 3DS authentication

Opening a pre-authorization from a card alias

https://secure.comnpay.com:60000/rest/preauthorization/aliasOpen

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
preauthorizationRef Customer reference number for pre-authorization Maximum length 40
alias Card alias  
cvv Visual cryptogram Mandatory for 3DS authentication
amount Pre-authorization amount In cents
origin Origin of payment (URL of your website) URL to be declared in your URL
ip Buyer's IP address Used by the geo-filtering module
customer Customer / Buyer Form Example of a customer form

Closing a pre-authorization

https://secure.comnpay.com:60000/rest/preauthorization/close

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
fileNumber Pre-authorization case N° created Returned in the response of the opening web service
preauthorizationRef Customer reference number for pre-authorization Maximum length 40
amount Debit amount In cents. If 0, case is cancelled

Pre-authorization response

{
    "ok": 1,
    "message": "Paiement accepte",
    "preauthorization": {
        "preauthorizationId": 247,
        "fileNumber": "PA20150827000247",
        "amount": 1590,
        "status": "CLOSURE_OK",
        "cardAlias": "02EF4AFB171F94D2D560A2423BBBE306B0CBB6DE94686918BA0D0E54DB25635F",
        "cardEndDate": "1612",
        "cardTruncatedNumber": "111122XXXXXX4444",
        "cardType": "CB",
        "openDate": "20150827162645",
        "closureDate": "20150827162726",
        "autorCode": "00",
        "autorNumber": null,
        "message": "Paiement accepte",
        "responseCode": "200",
        "preauthorizationRef": "1440685605313683",
        "transactions": [
            {
                "transactionId": 6146,
                "amount": 1590,
                "ok": 1,
                "confirmed": 1,
                "cardAlias": "02EF4AFB171F9...D0E54DB25635F",
                "cardEndDate": "1612",
                "cardTruncatedNumber": "111122XXXXXX4444",
                "cardType": "CB",
                "transactionDate": "20150827162726",
                "message": "Paiement accepte",
                "responseCode": "200",
                "transactionRef": "1440685646812DEMOSI344",
                "type": "PA",
                "binCountryCode": null,
                "ask3ds": 0,
                "auth3dsCode": null,
                "auth3dsMessage": null,
                "enrollment3dsCode": null,
                "enrollment3dsMessage": null,
                "askAutor": 1,
                "autorCode": "00",
                "autorNumber": "1234",
                "verifyEnrollment3dsMd": null,
                "verifyEnrollment3dsPareq": null,
                "verifyEnrollment3dsActionUrl": null,
                "verifyEnrollment3dsMpi": null,
                "source": "API",
                "origin": "mywebsite.com",
                "subAccount": null
            }
        ],
        "subAccount": null
    },
    "responseCode": "200"
}

Pre-authorization status

List of possible pre-authorization statuses:
  • OPEN_OK: opening of pre-authorization accepted
  • OPEN_KO: opening of pre-authorization refused
  • CLOSURE_OK: closure of pre-authorization accepted
  • CLOSURE_KO: closure of pre-authorization refused (new attempt at closure permitted)
  • ABORT: pre-authorization aborted (by the merchant)

Payment in 3 installments

P3F research

Payment in 3 times research web service

https://secure.comnpay.com:60000/rest/pnfFile/find

POST parameters:

Parameter Description Commentary
serialNumber Serial N° of the virtual terminal  
key Security key  
fileNumber P3F file number Ex PNF2016041415997
transactionRef 1st transaction reference  
amount File total amount  
cardNumber Truncated card number  
status Folder status REFUSED/PENDING/EXPERTISE/ERROR/CLOSED/CANCELED
startDate Search start date Format yyyyMMddHHmmss (optional)
endDate Search end date Format yyyyMMddHHmmss (optional)
limit Limit of the number of transactions Ignored if <=0 (optional)
page Page N°, starting from 1 Ignored if <=0 (optional)

Réponse

{
    "nbPnfFiles": 1,
    "pnfFile": [
        {
            "fileNumber": "PNF2018071415445",
            "amount": 17980,
            "cardAlias": "02EF4AFB171F...B25635F",
            "cardEndDate": "2006",
            "cardTruncatedNumber": "111122XXXXXX4444",
            "entryDate": "20180714163358",
            "statusDate": "20180813164601",
            "status": "PENDING",
            "initLogin": null,
            "pnfTransactions": [
                {
                    "term": 1,
                    "amount": 5993,
                    "ok": 1,
                    "canceled": 0,
                    "cardAlias": "02EF4AFB171F...B25635F",
                    "cardEndDate": "2006",
                    "cardTruncatedNumber": "111122XXXXXX4444",
                    "cardType": "CB",
                    "plannedDate": "20180714163358",
                    "transactionDate": "20180714163517",
                    "message": "Paiement accepte",
                    "responseCode": "200",
                    "retries": 1
                },
                {
                    "term": 2,
                    "amount": 5993,
                    [...]
                },
                {
                    "term": 3,
                    [...]
                }
            ],
            "customer": {
                "email": "tjanvier@comnpay.com",
                [...]
            }
        }
    ]
}

Return codes

Code Description
000 Processing ok
001 Service unavailable
002 Invalid configuration
003 Data volume exceeded
004 Too many attempts
005 Required field missing
006 Unreadable file
007 Request out of time
008 Duplicate request
009 Invalid parameter
010 Access denied
011 IP denied
012 Account closed
013 Action prohibited
040 Unknown domain
070 Invalid cardholder data
200 Payment accepted
201 Service unavailable
202 Double transactionRef
203 Type of transaction invalid
204 Currency invalid
205 Amount invalid
206 Card alias unknown
207 Card refused
208 Card prohibited
209 Card invalid
210 Card expired
211 The expiry date of the card is invalid
212 The holder is not 3DS compatible
213 Card type invalid
214 Transaction unknown
215 Card on grey list
216 Card on black list
217 Maximum amount for virtual EPT reached
218 Guarantee refused
2181 Guarantee refused after examination
219 Guarantee examination in progress
220 No transaction in progress for the holder
221 Holder authentication refused
222 Holder not registered with 3DS
223 3DS in progress
224 3DS incident, information incomplete (md and/or pares missing)
225 An incident occurred during 3DS authentication
230 Auto return: technical incident
231 Auto return: customer prohibited
232 Auto return: bank refusal
233 CVV missing
240 Pre-authorization accepted
241 Case unknown
242 Closure prohibited
243 Case closed
244 Case cancelled
245 Closure amount incorrect
246 Double pre-authorization reference
250 PNF prohibited
251 Maximum number of outstanding PNFs reached
252 Maximum number of outstanding holder PNFs reached
253 PNF case unknown
254 Advance of funds already paid
255 Outstanding PNF amount reached
256 Outstanding holder PNF amount reached
257 PNF amount too high
261 Credit amount invalid
262 Maximum monthly credit reached
263 Daily balance insufficient
264 Credit period exceeded
270 Double token reference
271 Token unknown
272 Alias created
280 Session expired
281 Transaction canceled
282 Abandoned transaction
299 Transaction in progress
301 Maximum daily number of holder outstandings reached
302 Maximum daily amount of holder outstandings reached
303 IP BIN country inconsistent
304 Country BIN blocked
305 Country IP blocked
306 Excessive amount
307 Maximum daily number of outstandings reached
308 Maximum daily amount of outstandings reached
309 Maximum monthly number of holder outstandings reached
310 Maximum monthly amount of holder outstandings reached
311 Maximum monthly number of outstandings reached
312 Maximum monthly amount of outstandings reached
313 Period between holder transactions too short
314 Maximum number of outstandings per minute reached
315 Non-French card prohibited with ETerminal
320 Cardholder declined
321 Bin blocked
322 Daily maximum number transactions reached by IP
350 Domestic transfer amount reached
351 International transfer amount reached
352 Daily maximum amount of domestic transfers reached
353 Daily maximum amount of international transfers reached
354 Daily maximum number of domestic transfers reached
355 Daily maximum number of international transfers reached
356 Monthly maximum amount of domestic transfers reached
357 Monthly maximum amount of international transfers reached
358 Monthly maximum number of domestic transfers reached
359 Monthly maximum number of international transfers reached
360 Daily maximum amount of domestic transfers by IBAN reached
361 Daily maximum amount of international transfers by IBAN reached
362 Daily maximum number of domestic transfers by IBAN reached
363 Daily maximum number of international transfers by IBAN reached
364 Monthly maximum amount of domestic transfers by IBAN reached
365 Monthly maximum amount of international transfers by IBAN reached
366 Monthly maximum number of domestic transfers by IBAN reached
367 Monthly maximum number of international transfers by IBAN reached
501 Human verification in progress
602 Contact the card issuer
603 Acceptor invalid
604 Keep the card
605 Do not honor
607 Keep the card, special conditions
610 Partially approved (not authorized)
612 Transaction invalid
613 Amount invalid
614 ID cardholder invalid
615 Card issuer unknown
617 Client cancellation
619 Try transaction again later
620 Wrong answer (error in server domain)
624 Unsupported file update
625 Can't find the record within the file
626 Duplicate recording, old recording replaced
627 Edit error on file update field
628 File acces not allowed
629 File update impossible
630 Format error
631 ID acquirer unknown
633 Expiry date pass due
634 Fraud suspicion
638 Number attempts PIN code exceeded
641 Lost card
643 Stolen card
651 Insufficient funds or exceeded credit limit
654 Validity date of card expired
655 Wrong PIN
656 Card not in the file
657 Transaction not allowed for this cardholder
658 Prohibited transaction at terminal
659 Fraud suspicion
661 Withdrawal amount out of range
663 Security rules not respected
668 Response not received or received too late
675 PIN Number attempts exceeded
676 Cardholder complaint, please keep all related recording
690 Service is temporarily unavailable
694 Duplicate request
696 System malfunction
697 Timing of global monitoring
698 Server not available, please try again
699 Incident domain initiator
2001 Invalid sign date
2002 Invalid RUM
2003 Signature in progress
2004 Signature canceled
2005 Signature failed
2006 Unknown recycling
2007 Invalid recycling status
2008 Recycling refused
2009 Invalid IBAN BIC
2010 Technical reject
2011 Bad IBAN threshold
2012 Invalid ordering IBAN
2013 Unknown SDD
2014 Invalid ICS
2015 Invalid collection date
2016 Unusable bank details
2017 Closed account
2018 Opposition on account / Blocked account
2019 The account holder is a consumer
2020 Not allowed operation
2021 Invalid operation code
2022 Insufficient funds
2023 Duplicate
2024 Original operation already returned
2025 Invalid address
2026 Unrecognized transmitter
2027 By customer's order
2028 Duplicate
2029 Invalid Format (Ex MD03)
2030 Invalid SDD Type
2031 Positive response to Recall
2032 Fraudulent Origin Transfer
2033 Regulatory reason
2034 No authorization / No mandate
2035 Incorrect mandate data
2036 Contest debtor / Challenge of an authorized transaction
2037 Deceased holder
2038 By order of the client / Refusal of the debtor
2039 Reason not communicated
2040 No authorization
2041 Received wrongly because original operation not received
2042 Incorrect bank code / Bank ID
2043 Regulatory reason
2044 Regulatory reason
2045 Regulatory reason
2046 Regulatory reason
2047 Specific service
2048 Non-compliant SCT due to technical problem
2049 Time limit exceeded
2050 Unknown BIC
2500 Waiting validation
2501 To be validated by the head office
2502 Have refused by the head office

Standing orders

How do I place a standing order?

  1. Make the first payment via PSP (payment page) or a web service.
  2. Call the transaction search web service which will give you the alias created for the payment card.
  3. For the following payments, called the payment web service using the alias as the parameter and not the bank details (card number, expiry date, CVV).

Data dictionary

Please find below a list of spcific fields used in API mode :

Field Description Example/values
cardType Card type CB/VISA/MC/AMEX
origin Origin web site of the payment www.mywebsite.com
source Payment source API/PSP/VPI(eTerminal)
subAccount Payment target sub account (marketplace) SA000001
type Transaction type D/C/PA/P3F/ALS

Customer form

A customer form can be pushed to the payment API. It permits in particular:
  • To find the information of the customer on the portal AfonePayment (detail of an operation, exports Excel)
  • The automatic sending of the payment ticket to the mail address of the holder
{
            "customerRef":"YOURID-ABCD1234",
            "firstName":"Mary",
            "lastName":"Jonson",
            "email":"mjonson@yopmail.com",
            "road":"91 Western Road",
            "zipCode":"G1",
            "city":"Glasgow",
            "country":"United Kingdom",
            "phone":"01410000000",
            "meetingDate":"20160630180000"
    }
Field Description Max length
customerRef Unique customer reference 40
firstName First Name 100
lastName Name 100
email Email address 100
road Mailing Address 255
zipCode Postal code 10
city City 50
country Country 50
phone Telephone 20
meetingDate Appointment date 14 (format yyyyMMddHHmmss)

Tokenization

The use of this method allows you to set up the credit card entry on your site using javascript.

./static/tokenisation-en.gif

You can download an example of how to use this method

DOWNLOAD

Here's how this method works:

1-Generating a token

You must generate a token that results from the map information (API included in the example above)

https://secure.comnpay.com:60000/rest/token/create

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
cardType Type of card CB, VISA, MC
cardNumber Card number  
cardExpirationDate Card expiration date YYMM format
cvv Visual cryptogram  
origin Origin of payment (URL of your website) URL to be declared in your URL

Response

{
    "ok": 1,
    "message": "",
    "token": {
        "serialNumber": "VAD-111-111",
        "tokenRef": "TK1533224578211DEMO364",
        "cardExpirationDate": "1222",
        "cardType": "CB",
        "truncatedCardNumber": "111122XXXXXX4444"
    }
    "responseCode": "000"
}

2-Payment via token

On the server side, you have to finalize the payment thanks to this previously generated token (do not save the information of the card, only the token is necessary).

https://secure.comnpay.com:60000/rest/payment/tokenDebit

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
tokenRef Token previously generated  
transactionRef Customer reference number for the transaction Maximum length 40
amount Debit amount In cents
force3ds Forces or prevents use of 3DS 1 to force 3DS, 0 for the standard case (threshold, geo-filtering)
customer Customer / Buyer Form Example of a customer form

3bis-Preauthorization via token

Same way for preauthorization opening.

https://secure.comnpay.com:60000/rest/preauthorization/tokenOpen

POST parameters:

Parameter Description Comments
serialNumber Serial N° of the virtual terminal  
key Security key  
tokenRef Token previously generated  
preauthorizationRef Customer reference number for pre-authorization Maximum length 40
amount Debit amount In cents
force3ds Forces or prevents use of 3DS 1 to force 3DS, 0 for the standard case (threshold, geo-filtering)
customer Customer / Buyer Form Example of a customer form

Quick example: cURL query in PHP

cURL is a computer software project providing a library and command-line tool for transferring data using various
protocols.

The following example initializes the payment for an amount of 10.00 € on the 1111222233334444 card

Do not forget to replace the 'serialNumber' and 'key' fields with your payment identifiers

<?php
$webService = 'https://secure.comnpay.com:60000/rest/payment/debit';
$postFields = array(
    'serialNumber'       => 'VAD-111-111',
    'key'                => '6RLl4FlO2o4ZvAdflK2p',
    'transactionRef'     => 'test',
    'cardType'           => 'VISA',
    'cardNumber'         => '1111222233334444',
    'cardExpirationDate' => '2001',
    'cvv'                => '123',
    'amount'             => 1000,
    'force3ds'           => 0,
    'origin'             => 'http://docs.comnpay.com',
    'ip'                 => $_SERVER['REMOTE_ADDR'],
    'customer' => json_encode(array(
        "firstName" => "Jean",
        "lastName" => "Dupont",
        "email" => "jdupont@yopmail.com",
        "road" => "5 Avenue de la Republique",
        "zipCode" => "49100",
        "city" => "PARIS",
        "country" => "France",
        "phone" => "0606060606",
        "meetingDate" => "20200630180000"
    ))
);
$datasString = http_build_query($postFields);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $webService);
curl_setopt($ch,CURLOPT_POSTFIELDS, $datasString);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>

Connector / Client web service

Connectors enable you to implement payments quickly and easily from your information system.

Java

Download the zip file from this address:

DOWNLOAD
It contains:
  • The connection jar for ComNpay web services
  • The comnpay.properties configuration file which must be configured and added to your projects

comnpay.properties configuration:

./static/comnpay-properties.png

Java code implementation

PaymentRequest paymentRequest = new PaymentRequest();
PaymentResponse paymentResponse = paymentRequest.debit(
 "TESTREF000001", "CB", "1111222233334444", "2012", "123", 100);