Skip to main content

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_url and payment_token to be used with a customized Payment Panel (see Credit Card Payment Panel for details).
  • alternatively, redirect_url giving 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).

info

Accepted Credit Card are VISA, MASTERCARD and CB (Carte Bleue). Payment with 3DSecure process is mandatory.

tip

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).

821

Request

POST /cash-in/creditcards/init
Body - PropertyTypeValueDescription
partner_refstringmax size = 64Partner 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\}
tagstringmax size = 100
optional
Custom metadata
payer_account_idstringmax 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_idstringmax size = 64
type: EMONEY
Id of the EMONEY wallet where the money is credited (STANDARD or BUSINESS account)
fees_wallet_idstringmax size = 64
optional
type: FEES
Id of the FEES wallet where the fees are credited
amountdoublemin = 0.01Amount 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.
feesdoubleoptional
default = 0
Fees amount taken by the partner
auth_timeout_delayintegermaximum = 604800 (7 days)
optional
default = maximum
Reservation delay inseconds of the transaction amount
return_urlstringmax size = 300Partner redirect URL when the payment is has been processed by the end-user.
return_url_failstringmax size = 300
optional
default =return_url
Partner redirect URL when the payment fails.
langstringlanguage 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
descriptionstringmax 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_optionenumno
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_cardsbooleantrue
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_confirmbooleantrue
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 statusCase
201Success
Body - PropertyTypeValueDescription
idstringmax size = 64Cash-in transaction id
redirect_urlstringmax size = 500URL of the payment panel where the partner should redirect the user to perform payment authorization.
payment_urlstringThe URL of the payment service to include the payment panel (seeCredit Card Payment Panel)
payment_tokenstringmax size = 300A 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 - PropertyTypeValueDescription
idstringmax size = 64Id of the credit card used for the payment.
Body - PropertyTypeValueDescription
partner_refstringmax size = 64Partner 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}
tagstringmax size = 100
optional
Custom metadata
receiver_wallet_idstringmax size = 64
type: EMONEY
Id of the EMONEY wallet where the amount is credited (STANDARD or BUSINESS account)
fees_wallet_idstringmax size = 64
optional
type: FEES
Id of the FEES wallet where the fees are credited
amountdoubleAmount of the cash-in
feesdouble
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.
descriptionstringmax 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 statusCase
201Success
Body - PropertyTypeValue
Description
idstringmax size = 64Transaction id
receiver_balancedouble
Balance of the receiver wallet
receiver_available_balancedouble
Available balance of the receiver wallet (Balance deducted of any authorized debit amount)
statusenumCONFIRMEDTransaction status

Response Sample

info

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 - PropertyTypeValueDescription
idstringmax size = 64Id of the credit card used for the payment.
:::tip
Same parameters as thesingle-step cash-in request, plus the parameters below:
:::
Body - PropertyTypeValueDescription
auth_timeout_delayintegermaximum = 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 statusCase
201Success
Body - PropertyTypeValueDescription
idstringmax size = 64Transaction id

Response Sample

info

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-PropertyTypeValueDescription
idstringmax size = 64Transaction id

Request Sample

DELETE /cash-in/TX-8148254337416765

Response

HTTP statusCase
204Success
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-PropertyTypeValueDescription
idstringmax size = 64Transaction id
Body - PropertyTypeValueDescription
amountdoublemax = authorized amount min = fees amount
optional
Amount of the cash-in to confirm (fees included). If not provided, the authorized amount is confirmed.
feesdoublemax = 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 statusCase
200Success
Body
idstringmax size = 64Transaction id
receiver_balancedoubleBalance of the receiver wallet
receiver_available_balancedoubleAvailable balance of the receiver wallet (Balance deducted of any authorized debit amount)
statusenumCONFIRMEDTransaction 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"
}