[УКР](https://hackmd.io/rXZuYXYwQp2W-QffXO99yA) | ENG

:arrow_left: [Guide](https://hackmd.io/QA2NYRliRLGviJl5P4-ZCw)
# [10150/10051] Card-Phone-Card
*What is "Server-Server card payment" and how the sender is authenticated, see in the section "[Server-Server Card Payment](https://hackmd.io/83UDlVHPRf2CxEBCi6ECBg)".*
## Usage
The operation *"Card-Phone-Card"* contains two requests:
|OperationType |Usage |
|:----:|----|
|`10150`|Debiting of funds from the card.|
|`10051`|Crediting of funds to the specified card.|
The *"Card-Phone-Card"* operation is used to transfer funds from card to card if there is only the recipient's phone number.
For the operation of debiting from the card and holding funds in the Operator system the request [10150] is sent. After getting a successful response, the request [10051] is sent to credit funds to the specified card.
## [10150] Card Debit Request
*See the description of the "Partner", "KeyAES" and "Sign" attributes in the section "[General API Integration Information](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ)".*
### Data Structure
The Data structure for this operation is formed from the following parameters:
:::info
<details>
<summary>Data structure formation (examples are below)</summary>
<br>
~~~
{
"Sum": ,
"Currency": "",
"Exchange": "UAH",
"Phone": "",
"Email": "",
"SenderCard": {
"PAN": "",
"ExpMon": "",
"ExpYear": "",
"CVV": ""
},
"Transaction": {
"TransactionID": "",
"TerminalID": "",
"DateTime": ""
},
"BrowserData": {
"device": {
"channel": ""
},
"browserIP": "",
"browserTZ": ,
"browserLanguage": "",
"browserUserAgent": "",
"browserColorDepth": ,
"browserJavaEnabled": ,
"browserScreenWidth": ,
"browserScreenHeight": ,
"fraudhuntFingerprint": ""
}
}
~~~
</details>
:::
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
| `Sum` | Yes | Integer| Operation sum in kopecks. |1UAH=>`100`|
| `Currency` | Yes - paying in a currency different from UAH. | String | Currency *debit* code is an abbreviated currency designation described in the standard [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Non_ISO_4217_currencies) ("UAH", "GBP", "USD", etc.). |`UAH`|
| `Exchange` | Yes - paying in a currency different from UAH. | String | Currency *credit* code is an abbreviated currency designation described in the standard [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Non_ISO_4217_currencies) ("UAH", "GBP", "USD", etc). |`UAH`|
| `Phone` | Yes | String | Client phone number in format: "380xxxxxxxxxxxx". |`380679335544`|
| `Email` | No | String | Client email.|`index@gmail.com`|
|`SenderCard`^1^|Yes|Structure|Structure transmits sender's bank card data.|See example below.|
|`BrowserData`|No|Structure|Structure transmits browser data for *3DSecure 2.0*. See section ["BrowserData structure"](https://hackmd.io/83UDlVHPRf2CxEBCi6ECBg#%E2%80%9CBrowserData%E2%80%9D-structure).|See example in section ["BrowserData structure"](https://hackmd.io/83UDlVHPRf2CxEBCi6ECBg#%E2%80%9CBrowserData%E2%80%9D-structure).|
|`Transaction`|Yes|Structure|Structure transmits transaction data. See section "[Transaction Structure](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ?view#2-Data)".|See example below.|
^1^ **"SenderCard"** Structure Parameters:
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
| `PAN` | Yes | String[16] | Sender card PAN (bank card number). |`8888888888888888`|
|`ExpMon`|Yes|String[2]|Month of card validity. Parameter is aligned to 2 digits by the symbol "0".|`02`|
|`ExpYear`|Yes|String[2]|Last 2 digits of the card's expiration year. Parameter is aligned to 2 digits by the symbol "0".|`22`|
|`CVV`|Yes|String[3]|CVV card code.|`356`|
:::success
<details>
<summary>Example of "Data" structure</summary>
<br>
~~~md
{
"Sum": 8400,
"Email": "",
"Phone": "380637541064",
"Currency": "UAH",
"Exchange": "UAH",
"SenderCard": {
"CVV": "123",
"PAN": "8888888888888888",
"ExpMon": "10",
"ExpYear": "24"
},
"Transaction": {
"TerminalID": "1",
"TransactionID": "a9d47abd-ec4a-4305-94b4-fb9cbe5463ad"
}
}
~~~
</details>
:::
:::success
<details>
<summary>Example of request [10150]</summary>
<br>
~~~md
{
"Partner": {
"Locale": "uk",
"PartnerToken": "72a8ddb8-9145-4a41-af1a-8c48ecaa4be1",
"OperationType": 10150
},
"Data": "{\"Sum\": 8400, \"Email\": \"\", \"Phone\": \"380637541064\", \"Currency\": \"UAH\", \"Exchange\": \"UAH\", \"SenderCard\": {\"CVV\": \"123\", \"PAN\": \"8888888888888888\", \"ExpMon\": \"10\", \"ExpYear\": \"24\"}, \"Transaction\": {\"TerminalID\": \"1\", \"TransactionID\": \"a9d47abd-ec4a-4305-94b4-fb9cbe5463ad\"}}"
}
~~~
</details>
:::
## [10051] Card Credit Request
*See the description of the "Partner", "KeyAES" and "Sign" attributes in the section "[General API Integration Information](https://hackmd.io/ijxPm0xtTpycgTjuUNHQQ)".*
### Data Structure
The Data structure for this operation is formed from the following parameters:
:::info
<details>
<summary>Data structure formation (examples are below)</summary>
<br>
~~~
{
"OperationID": ,
"Phone": "",
"Email": "",
"RecipientCard": {
"PAN": ""
},
"Transaction": {
"TransactionID": "",
"TerminalID": "",
"DateTime": ""
},
"BrowserData": {
"device": {
"channel": ""
},
"browserIP": "",
"browserTZ": ,
"browserLanguage": "",
"browserUserAgent": "",
"browserColorDepth": ,
"browserJavaEnabled": ,
"browserScreenWidth": ,
"browserScreenHeight": ,
"fraudhuntFingerprint": ""
}
}
~~~
</details>
:::
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
|`OperationID`|Yes|Integer|The value of `OperationID` received in a successful response to the request [10150]. See above.|`62176291`|
| `Phone` | Yes | String | Client phone number in format: "380xxxxxxxxxxxx". |`380679335544`|
| `Email` | No | String | Client email. |`index@gmail.com`|
|`RecipientCard`|Yes|Structure|Structure transmits recipient's bank card data and consists of the field `PAN` (bank card number).|`8888888888888888`|
|`BrowserData`|No|Structure|Structure transmits browser data for *3DSecure 2.0*. See section ["BrowserData structure"](https://hackmd.io/83UDlVHPRf2CxEBCi6ECBg#%E2%80%9CBrowserData%E2%80%9D-structure).|See example in section ["BrowserData structure"](https://hackmd.io/83UDlVHPRf2CxEBCi6ECBg#%E2%80%9CBrowserData%E2%80%9D-structure).|
|`Transaction`|Yes|Structure|Structure transmits transaction data. See section "[Transaction Structure](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ?view#2-Data)".|See example below.|
:::success
<details>
<summary>Example of "Data" structure</summary>
<br>
~~~md
{
"Email": "",
"Phone": "380637541064",
"OperationID": 62176291,
"Transaction": {
"TerminalID": "1",
"TransactionID": "b2d5184b-dcee-4a83-8805-484dfecd0665"
},
"RecipientCard": {
"PAN": "4000000000000010"
}
}
~~~
</details>
:::
:::success
<details>
<summary>Example of request [10051]</summary>
<br>
~~~md
{
"Partner": {
"Locale": "uk",
"PartnerToken": "72a8ddb8-9145-4a41-af1a-8c48ecaa4be1",
"OperationType": 10051
},
"Data": "{\"Email\": \"\", \"Phone\": \"380637541064\", \"OperationID\": 62176291, \"Transaction\": {\"TerminalID\": \"1\", \"TransactionID\": \"b2d5184b-dcee-4a83-8805-484dfecd0665\"}, \"RecipientCard\": {\"PAN\": \"4000000000000010\"}}"
}
~~~
</details>
:::
## Response to requests [10150/10051]
*See the general information on the response structure formation in the section "[General API Integration Information](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ?view#Response-Structure)"*.
### Response Examples
:::success
<details>
<summary>Request successfully accepted and needs "3DS" verification</summary>
<br>
~~~md
{
"Code": 102,
"Message": "need3ds",
"Data": {
"OperationID": 62176291,
"3dsHtml": "<html page in base64 encoding>",
"OperationStatus": 2
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
:::success
<details>
<summary>Request successfully accepted and needs "OTP" verification</summary>
<br>
~~~md
{
"Code": 102,
"Message": "needOTP",
"Data": {
"OperationID": 62176291,
"otpJson": "<JSON structure as string>",
"OperationStatus": 3
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
:::success
<details>
<summary>Operation Successfully Completed</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done",
"Data": {
"OperationID": 62176291,
"OperationStatus": 10
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
:::success
<details>
<summary>Operation Failed</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done",
"Data": {
"OperationID": 62176291,
"OperationStatus": 21,
"Reason": 3
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
## Related Requests
[[10101] Card-Card](https://hackmd.io/VYlXRMiWRkimK0sxlTZ2BA)
[[10102/101023/101025] Card-Wallet](https://hackmd.io/MUZzd3mTRQeQfBsE-emVVQ)
[[10103] Card-IBAN of Individual](https://hackmd.io/9c9kaHeMTH-LiGf_mVWwpg)
[[101031] Card-IBAN of Legal Entity](https://hackmd.io/XQDv9qmoRiqFzfzcD0H1uA)
**Token Payment**
[[104021] Card Payment by Token](https://hackmd.io/I4FJ0d0eStuvfqG2YmS8IQ)
[[1040217] Bulk Card Payment by Token](https://hackmd.io/6h9zyYaBTwOLzzP8XJDrfg)
[[104121] Auto Debit by Token. MO/TO Operations](https://hackmd.io/X4ImobdtSJ-Hy1qM-p7PWA)
**Get Card Data**
[[20400/20410] Get Card Data by Phone Number](https://hackmd.io/Xd9OZWXARcSZRTCsu-1jrw)
[[20404] Get Card Data by Token](https://hackmd.io/PSdh1ldNSmmJMR4OIhM_-Q)
**Get Transaction Data**
[[20003] Get Operation Status](https://hackmd.io/_eAjmoG-QPWoWWmsLOGf1g)
[[20009] Get Limit for Operation [10101]](https://hackmd.io/rQ7epWnbQmG9kM0rFjUfhA)
[[20110] Get Card Data](https://hackmd.io/WruG7PGDRsuF0gL0Wl21bA)
## Reference Materials
General parameters of the XPAY system are given in the section ["Reference Materials"](https://hackmd.io/16yLv895Qo-FWTvrWWQwbg): operation types, payment types, response codes, operation status, reasons of operation rejection, etc.

:arrow_left: [Guide](https://hackmd.io/QA2NYRliRLGviJl5P4-ZCw)
:arrow_left: [General API Integration Information](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ)
<details>
<summary>XPAY Support</summary>
</br>
Phone: +38 093 891 92 00
Email: info@xpay.com.ua
Telegram: @xpaysupportbot
</details>