{"id":589,"date":"2021-03-03T07:01:19","date_gmt":"2021-03-03T07:01:19","guid":{"rendered":"https:\/\/elnclassrooms.ee\/?page_id=589"},"modified":"2022-08-05T11:13:21","modified_gmt":"2022-08-05T11:13:21","slug":"paypal-payments","status":"publish","type":"page","link":"https:\/\/elnclassrooms.ee\/en\/hinnakiri\/paypal-payments\/","title":{"rendered":"PayPal payments"},"content":{"rendered":"\n<p>Price list 05.08.22 &#8211; 24.12.22 <\/p>\n\n\n\n<p>You can pay for attended lessons with PayPal. Please note that the hourly rate via this payment gateway accounts for the transaction charge. There is no VAT starting from 20 February 2022.  If anything goes wrong, please note that refunds are possible within 60 calendar days only. <\/p>\n\n\n\n<div id=\"smart-button-container\">\n      <div style=\"text-align: center;\">\n        <div style=\"margin-bottom: 1.25rem;\">\n          <p>Online English lesson, the service has been received<\/p>\n          <select id=\"item-options\"><option value=\"60 mins, exam preparation 1-39 lessons, per lesson fee\" price=\"21\">60 mins, exam preparation 1-39 lessons, per lesson fee &#8211; 21 EUR<\/option><option value=\"60 mins, exam preparation, 40+ lessons, per lesson fee\" price=\"20\">60 mins, exam preparation, 40+ lessons, per lesson fee &#8211; 20 EUR<\/option><option value=\"60 mins, General English, 1-39 lessons, per lesson fee\" price=\"19\">60 mins, General English, 1-39 lessons, per lesson fee &#8211; 19 EUR<\/option><option value=\"60 mins, General English, 40+ lessons, per lesson fee\" price=\"18\">60 mins, General English, 40+ lessons, per lesson fee &#8211; 18 EUR<\/option><\/select>\n          <select style=\"visibility: hidden\" id=\"quantitySelect\"><option value=\"1\">1<\/option><option value=\"2\">2<\/option><option value=\"3\">3<\/option><option value=\"4\">4<\/option><option value=\"5\">5<\/option><option value=\"6\">6<\/option><option value=\"7\">7<\/option><option value=\"8\">8<\/option><option value=\"9\">9<\/option><option value=\"10\">10<\/option><option value=\"11\">11<\/option><option value=\"12\">12<\/option><option value=\"13\">13<\/option><option value=\"14\">14<\/option><option value=\"15\">15<\/option><option value=\"16\">16<\/option><option value=\"17\">17<\/option><option value=\"18\">18<\/option><option value=\"19\">19<\/option><option value=\"20\">20<\/option><option value=\"21\">21<\/option><option value=\"22\">22<\/option><option value=\"23\">23<\/option><option value=\"24\">24<\/option><option value=\"25\">25<\/option><option value=\"26\">26<\/option><option value=\"27\">27<\/option><option value=\"28\">28<\/option><option value=\"29\">29<\/option><option value=\"30\">30<\/option><option value=\"31\">31<\/option><option value=\"32\">32<\/option><option value=\"33\">33<\/option><option value=\"34\">34<\/option><option value=\"35\">35<\/option><option value=\"36\">36<\/option><option value=\"37\">37<\/option><option value=\"38\">38<\/option><option value=\"39\">39<\/option><option value=\"40\">40<\/option><\/select>\n        <\/div>\n      <div id=\"paypal-button-container\"><\/div>\n      <\/div>\n    <\/div>\n    <script src=\"https:\/\/www.paypal.com\/sdk\/js?client-id=AatNp1ITxjCZPtvA1KDHk3TkrWsXe-o1dmBL0Fb7shqtY_lq9U_k98RlsfRw5r0Ug1Km6H2XgvdtbUn_&#038;enable-funding=venmo&#038;currency=EUR\" data-sdk-integration-source=\"button-factory\"><\/script>\n    <script>\n      function initPayPalButton() {\n        var shipping = 0;\n        var itemOptions = document.querySelector(\"#smart-button-container #item-options\");\n    var quantity = parseInt(40);\n    var quantitySelect = document.querySelector(\"#smart-button-container #quantitySelect\");\n    if (!isNaN(quantity)) {\n      quantitySelect.style.visibility = \"visible\";\n    }\n    var orderDescription = 'Online English lesson, the service has been received';\n    if(orderDescription === '') {\n      orderDescription = 'Item';\n    }\n    paypal.Buttons({\n      style: {\n        shape: 'pill',\n        color: 'blue',\n        layout: 'vertical',\n        label: 'paypal',\n        \n      },\n      createOrder: function(data, actions) {\n        var selectedItemDescription = itemOptions.options[itemOptions.selectedIndex].value;\n        var selectedItemPrice = parseFloat(itemOptions.options[itemOptions.selectedIndex].getAttribute(\"price\"));\n        var tax = (0 === 0 || false) ? 0 : (selectedItemPrice * (parseFloat(0)\/100));\n        if(quantitySelect.options.length > 0) {\n          quantity = parseInt(quantitySelect.options[quantitySelect.selectedIndex].value);\n        } else {\n          quantity = 1;\n        }\n\n        tax *= quantity;\n        tax = Math.round(tax * 100) \/ 100;\n        var priceTotal = quantity * selectedItemPrice + parseFloat(shipping) + tax;\n        priceTotal = Math.round(priceTotal * 100) \/ 100;\n        var itemTotalValue = Math.round((selectedItemPrice * quantity) * 100) \/ 100;\n\n        return actions.order.create({\n          purchase_units: [{\n            description: orderDescription,\n            amount: {\n              currency_code: 'EUR',\n              value: priceTotal,\n              breakdown: {\n                item_total: {\n                  currency_code: 'EUR',\n                  value: itemTotalValue,\n                },\n                shipping: {\n                  currency_code: 'EUR',\n                  value: shipping,\n                },\n                tax_total: {\n                  currency_code: 'EUR',\n                  value: tax,\n                }\n              }\n            },\n            items: [{\n              name: selectedItemDescription,\n              unit_amount: {\n                currency_code: 'EUR',\n                value: selectedItemPrice,\n              },\n              quantity: quantity\n            }]\n          }]\n        });\n      },\n      onApprove: function(data, actions) {\n        return actions.order.capture().then(function(orderData) {\n          \n          \/\/ Full available details\n          console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));\n\n          \/\/ Show a success message within this page, e.g.\n          const element = document.getElementById('paypal-button-container');\n          element.innerHTML = '';\n          element.innerHTML = '<h3>Thank you for your payment!<\/h3>';\n\n          \/\/ Or go to another URL:  actions.redirect('thank_you.html');\n\n        });\n      },\n      onError: function(err) {\n        console.log(err);\n      },\n    }).render('#paypal-button-container');\n  }\n  initPayPalButton();\n    <\/script>\n","protected":false},"excerpt":{"rendered":"<p>Price list 05.08.22 &#8211; 24.12.22 You can pay for attended lessons with PayPal. Please note that the hourly rate via this payment gateway accounts for the transaction charge. There is no VAT starting from 20 February 2022. If anything goes wrong, please note that refunds are possible within 60 calendar days only. Online English lesson, &hellip; <a href=\"https:\/\/elnclassrooms.ee\/en\/hinnakiri\/paypal-payments\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PayPal payments&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":345,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-589","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/pages\/589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/comments?post=589"}],"version-history":[{"count":10,"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/pages\/589\/revisions"}],"predecessor-version":[{"id":749,"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/pages\/589\/revisions\/749"}],"up":[{"embeddable":true,"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/pages\/345"}],"wp:attachment":[{"href":"https:\/\/elnclassrooms.ee\/en\/wp-json\/wp\/v2\/media?parent=589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}