An operation expectPaymentRequest orders CNode to accept new payment, which is requested for it by given user, for a given amount.
Normally all CNodes (that work on the production colony) reject any transfers from other users automatically; this operation allows to make such a transfer. It returns a transfer identifier, which needs to be provided when requesting the transfer in order that CNode knows that the transfer needs to be accepted.
Example SOAP request:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="ns1"> <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <ns:expectPaymentRequest> <username>username1</username> <amount> <amount>1000</amount> <currency>PLN</currency> <colour>0</colour> </amount> <timeout>600</timeout> </ns:expectPaymentRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Example SOAP response:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="ns1"> <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <ns:expectPaymentRequestResponse> <return> <requestPaymentIdConfirmation>X60M88LSSU1714GB9E32GB1P14</requestPaymentIdConfirmation> <requestStatus>SUCCESS</requestStatus> <requestStatusDescription>Request succeeded.</requestStatusDescription> </return> </ns:expectPaymentRequestResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Request parameters:
Parameter | Type | Description | Required? |
username | string | Name of the user that will send the payment request (the user to which money will be send) | Yes |
amount | billonAmount | The amount which will be sent | Yes |
timeout | unsignedInt | Time for which CNode should expect the request | Yes |
Response parameters:
Name | Type | Description |
requestPaymentIdConfirmation | string | Identifier which needs to be provided when requesting the transfer |
requestStatusDescription | string | A description of a status |
requestStatus | string | The request execution status |
Possible errors:
Error | Description |
ERR_INVALID_AMOUNT | The invalid amount |
ERR_INVALID_CURRENCY | An invalid currency |
ERR_INVALID_MONEY_COLOUR | An invalid/not supported colour of money |
ERR_INVALID_USERNAME | The invalid username |