CARD_PAYMENT
Fund transactions using credit and debit cards.

Specifications

Accept funding using Visa credit and debit cards card using funding method CARD_PAYMENT.

Setup Parameters

None

Input Parameters

Note that an iframe should be rendered for card tokenization which will submit this information.
Field
Type
Description
Required
transaction_key
CARD_TOKEN
Tokenized card details
true

Result Parameters

Field
Type
Description
Always Present
transaction_key
TRANSCATION_RECEIPT
Third party transaction number
true

Tokenization

Card details must be recorded via loading a minimally intrusive and unstyled iframe. Card details cannot be submitted via normal API.
1
<iframe
2
id="qex-card-capture"
3
src="https://partners.liquid.com/api/v1/method/card/{settlement_instruction_id}"
4
/>
5
<script>
6
window.addEventListener('message', (event) => {
7
const data: CustomPostMessage = event.data;
8
if (data !== undefined && data !== null && data.event !== undefined) {
9
switch (data.event) {
10
case 'success':
11
console.log('Tokenization Success', data.payload);
12
break;
13
case 'failure':
14
console.log('Tokenization Failed', data.payload );
15
break;
16
case '3ds-frame':
17
console.log('Must render 3DS iframe', data.payload)
18
break
19
case 'card-validation':
20
console.log('Card validation updated', data.payload);
21
break;
22
}
23
}
24
}, false);
25
const iframe = document.getElementById('qex-card-capture');
26
const initializePostMessage = {
27
event: "initialize"
28
};
29
iframe.contentWindow.postMessage(initializePostMessage, "*");
30
</script>
Copied!
The initialize postMessage is essential to loading the iframe. It can contain a payload attribute which specifies some optional custom parameters for the input form.
1
const initializePostMessage = {
2
event: "initialize",
3
payload: {
4
style: {
5
base: {
6
color: "#FFF",
7
fontSize: "15px",
8
},
9
placeholder: {
10
base: {
11
color: "#aaaaaa",
12
},
13
},
14
};
15
localization: {
16
card_number: 'Card Number' ,
17
card_month: 'MM',
18
card_year: 'YY',
19
card_cvv: 'CVV'
20
},
21
},
22
};
Copied!

Submit

The host application must render a "submit" button and call a submit post message when the user clicks it. This post message can optionally contain a payload which holds cardHolder information. This information is not always required, however some card issuers will reject transactions where it is not present.
1
const cardholder = {
2
name: userInfo.fullName,
3
billingAddress: userInfo.billingAddress,
4
phone: userInfo.phoneNumber,
5
};
6
const submitMessage: CustomPostMessage = {
7
event: "submit",
8
payload: { cardholder },
9
};
10
iframe.contentWindow.postMessage(submitMessage, "*");
Copied!

3D Secure

Card issuers must support the 3D Secure standard. To process 3DS, a second iframe must be rendered.
The address of this iframe must be obtained from the previous iframe. See 3ds-iframe postMessage in the code above.
When the user completes the 3DS the new iframe will fire either the success or failure event.

Example Responses

GET https://partners.liquid.com/api/v1/transaction/70f7cd4c-bb6b-48eb-abe8-b92eac9e3db8
1
{
2
"success": true,
3
"environment": "PRODUCTION",
4
"message": "Transaction created. Transaction is filled. Payout has been delivered.",
5
"payload": {
6
"transaction_id": "70f7cd4c-bb6b-48eb-abe8-b92eac9e3db8",
7
"api_key": "ef6cf2a7-a6e8-48d1-8c8a-677187dfcd8f",
8
"status": "FILLED",
9
"funding_settlement": {
10
"settlement_instruction_id": "fba2b4eb-7d17-453a-a69f-c5e991384091",
11
"transaction_id": "70f7cd4c-bb6b-48eb-abe8-b92eac9e3db8",
12
"currency": "AUD",
13
"direction": "FUNDING",
14
"method": "CARD_PAYMENT",
15
"quantity": "100.00",
16
"status": "COMPLETE",
17
"expires": {
18
"unix_ms": 1589254269593,
19
"iso8601": "2020-05-12T03:31:09.593Z",
20
"ttl_ms": 20000
21
},
22
"input_parameters": {
23
"card_token": "tok_wiooyb6dhkquvikbxsvw2uymhy"
24
},
25
"result_parameters": {
26
"card_receipt": "act_3ycvlqyprmme3kh3l36blhu7om"
27
},
28
"_links": {
29
"status": {
30
"href": "https://partners.liquid.com/api/v1/settlement/status/fba2b4eb-7d17-453a-a69f-c5e991384091"
31
}
32
}
33
},
34
"payout_settlement": {
35
"settlement_instruction_id": "e6560d70-2fa8-4e2a-b86b-3979694016ad",
36
"transaction_id": "70f7cd4c-bb6b-48eb-abe8-b92eac9e3db8",
37
"currency": "USDC",
38
"direction": "PAYOUT",
39
"method": "BLOCKCHAIN_TRANSFER",
40
"quantity": "60.640",
41
"status": "COMPLETE",
42
"expires": {
43
"unix_ms": 1589254253947,
44
"iso8601": "2020-05-12T03:30:53.947Z",
45
"ttl_ms": 20000
46
},
47
"input_parameters": {
48
"wallet_adress": "0xC5b83d3C0f48807AF09ee5Bd1c95Ee870878f36B"
49
},
50
"result_parameters": {
51
"wallet_address": "0xC5b83d3C0f48807AF09ee5Bd1c95Ee870878f36B",
52
"transaction_hash": "0x8698693ddaec3cad825c0c42e326105e3e14f70ebbcd425c3a8b577570168335"
53
},
54
"_links": {
55
"status": {
56
"href": "https://partners.liquid.com/api/v1/settlement/status/e6560d70-2fa8-4e2a-b86b-3979694016ad"
57
}
58
}
59
},
60
"_links": {
61
"status": {
62
"href": "https://partners.liquid.com/api/v1/transaction/status/70f7cd4c-bb6b-48eb-abe8-b92eac9e3db8"
63
}
64
}
65
}
66
}
Copied!