# MD for: https://www.mercadopago.com.uy/developers/pt/docs/checkout-bricks/how-tos/how-to-migrate/web-tokenize-checkout-v2/clientside.md \# How to migrate from Web Tokenize Checkout V2 If your integration is using Web Tokenize Checkout V2, follow the steps below to migrate to Checkout Bricks. > CLIENT\_SIDE > > h2 > > Receive payments with cards 1\. Find in your current structure the form that calls the Web Tokenize Checkout. \`\`\`HTML \`\`\`\`\` 2\. Replace this form with the tag that will contain the Card Payment Brick. \`\`\`HTML \`\`\`\` 3\. Add the script responsible for loading the Bricks. \`\`\`javascript const mp = new MercadoPago('YOUR\_PUBLIC\_KEY'); const bricksBuilder = mp.bricks(); const renderPaymentBrick = async (bricksBuilder) => { const settings = { initialization: { amount: 100, //valor do processamento a ser realizado payer: { email: 'm', }, }, style: { theme: 'default' // | 'dark' | 'bootstrap' | 'flat' }, callbacks: { onReady: () => { // callback chamado quando o Brick estiver pronto }, onSubmit: ({paymentType, formData}) => { // callback chamado o usuário clicar no botão de submissão dos dados // ejemplo de envío de los datos recolectados por el Brick a su servidor return new Promise((resolve, reject) => { fetch("/processar-pago", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(formData) }) .then((response) => { // receber o resultado do pagamento resolve(); }) .catch((error) => { // lidar com a resposta de erro ao tentar criar o pagamento reject(); }) }); }, onError: (error) => { // callback chamado para todos os casos de erro do Brick }, }, }; window.cardPaymentBrickController = await bricksBuilder.create('payment', 'paymentBrick\_container', settings); }; renderPaymentBrick(bricksBuilder); \`\`\`\` 4\. In Brick's \`onSubmit\` callback, add the same URL that you used in the \`action\` parameter of your form. This is where Brick will send the payment form data. > CLIENT\_SIDE > > h2 > > Users and cards > NOTE > > Note > > The user and card creation process has no difference between Web Tokenize Checkout and Checkout Bricks. ### Receive payment from a user with saved cards To receive payment from a user with saved cards, it is necessary to pass the user and the cards to Bricks, which will perform the tokenization process and send the information to generate the payment in the \`onSubmit\` callback. 1\. Find in the current structure of your integration the form that calls the Web Tokenize Checkout. \`\`\`HTML \`\`\`\` 2\. Replace this form with the tag that will contain the Card Payment Brick. \`\`\`HTML \`\`\`\`\` With this configuration, it will be possible to process the payment with the saved cards.