feat: upgrade index.html
This commit is contained in:
parent
dd4765b306
commit
0c55346a94
|
@ -62,7 +62,7 @@
|
|||
</div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li class="current"><a href="index.html">Home</a></li>
|
||||
<li class="current"><a href="/">Home</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
@ -85,6 +85,86 @@
|
|||
<li><strong>wallet_address:</strong> The wallet address to which the payment should be made.</li>
|
||||
<li><strong>expires_at:</strong> The time at which the order will expire.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Examples</h3>
|
||||
<h4>Go</h4>
|
||||
<pre>
|
||||
<code>
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Order struct {
|
||||
OrderID string `json:"order_id"`
|
||||
ClientID string `json:"client_id"`
|
||||
Amount float64 `json:"amount"`
|
||||
Currency string `json:"currency"`
|
||||
ClientEmail string `json:"client_email"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
order := &Order{
|
||||
OrderID: "123",
|
||||
ClientID: "456",
|
||||
Amount: 100.0,
|
||||
Currency: "USD",
|
||||
ClientEmail: "client@example.com",
|
||||
}
|
||||
|
||||
jsonValue, _ := json.Marshal(order)
|
||||
_, err := http.Post("https://yourwebsite.com/order", "application/json", bytes.NewBuffer(jsonValue))
|
||||
if err != nil {
|
||||
// handle error
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<h4>Node.js</h4>
|
||||
<pre>
|
||||
<code>
|
||||
const axios = require('axios');
|
||||
|
||||
const order = {
|
||||
order_id: '123',
|
||||
client_id: '456',
|
||||
amount: 100.0,
|
||||
currency: 'USD',
|
||||
client_email: 'client@example.com'
|
||||
};
|
||||
|
||||
axios.post('https://yourwebsite.com/order', order)
|
||||
.then(response => {
|
||||
console.log(response.data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<h4>CURL</h4>
|
||||
<pre>
|
||||
<code>
|
||||
curl -X POST https://yourwebsite.com/order \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"order_id": "123",
|
||||
"client_id": "456",
|
||||
"amount": 100.0,
|
||||
"currency": "USD",
|
||||
"client_email": "client@example.com"
|
||||
}'
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<h3>Handling the Response</h3>
|
||||
<p>The response from the /order endpoint is an HTML page that should be displayed to the user. This can be done by embedding the response in an iframe, loading it in a new browser window or tab, or by replacing the current page with the response HTML.</p>
|
||||
<p>Please note that the exact method of displaying the response will depend on the specifics of your application and its user interface.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue