2022-01-02 00:19:18 +00:00
|
|
|
import React, { Component } from "react";
|
|
|
|
|
|
|
|
export default class OrderPage extends Component {
|
2022-01-02 12:59:48 +00:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
status: 0,
|
|
|
|
type: 0,
|
|
|
|
currency: 0,
|
|
|
|
currencyCode: 'USD',
|
|
|
|
is_participant: false,
|
|
|
|
amount: 1,
|
|
|
|
paymentMethod:"",
|
2022-01-02 13:24:35 +00:00
|
|
|
explicit: false,
|
2022-01-02 12:59:48 +00:00
|
|
|
premium: 0,
|
|
|
|
satoshis: null,
|
|
|
|
makerId: "",
|
|
|
|
// makerNick:"",
|
|
|
|
// takerId: "",
|
|
|
|
// takerNick:"",
|
|
|
|
};
|
|
|
|
this.orderId = this.props.match.params.orderId;
|
2022-01-02 13:24:35 +00:00
|
|
|
this.getOrderDetails();
|
2022-01-02 12:59:48 +00:00
|
|
|
}
|
2022-01-02 00:19:18 +00:00
|
|
|
|
2022-01-02 13:24:35 +00:00
|
|
|
getOrderDetails() {
|
|
|
|
fetch('/api/order' + '?order_id=' + this.orderId)
|
2022-01-02 12:59:48 +00:00
|
|
|
.then((response) => response.json())
|
|
|
|
.then((data) => {
|
|
|
|
this.setState({
|
|
|
|
status: data.status,
|
|
|
|
type: data.type,
|
|
|
|
currency: data.currency,
|
|
|
|
amount: data.amount,
|
|
|
|
paymentMethod: data.payment_method,
|
2022-01-02 13:24:35 +00:00
|
|
|
explicit: data.explicit,
|
|
|
|
//premium: data.premium,
|
2022-01-02 12:59:48 +00:00
|
|
|
// satoshis: satoshis,
|
2022-01-02 13:24:35 +00:00
|
|
|
// makerId: maker,
|
2022-01-02 12:59:48 +00:00
|
|
|
// isParticipant: is_participant,
|
|
|
|
// makerNick: maker_nick,
|
|
|
|
// takerId: taker,
|
|
|
|
// takerNick: taker_nick,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
render (){
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<p>This is the single order detail view page</p>
|
|
|
|
<p>Order id: {this.orderId}</p>
|
|
|
|
<p>Order status: {this.state.status}</p>
|
|
|
|
<p>Order type: {this.state.type}</p>
|
|
|
|
<p>Currency: {this.state.currencyCode}</p>
|
|
|
|
<p>Amount: {this.state.amount}</p>
|
|
|
|
<p>Payment method: {this.state.paymentMethod}</p>
|
2022-01-02 13:24:35 +00:00
|
|
|
<p>Pricing method is explicit: {this.state.explicit.toString()}</p>
|
|
|
|
{/* <p>Premium: {this.state.premium}</p>
|
|
|
|
<p>Maker: {this.makerId}</p> */}
|
2022-01-02 12:59:48 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2022-01-02 00:19:18 +00:00
|
|
|
}
|