Please create 2 functions "pay", and "paid" by using the data structures given below. "pay" function should get the price of a specific token, and create a pending payment order in "pendingPayments". "paid" function is called to verify the payment has been made to the owner of the token. Once the payment is verified, the payment will move from "pendingPayments" to "completedPayments".

type UserId = number;
type TokenId = number;
type Offer = { price: number; buyer: UserId };

let tokenPrices: Map<TokenId, Offer> = new Map(); // to keep track the prices of each tokens

type PaymentVerification = { to: UserId; verified: boolean; };
type Payment = { token: TokenId; paid: PaymentVerification; }

const pendingPayments: Map<UserId, Payment[]> = new Map();
const completedPayments: Map<UserId, Payment[]> = new Map();