You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-26Lines changed: 17 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ Upon visiting the URL, your customer is presented with a checkout page hosted on
73
73
let response =awaitclient.post('/checkout/hosted', {
74
74
charge:{
75
75
customerId: customerId, // associates this charge with a customer
76
-
currency:'USD', // specifies the billing currency
76
+
billingCurrency:'USD', // specifies the billing currency
77
77
lineItems: [{ // a list of line items included in this charge
78
78
description:'T-Shirt',
79
79
netAmount:10,
@@ -93,7 +93,7 @@ let response = await client.post('/checkout/hosted', {
93
93
percent:0.0825// 8.25% CA sales tax
94
94
}]
95
95
},
96
-
settlementCurrency:'EUR'//specifies in which currency you want to settle
96
+
settlementAsset:'USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN'//your settlement asset as given by GET /assets (or ORIGIN to omit conversion)
97
97
});
98
98
99
99
console.log(response.status);
@@ -123,7 +123,7 @@ console.log(response.data);
123
123
124
124
if (response.status===200) {
125
125
let state =response.data['checkout']['state'];
126
-
if (['COMPLETED'].includes(state)) {
126
+
if (state ==='CHECKOUT_COMPLETED') {
127
127
console.log("The payment has completed and your account was credited. You can now ship the goods.");
Copy file name to clipboardExpand all lines: src/README.md
+35-44Lines changed: 35 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -63,17 +63,17 @@ let customerId = response.data['customerId']; // store this persistently in your
63
63
64
64
**Create a Hosted Checkout** (https://www.coinqvest.com/en/api-docs#post-checkout-hosted)
65
65
66
-
Hosted checkouts are the simplest form of getting paid using the COINQVEST platform.
66
+
Hosted checkouts are the simplest form of getting paid using the COINQVEST platform.
67
67
68
-
Using this endpoint, your server submits a set of parameters, such as the payment details including optional tax items, customer information, and settlement currency. Your server then receives a checkout URL in return, which is displayed back to your customer.
68
+
Using this endpoint, your server submits a set of parameters, such as the payment details including optional tax items, customer information, and settlement currency. Your server then receives a checkout URL in return, which is displayed back to your customer.
69
69
70
70
Upon visiting the URL, your customer is presented with a checkout page hosted on COINQVEST servers. This page displays all the information the customer needs to complete payment.
71
71
72
72
```javascript
73
73
let response =awaitclient.post('/checkout/hosted', {
74
74
charge:{
75
75
customerId: customerId, // associates this charge with a customer
76
-
currency:'USD', // specifies the billing currency
76
+
billingCurrency:'USD', // specifies the billing currency
77
77
lineItems: [{ // a list of line items included in this charge
78
78
description:'T-Shirt',
79
79
netAmount:10,
@@ -93,7 +93,7 @@ let response = await client.post('/checkout/hosted', {
93
93
percent:0.0825// 8.25% CA sales tax
94
94
}]
95
95
},
96
-
settlementCurrency:'EUR'//specifies in which currency you want to settle
96
+
settlementAsset:'USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN'//your settlement asset as given by GET /assets (or ORIGIN to omit conversion)
97
97
});
98
98
99
99
console.log(response.status);
@@ -123,7 +123,7 @@ console.log(response.data);
123
123
124
124
if (response.status===200) {
125
125
let state =response.data['checkout']['state'];
126
-
if (['COMPLETED'].includes(state)) {
126
+
if (state ==='CHECKOUT_COMPLETED') {
127
127
console.log("The payment has completed and your account was credited. You can now ship the goods.");
0 commit comments