Cash-in | Credit Card
Initiate a cash-in (via Credit Card Payment Form)
Initiate a new cash-in transaction by credit card via a Web Payment Panel. As response, the service provides:
payment_urlandpayment_tokento be used with a customized Payment Panel (see Credit Card Payment Panel for details).- alternatively,
redirect_urlgiving the default Web Payment Panel address (hosted by W-HA) to be used in an Iframe in the partner web page
Once the payment is done , user is redirected to return_url if payment is successful or return_url_fail in failure case. The id (W-HA reference) of the transaction is added as a query parameter to the provided URL.
Partner should request transaction status to the API to have the final status of the payment: AUTHORIZED or FAILED.
If AUTHORIZED, the partner should finally confirmed the cash-in within the authorization delay. The money is then credited to the receiver wallet (and fees wallet if defined).
Accepted Credit Card are VISA, MASTERCARD and CB (Carte Bleue). Payment with 3DSecure process is mandatory.
Notice that, in the payment panel web form, the user can choose to save his credit card for further payment. If so, the credit card will be associated to the payer_account_id and could be reused to perform direct credit card payment through the API (see next part).
Request
POST /cash-in/creditcards/init
| Body - Property | Type | Value | Description |
|---|---|---|---|
| partner_ref | string | max size = 64 | Partner unique internal reference of the transaction. N.B : This reference is useful to retrieve transaction status in case of timeout, using : GET /transactions/partner_ref/\{partner_ref\} |
| tag | string | max size = 100 optional | Custom metadata |
| payer_account_id | string | max size = 64 optional | Account Id of the payer initiating the cash-in (owner of the payment mean). If not specified, it is equal to the owner of the receiver_wallet. |
| receiver_wallet_id | string | max size = 64 type: EMONEY | Id of the EMONEY wallet where the money is credited (STANDARD or BUSINESS account) |
| fees_wallet_id | string | max size = 64 optional type: FEES | Id of the FEES wallet where the fees are credited |
| amount | double | min = 0.01 | Amount of the cash-in (fees included). The user is charged of the amount on his payment mean (e.g. credit card) but is credited of theamount-fees on his wallet. |
| fees | double | optional default = 0 | Fees amount taken by the partner |
| auth_timeout_delay | integer | maximum = 604800 (7 days) optional default = maximum | Reservation delay inseconds of the transaction amount |
| return_url | string | max size = 300 | Partner redirect URL when the payment is has been processed by the end-user. |
| return_url_fail | string | max size = 300 optional default =return_url | Partner redirect URL when the payment fails. |
| lang | string | language ISO code : en da de es fi fr it nl no pl pt ro sk sv size = 2 optional defaut = en | Language ISO code of the payment panel: en → english da →danish de →german es →spanish fi → finnish fr → french it → italian nl → dutch no → norwegian pl → polish pt → portuguese ro → romanian sk → slovak sw → swedish |
| description | string | max size = 15 pattern =^[a-zA-Z0-9 _:\-]{0,15}$optional | Customized cash-in transaction description. This text will be displayed in the user's bank statement. |
| save_card_option | enum | no suggest suggest_mandatory optional default = suggest | no : registration is not suggested, so credit card is not saved. suggest : registration is suggested to customer. He has choice to accept or refuse the registration by checking or no the checkbox. suggest_mandatory : registration is suggested to customer. But he must check registration if he want get payment done |
| display_cards | boolean | true false optional default = false | The list of registered cards on the payer account will be display on the payment panel. The payer is then able to select one of his registered card and proceed to payment throught 3D Secure process. |
| auto_confirm | boolean | true false optional default = false | If true, thePUT /cash-in/\{trx_id\} is automatically done by the platform before the redirect to your server. |
Request Sample
POST /cash-in/creditcards/init
{
"partner_ref": "REF-CO-A164684461621621",
"tag": "My cash-in",
"receiver_wallet_id": "WE-9876543219876543",
"fees_wallet_id": "WF-1234567891234567",
"amount": 105,
"fees": 5,
"return_url": "https://www.mysite.com/store/cash-in",
"lang": "fr",
"auth_timeout_delay": 86400
}
Response
| HTTP status | Case | ||
|---|---|---|---|
| 201 | Success | ||
| Body - Property | Type | Value | Description |
| id | string | max size = 64 | Cash-in transaction id |
| redirect_url | string | max size = 500 | URL of the payment panel where the partner should redirect the user to perform payment authorization. |
| payment_url | string | The URL of the payment service to include the payment panel (seeCredit Card Payment Panel) | |
| payment_token | string | max size = 300 | A token to provide to the payment service to include the payment panel. The token is valid for 30 minutes. |
Response Sample
HTTP/1.1 201 CREATED
{
"id": "TX-8148254337416765",
"redirect_url": "https://securecb.w-ha.com/secure-node-ems/purchase-form?token=10b4c77b...",
"payment_url": "https://securecb.w-ha.com/secure-node-ems/purchase-form",
"payment_token": "10b4c77b..."
}
Execute a single-step cash-in (with a registered Credit Card)
Execute a new cash-in transaction with an already registered credit card in a single call (no need to confirm but cash-in 2 steps is recommended).
Request
POST /cash-in/creditcards/[id]
| URL - Property | Type | Value | Description |
|---|---|---|---|
| id | string | max size = 64 | Id of the credit card used for the payment. |
| Body - Property | Type | Value | Description |
| partner_ref | string | max size = 64 | Partner unique internal reference of the transaction. N.B : This reference is useful to retrieve transaction status in case of timeout, using : GET /transactions/partner_ref/{partner_ref} |
| tag | string | max size = 100 optional | Custom metadata |
| receiver_wallet_id | string | max size = 64 type: EMONEY | Id of the EMONEY wallet where the amount is credited (STANDARD or BUSINESS account) |
| fees_wallet_id | string | max size = 64 optional type: FEES | Id of the FEES wallet where the fees are credited |
| amount | double | Amount of the cash-in | |
| fees | double | optional default = 0 | Fees amount taken by the partner. The user is charged ofamount on his payment mean (credit card) but is credited of theamount-fees on his wallet. |
| description | string | max size = 15 pattern =^[a-zA-Z0-9 _:\-]{0,15}$optional | Customized cash-in transaction description |
Request Sample
POST /cash-in/creditcards/CC-1465716476464676
{
"partner_ref": "REF-CO-A164684461621621",
"payment_method": "CREDIT_CARD",
"receiver_wallet_id": "WE-9876543219876543",
"fees_wallet_id": "WF-1234567891234567",
"amount": 105,
"fees": 5
}
Response
| HTTP status | Case | ||
|---|---|---|---|
| 201 | Success | ||
| Body - Property | Type | Value | Description |
| id | string | max size = 64 | Transaction id |
| receiver_balance | double | Balance of the receiver wallet | |
| receiver_available_balance | double | Available balance of the receiver wallet (Balance deducted of any authorized debit amount) | |
| status | enum | CONFIRMED | Transaction status |
Response Sample
The transaction is at "CONFIRMED" status. The money is provisionned to the receiver wallet.
HTTP/1.1 201 CREATED
{
"id": "TX-8148254337416765",
"receiver_balance": 100.0,
"receiver_available_balance": 100.0
}
Create a cash-in Autorization (with a registered Credit Card)
Initiate a new cash-in transaction with an already registered credit card.
Request
POST /cash-in/creditcards/[id]/authorize
| URL - Property | Type | Value | Description |
|---|---|---|---|
| id | string | max size = 64 | Id of the credit card used for the payment. |
| :::tip | |||
| Same parameters as thesingle-step cash-in request, plus the parameters below: | |||
| ::: |
| Body - Property | Type | Value | Description |
|---|---|---|---|
| auth_timeout_delay | integer | maximum = 604800 (7 days) optional default = maximum | Reservation delay inseconds of the transaction amount. |
Request Sample
POST /cash-in/creditcards/CC-1465716476464676/authorize
{
"partner_ref": "REF-CO-A164684461621621",
"payment_method": "CREDIT_CARD",
"receiver_wallet_id": "WE-9876543219876543",
"fees_wallet_id": "WF-1234567891234567",
"amount": 105,
"fees": 5,
"auth_timeout_delay": 86400
}
Response
| HTTP status | Case | ||
|---|---|---|---|
| 201 | Success | ||
| Body - Property | Type | Value | Description |
| id | string | max size = 64 | Transaction id |
Response Sample
The transaction is at AUTHORIZED status. The money is provisioned to the receiver wallet only after transaction confirmation.
HTTP/1.1 201 CREATED
{
"id": "TX-8148254337416765"
}
Cancel an Authorized cash-in
Cancel a INITIATED or AUTHORIZED cash-in transaction.
Request
DELETE /cash-in/[id]
| URL-Property | Type | Value | Description |
|---|---|---|---|
| id | string | max size = 64 | Transaction id |
Request Sample
DELETE /cash-in/TX-8148254337416765
Response
| HTTP status | Case |
|---|---|
| 204 | Success |
| Body | |
| - None - |
Response Sample
HTTP/1.1 204 No Content
Confirm an Authorized cash-in
- Confirm an AUTHORIZED cash-in transaction.
- The receiver and fees wallets are credited at this moment.
Request
PUT /cash-in/[id]
| URL-Property | Type | Value | Description |
|---|---|---|---|
| id | string | max size = 64 | Transaction id |
| Body - Property | Type | Value | Description |
| amount | double | max = authorized amount min = fees amount optional | Amount of the cash-in to confirm (fees included). If not provided, the authorized amount is confirmed. |
| fees | double | max = authorized fees min = 0 optional | Amount of the fees to confirm. If not provided, the authorized fees is confirmed. |
Request Sample
PUT /cash-in/TX-8148254337416765
Request Sample - Partial confirm (90 instead of 105)
PUT /cash-in/TX-8148254337416765
{
"amount": 90,
"fees": 5
}
Response
| HTTP status | Case | ||
|---|---|---|---|
| 200 | Success | ||
| Body | |||
| id | string | max size = 64 | Transaction id |
| receiver_balance | double | Balance of the receiver wallet | |
| receiver_available_balance | double | Available balance of the receiver wallet (Balance deducted of any authorized debit amount) | |
| status | enum | CONFIRMED | Transaction status |
Response Sample
HTTP/1.1 200 OK
{
"id": "TX-8148254337416765",
"receiver_balance": 100.0,
"receiver_available_balance": 100.0,
"status": "CONFIRMED"
}
Response Sample - Partial confirm (90 instead of 105)
HTTP/1.1 200 OK
{
"id": "TX-8148254337416765",
"receiver_balance": 85.0,
"receiver_available_balance": 100.0,
"status": "CONFIRMED"
}