Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Document Control
File Name 2C2P-AIRLINE PAYMENT V1.5.4
Author 2C2P
Version History
Document Date Comments/Reasons
Version
1.0 19 September 2013 Draft
1.3 21 May 2014 Added complete xml
1.4 27 May 2014 Correct the xml syntax and inquiry responses and api
response code list
1.5 05 Jun 2014 Correct the Mandatory/Optional and more explanation
on the amount format, Standardized Response
Signature, Added PSPAuthorizedDateTime in Authorize
Response
1.5.3 11 Feb 2015 Add Backend_URL in the authorization request
1.5.4 12 Feb 2015 Add 123 agent and channel map
1.5.5 28 July 2016 Add UPI (CUP), Alipay, MPU payment type
1.5.6 13 Sep 2016 Add LINE
2
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
Contents
1. Authorization ..................................................................................................................... 5
1.1 Authorization request message .......................................................................................... 5
1.1.1 Authorization request example XML ...................................................................................... 9
1.2 Authorization response message ........................................................................................... 12
1.2.1 Authorization response example XML ................................................................................. 14
2. Settlement ....................................................................................................................... 15
2.1 Settlement request message .................................................................................................. 15
2.1.1 Settlement request example XML........................................................................................ 16
2.2 Settlement response message ............................................................................................... 17
2.2.1 Settlement response example XML ..................................................................................... 18
3. Void ................................................................................................................................ 19
3.1 Void request message ........................................................................................................... 19
3.1.1 Void request XML example ................................................................................................. 20
3.2 Void response message ......................................................................................................... 21
3.2.1 Void response XML example............................................................................................... 22
4. Inquiry Message .............................................................................................................. 23
4.1 Inquiry request message ........................................................................................................ 23
4.1.1 Inquiry request XML example .............................................................................................. 23
4.2 Inquiry response message ............................................................................................... 24
4.2.1 Inquiry response message (Authorization) .................................................................... 24
4.2.2 Inquiry Response XML (Authorization) example............................................................ 26
4.2.3 Inquiry Response Message (Settle) .............................................................................. 26
4.2.4 Inquiry Response XML (Settle) example ....................................................................... 28
4.2.5 Inquiry Response Message (Void) ................................................................................ 28
4.2.5 Inquiry Response XML (Void) example ......................................................................... 29
5. Sending the request message .................................................................................. 30
5.1 Sending request message (Redirect / 3DS Non-UI) .......................................................... 30
5.2 Receiving response message (Redirect/3DS NonUI) ........................................................ 31
5.3 Sending and receiving the message (non 3DS, non UI) .................................................... 33
Appendix: A-API URL .......................................................................................................... 35
Appendix: B-API Response Code........................................................................................ 36
Appendix: C Issuer Response Code ................................................................................. 37
Acquiring Host Response Code ................................................................................................... 37
123 Response Code .................................................................................................................... 39
Appendix: D 123 Agent Codes ......................................................................................... 40
3
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
4
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
1. Authorization
1.1 Authorization request message
Mandatory /
Data Element Name Data Type Length Comments
Optional
Example 1.0 as current
Version Varchar 5 M
API version
RequestDateTime Varchar 12 M Format :
yyMMddHHmmss
ProcessCode Varchar 1 M A : Authorize
OfficeID Varchar 50 M
Unique invoice number,
InvoiceNo Varchar 50 O If AIRLINE does not
send, Auto generate
FirstBoardingPoint Varchar 50 O
PNRCode Varchar 6 O
CC=Credit Card
Amex = Amex Card
PaymentType Varchar 50 O 123=Alternative Cash
Pay
UPI = China Union Pay
AP = Alipay
MPU = MPU Card
LinePay = LINE
5
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
Authorization amount
including leading zero.
The decimal point is
based on the currency
Amount Varchar 12 M exponent in ISO4217.
(eg. If currency is THB,
exponent is 2 so the last
2 digits is decimal point.)
6
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
(THB = Baht)
7
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
M = Merchant pay
interest
8
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
9
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
<ItineryList>
<Itinery FLIGHT_NUMBER="" AIRPORT_CODE="">
<Segment No="1" AIRLINECODE="" AIRLINENAME="" BDATE="" BLOCATIONCITYNAME=""
BLOCATIONCODE="" BLOCATIONCOUNTRYNAME=""
BLOCATIONNAME="" BLOCATIONSTATENAME="" BTERMINAL="" CABIN="" EDATE=""
ELOCATIONCITYNAME="" ELOCATIONCODE="" ELOCATIONCOUNTRYNAME=""
ELOCATIONNAME="" ELOCATIONSTATENAME="" EQUIPMENTCODE="" ETERMINAL=""
FLIGHTNUMBER="" FLIGHTTIME="" OTHERAIRLINECODE="" OTHERAIRLINENAME=""
STATUSNAME="" BOOKINGCLASS=""/>
</Itinery>
<Itinery FLIGHT_NUMBER="" AIRPORT_CODE="">
<Segment No="" AIRLINECODE="" AIRLINENAME="" BDATE="" BLOCATIONCITYNAME=""
BLOCATIONCODE="" BLOCATIONCOUNTRYNAME="" BLOCATIONNAME=""
BLOCATIONSTATENAME="" BTERMINAL="" CABIN="" EDATE="" ELOCATIONCITYNAME=""
ELOCATIONCODE="" ELOCATIONCOUNTRYNAME="" ELOCATIONNAME=""
ELOCATIONSTATENAME="" EQUIPMENTCODE="" ETERMINAL="" FLIGHTNUMBER=""
FLIGHTTIME="" OTHERAIRLINECODE="" OTHERAIRLINENAME="" STATUSNAME=""
BOOKINGCLASS=""/>
</Itinery>
</ItineryList>
<Signature></Signature>
</apiRequest>
<apiRequest>
<Version>1.0</Version>
<RequestDateTime></RequestDateTime>
<ProcessCode>A</ProcessCode>
<OfficeID>0001199</OfficeID>
<InvoiceNo>11122912121</InvoiceNo>
<FirstBoardingPoint>BKK</FirstBoardingPoint>
<PNRCode>AABBCC</PNRCode>
<PaymentType>123</PaymentType>
<Agent123>[Appendix D]</Agent123>
<Channel123>[Appendix E]</Channel123>
<PaymentExpiry>2015-03-15 23:59:59 </PaymentExpiry>
<PaySlipInfo></PaySlipInfo>
<UserDefine1> </UserDefine1>
<UserDefine2></UserDefine2>
<UserDefine3></UserDefine3>
<UserDefine4></UserDefine4>
<UserDefine5></UserDefine5>
<Amount>000000012500</Amount>
<CurrencyCode>764</CurrencyCode>
<PassengerEmail>email@email.com</PassengerEmail>
<MobilePhone>0811112222</MobilePhone>
<CardNumber></CardNumber>
<CardExpiry></CardExpiry>
<CVV></CVV>
<Confirmation_URL></Confirmation_URL>
<Cancellation_URL></Cancellation_URL>
<Backend_URL></Backend_URL>
<CardholderIPAddress>10.10.0.0</CardholderIPAddress>
<IssuingBankCountry>TH</IssuingBankCountry>
<IssuingBankName></IssuingBankName>
11
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
<CardholderName> </CardholderName>
<StoreCard>N</StoreCard>
<StoreCardUniqueID></StoreCardUniqueID>
<IppTransaction></IppTransaction>
<InstallmentPeriod></InstallmentPeriod>
<InterestType></InterestType>
<PromotionCode></PromotionCode>
<SessionID></SessionID>
<Language></Language>
<EXTERNAL_ID></EXTERNAL_ID>
<EXTERNAL_ID1></EXTERNAL_ID1>
<EXTERNAL_ID2></EXTERNAL_ID2>
<EXTERNAL_ID3></EXTERNAL_ID3>
<EXTERNAL_ID4></EXTERNAL_ID4>
<EXTERNAL_ID5></EXTERNAL_ID5>
<EXTERNAL_ID6></EXTERNAL_ID6>
<EXTERNAL_ID7></EXTERNAL_ID7>
<EXTERNAL_ID8></EXTERNAL_ID8>
<EXTERNAL_ID9></EXTERNAL_ID9>
<Users>
<User TravID="" Title="" FirstName="" LastName="" Email="" MobilePhone="" HomePhone=""
BusinessPhone=""/>
<User TravID ="" Title="" FirstName="" LastName="" Email="" MobilePhone="" HomePhone=""
BusinessPhone=""/>
</Users>
<ItineryList>
<Itinery FLIGHT_NUMBER="" AIRPORT_CODE="">
<Segment No="1" AIRLINECODE="" AIRLINENAME="" BDATE="" BLOCATIONCITYNAME=""
BLOCATIONCODE="" BLOCATIONCOUNTRYNAME=""
BLOCATIONNAME="" BLOCATIONSTATENAME="" BTERMINAL="" CABIN="" EDATE=""
ELOCATIONCITYNAME="" ELOCATIONCODE="" ELOCATIONCOUNTRYNAME=""
ELOCATIONNAME="" ELOCATIONSTATENAME="" EQUIPMENTCODE="" ETERMINAL=""
FLIGHTNUMBER="" FLIGHTTIME="" OTHERAIRLINECODE="" OTHERAIRLINENAME=""
STATUSNAME="" BOOKINGCLASS=""/>
</Itinery>
<Itinery FLIGHT_NUMBER="" AIRPORT_CODE="">
<Segment No="" AIRLINECODE="" AIRLINENAME="" BDATE="" BLOCATIONCITYNAME=""
BLOCATIONCODE="" BLOCATIONCOUNTRYNAME="" BLOCATIONNAME=""
BLOCATIONSTATENAME="" BTERMINAL="" CABIN="" EDATE="" ELOCATIONCITYNAME=""
ELOCATIONCODE="" ELOCATIONCOUNTRYNAME="" ELOCATIONNAME=""
ELOCATIONSTATENAME="" EQUIPMENTCODE="" ETERMINAL="" FLIGHTNUMBER=""
FLIGHTTIME="" OTHERAIRLINECODE="" OTHERAIRLINENAME="" STATUSNAME=""
BOOKINGCLASS=""/>
</Itinery>
</ItineryList>
<Signature></Signature>
</apiRequest>
12
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
PSPAuthorizedDateTi
Varchar 12 O Format : yyMMddHHmmss
me
PaymentRef Numeric 20 O API Payment Reference Code
PaymentRefCode123 Varchar 12 O Payment.RefCode from 123
Card number (Full Card
CardNumber Varchar 19 M/O
Number)
CardExpiry Numeric 4 M/O Card expiry in MMYY format
Issuing bank country.
IssuingBankCountry Varchar 2 O Example: TH as Thailand
(following ISO 3166-1 alpha 2)
13
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
14
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
15
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
2. Settlement
16
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
<apiRequest>
<Version>1.0</Version>
<RequestDateTime></RequestDateTime>
<ProcessCode></ProcessCode>
<OfficeID></OfficeID>
<InvoiceNo></InvoiceNo>
<EpNumber></EpNumber>
<FirstBoardingPoint></FirstBoardingPoint>
<PNRCode></PNRCode>
<PaymentType></PaymentType>
<Agent123></Agent123>
<Channel123></Channel123>
<Amount></Amount>
<IssuerApprovalCode></IssuerApprovalCode>
<PaymentRef></PaymentRef>
<TicketNoList></TicketNoList>
<Signature></Signature>
</apiRequest>
17
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
A= Authorized
P = Payment Pending
S= Settled
Status Varchar 1 M
V=Voided
R=Rejected
F=Failed
PNRCode + Status +
PaymentRef + SettledAmount
+ IssuerResponseCode +
PSPProcessedDateTime
19
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
3. Void
20
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
<apiRequest>
<Version></Version>
<RequestDateTime></RequestDateTime>
<ProcessCode></ProcessCode>
<OfficeID></OfficeID>
<InvoiceNo></InvoiceNo>
<EpNumber></EpNumber>
<FirstBoardingPoint></FirstBoardingPoint>
<PNRCode></PNRCode>
<PaymentType></PaymentType>
<Agent123></Agent123>
<Channel123></Channel123>
<IssuerApprovalCode></IssuerApprovalCode>
<PaymentRef></PaymentRef>
<Signature></Signature>
</apiRequest>
21
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
22
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
23
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
4. Inquiry Message
24
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
25
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
26
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
PNRCode Varchar 6 O
CC=Credit Card
CC-VI, CC-CA, CC-JC
123 = Alternative Cash Pay
PaymentType Varchar 50 O
Amex = Amex Card
CP=ChinaPay
AP=AliPay
Agent123 Varchar 50 O Appendix D
Channel123 Varchar 50 O Appendix E
Appendix Host Response
IssuerResponseCode Numeric 2-3 O
Code
Issuer approval code for the
IssuerApprovalCode Varchar 6 O
authorization
CardNumber Varchar 16 M/O Credit Card Number (Full)
CardExpiry Varchar 4 M/O Card Expiry in MMYY format.
A= Authorized
P = Payment Pending
S= Settled
Status Varchar 1 M
V=Voided
R=Rejected
F=Failed
28
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
S= Settled
V=Voided
R=Rejected
F=Failed
Appendix Host Response
IssuerResponseCode Numeric 2-3 O
Code
Issuer Approval Code for
IssuerApprovalCode Varchar 6 O
Authorization
PaymentRef Varchar 20 O 2C2P PaymentRef/
TransactionRef returned from
AIRLINE Controller to
Confirmation_URL after Void.
PSPProcessedDateTi Numeric 3 O PSP Settlement DateTime in
me format of "yyMMddHHmmss"
Hash value computed by
HMACSHA1 with secret key
provided by 2C2P System.
Signature string: Version +
ResponseDateTime+
ProcessCode + OfficeID +
Signature Varchar 255 M
ApiResponseCode +
InvoiceNo + EpNumber +
PNRCode + Agent123 +
Channel123 + Status +
PaymentRef +
PSPProcessedDateTime
30
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
<Form method=post
action="URL here">
<input type="hidden" Name="apiRequest"
value="MIIGEwYJKoZIhvcNAQcDoIIGBDCCBgACAQAxggFAMIIBPAIBADAkMBYxFDASBgNVBAMTC1NpbmFwdElRIE
NBAgoeg+bBAAAAAAAMMA0GCSqGSIb3DQEBAQUABIIBAAcXZrZwmGdYyFKwfskyMzqoRCvMfmRlPoq7wauu/tNHtQg
5XSjAmrWEfu2qK0D41++uPL8urU7PUzXgGmQgMWsBQcUaF64kvbhuoYK8g7Q+b2jO5in09waRfXoJxlkE1g+5Ecwj
ZamIjrJQyX1+8sOtMRhSlEwQhkVInF77/4Q9UYpJiofegZJJn74XgG88YsCPjn1JggvTA6R2YWxofB50vh05yA8Ga
U1uQxiCQaxqWL+YcwOq//8vO0eBHbSamxg2m8/RqTWx+/7g/D8HSmSyE0QtKBa8dXQr6lcUiOxmJ2L+bo44fdcITB
R4oKQkkdeU/bSJ+W1z76qdXnfaxjkwggS1BgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECJ8mAU1aPOW3gIIEkOnpZ7l
He/pqaf3GxoWPXkLtUfnPN314BWmACdQOrgyJZKDdOruBMvp6Qix+0CCOJR365avc73cHW11pNNMdS5x86ab3Hj3n
BjtMXzz16xJI/NSBxpw0grGjEAJQYiP/i0ihTka5OP95n5n+quYtVn6vRoChx46uRibm8bnjv1UuEGfgVf21HJWpC
fMJ+WRr5XPhaQgU+rAA9M5Hn+8C4gyclHnVMzgzIdneIPBSPs3002Jo6rr6Tojitly/bx/rGeij46oYYWxlEUN5sK
LUBwl21GD5VdGCeKqAnCpRraa/SNfEJIXrblWrzVgMX1TxI6su8bo6qIiKWT4ZkaIqKxIYH8aCVhDxhBwfkvKUpqm
yQmPa4/+3VFNzNiDXvmFNMQOgTFP7WQsXykSPn1lAIIX1q+lWDhQGQ4wogfwM9s9m0FLrkGtisgJXmob2UaVMdv+R
xilr3Wzv8haSY7TcXCrzDXqYPHxDrTL5tZsim+Tno/IheQT40wtCKx8kDIbHcTNhfdk1cciRVK68790FXH8wPuWdN
VTA849OXILu92nZvVU93ODJ2PNXQ2wVscFXs3leVFaAW37qfQ4T8Yx8HZ2JOTIHflIt0LVoqmC6gUjTkjdkMOxaQi
gWM3KVV/iQxsF0s6ZCftEyzOOAirlineWsCY9RVEbQhMzFuW2dr0Te9Ezqw11gQ0ibkPy7dV03WL3PpNC+wg8tlQ2
lohzy
7EXNn2TuOaIAGBf4cOrR0n3DwiDOS2On6zQw6OF9haY61UxBirjUQP5wPAs6gzRsexAkraOgvxikjQRqrwqXpMhbh
wxcG3HcdH353kVt4OQvlKWAmSVettuO0X6t7gT9K61/qJ8TJimsNSEebJPZ90w0d4PdXb9TT2gZGv/pyMtzJkcz8f
yDz0jXzalKEvqAR8kSyNVhVQcQGlMjwbKfyS8S/dGGj1txfTCYV7Nigys4yE0Fg+n604rV1PxZLW0UY81uMasZPbw
PLRDgTTkpECELARjhiteamfmxfiqQEuL5GjOitNNWt8G7tS8+WGyxM4qdBJZZ2+QtQbhNyasPG5LnepFhg2f+mPC7
7Hl6TiUmyBMAxb8SUFRdaHZq6uMN6Ehil5dVuzf+0oaglpLSDUJReBbXjdpi2vJLcH3rM9ArR+0bHdyS3o7dSlxUV
vtQ9TEQmFvEoL2dMqAGUjAUD63E1tJzVWgGrZQtrhjMK/ASLtCCqnqRbn8N0G2I7ALPj+tWdsTLs+JIJeQqmK1H6U
K/Xv1qxNS22Zq908xb7ePcv9VCMNcxpOzApQie+faf6ANK4x6y9MYfaenrDrcBq95Md51nG/GnIQEflhIh+8NGx0v
KWpqOdZamq4lKlTuiMQ8HkgFV9jaHIYLJl5waVCf/RebX2oK2vXXR/W0u+nOOMCEbM6e7y52v/Kc+v/P3L5NFM9NQ
U6uouZOEkVqajdLyyU9rFhUaGUOsOTjgcOUTILhMSJLCNS32vpukwi5xoJkJTIeLi0D/9AI/A9jBCNTDCz8WqUN2D
9Z6EH4pBNPZbh5oN3Alpv07X4dFQcgpAMaDqR9g=">
<input type="submit" value="Send" name="submit" >
31
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
Step 1 => Receiving Payment Response: the payment processing system will
send back encrypted Payment Response XML message to the Confirmation_URL or *predefined
return URL using HTTP Form Post method. The form tag name of the encrypted payment response
will be apiResponse. If payment is failed/rejected/cancelled, 2c2p will redirect to Cancellation_URL.
The following is the example code snippet in C# on how to receive payment response from 2C2P
system.
string encryptedPaymentResponse = ;
encryptedPaymentResponse = Request.Form[apiResponse];
The following is the example code snippet in PHP on how to receive payment response from 2C2P
system.
$encryptedPaymentResponse = ;
$encryptedPaymentResponse = _REQUEST[apiResponse];
32
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.4
Step 2 => Decrypt the payment response using merchant's private key and interpret the result. The
following example use 2C2P .Net framework dll to decrypt the payment response.
In C#
string encryptedPaymentResponse =
MIIE2wYJKoZIhvcNAQcDoIIEzDCCBMgCAQAxggFAMIIBPAIBADAkMBYxFDASBgNVBAMTC1NpbmFwdEl
RIENBAgoeg+bBAAAAAAAMMA0GCSqGSIb3DQEBAQUABIIBAGfvpnQI07oTmL+Mmfdpf6ms+h+2w4+rs0k
q/8/U049Poy5aUl9mwwVKgx1OksFgsYj7+R7CrXR6MvK/P49eFl+wFVtHRS0VxfAQLo3ja+GpqRdMd2o
akkPVJ/AK1VWooli07pzDxdixjN5DDBuRH+mBrV+G1js8eymgpIx1PmNPL9zyGZmiXvurT3xg91amWJQ
/+bfJ2pmBBlMqs+cav5oTJ7v1eoQPzFK+8CvA+dSyZK7hSkGT1gciPVwhCQW7xAIfB/6tR0p2/hgZXlY
nZOn+PbNMozD1/pqPNQjnfW4WG9SsLPiplycLhF7fpJ3dch+RHhBPGkcw19Ow0SeS3TEwggN9Bgkqhki
G9w0BBwEwFAYIKoZIhvcNAwcECPkjkibE353SgIIDWGz3MSEQo0dBJd542O/O3R4Ro7MsK/DhKJyvHG8
aX1AJOYHcMe7XcFCH19jFZFiT0lPM11iHS+XJpz91lSZ8ZAhoaoKt0EbQhGqsQYL5tLOLKDdaJloonH9
SSTiFpTlPQlpRh/qBeBuDegCCxHGXhe4UkWlOds1vCWS+87uRr/+BpY7H5tAgJCXy22ScIDLjxgrYd4O
s4ax3h0Q7v3xkwrL4yTOwLx8dr0HcQRDdHecAjzeHqazig8kqFWKC0jrmBbCDQ2W7r6fFsIYeb6xZceH
fuCiMvPOeKOtjJgbA7rkWq/gaKpNuwE8b4PN2zazI3rANSpLwYSluN4FtN5wj+YivvplgTlhkFm8lGQo
V9hwUaSkJX2shi3yG/O1UjVZIXDtPF7aPPtVFkCjpQXwGkrFUX45XFHoWuI9ozSDd9wlXNwucc05wD9+
dHQChhlSqHkPEcoJ4fzn8PGBmJOCdLSxQ/omkGh52sH8vcOOZFH+vUTv0FwEUb7lpePKqC3xSivOXkU/
O68ttAUW40ZzQKWat9QOId9ij7LxklGXzbnt6F8fJx7TSezB5s6u2JjzoQkHS04NQ7l8fXFObzoL+j4q
LG6MSUxxuA/awL4wNGZLqZ9q2OMUHB9DQoAlSJ/cgdSq1jvmWBEV/vROcxvyaSNuZ8NsqSmsLvSEFeek
hqkCjxHDmHCl4SoQD2iLTBf8AuvJix5R+9sor4x3wMIqcsD72aPalrZOIc6DIbziz0DjZQ+UIjvs4STp
AirlinePhJuYmutd0Yk+CGNrXtM0zn+a9NLMooDYrOu0BpT3PlQeaFOILfMbckNbDmU8X6kx2cc4y48w2
aFtQ
R9QgVcvQ1n7K+JxEKVnpZKMRBs1bBtfd7gNOg59byWNa+JcAzA+2AHPMtKlFksevfGtYO64KwEaG1EIo
4wjJYJ+Czk1ScTvKjwhY2GgsJeyVCLQb3LF51P2EZoyA7zogC7mJJhO4Nksl1dScH/yo3B8fyQ6DcD20
gVySee1Q3Esd/SlgOgxRSG9xbx6lXgf1vEdpF5hCfnvH+hzynpUe1GY4CmHojLtY0YfwUdUq7EX7NChE
n7Gh2yfXSAz7WQM3KJwODYV05jhoH5jSslIrJQt1RzVkHuzS386MUvEhumKis/r0=;
In PHP
<?php
include('pkcs7.php'); //to use this library create a folder for temporary file
in the same location as pkcs7.php with named tmp.
//public and private keys
$publicKey = "demo2_2c2p.crt";
$privateKey = "demo2_2c2p.pem";
$privateKeyPass = "2c2p";
$encrypt_text = "encrypted message"; //message returned by 2c2p PGW //to
decrypt
$decrypted= $pkcs7-
>decrypt($encrypt_text,$publicKey,$privateKey,$privateKeyPass); echo
$decrypted;
?>
33
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
5.3 Sending and receiving the message (non 3DS, non UI)
Example in PHP
<?php
require("HTTP.php");
//POST TO PGW
$HTTP = new HTTP();
$result = $HTTP-
>post("http://demo2.2c2p.com/Payment.aspx","apiRequest=".$encrypted);
echo "result: ".$result;
?>
33
2015 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
HTTP.php
<?php
/**
* CURL POST
Class HTTP
{
function post($url,$fields_string)
{
//open connection
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
//execute post
$result = curl_exec($ch); //close connection
curl_close($ch);
return $result;
}
}
34
2016 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
35
2016 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
36
2016 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
38
2016 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
002 TIMEOUT
39
2016 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
40
2016 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
41
2016 2C2P Pte. Ltd. All Rights Reserved.
Payment Service API for Airlines
Document version: 1.5.5
42
2016 2C2P Pte. Ltd. All Rights Reserved.