{"id":1786,"date":"2022-07-19T10:09:49","date_gmt":"2022-07-19T10:09:49","guid":{"rendered":"https:\/\/www.borgoaltobedandbreakfast.it\/?page_id=1786"},"modified":"2022-07-19T10:28:08","modified_gmt":"2022-07-19T10:28:08","slug":"prova-paypal","status":"publish","type":"page","link":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/prova-paypal\/","title":{"rendered":"prova paypal"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"1786\" class=\"elementor elementor-1786\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2943c1d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2943c1d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-54bac6e\" data-id=\"54bac6e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-70f2ae5 elementor-widget elementor-widget-shortcode\" data-id=\"70f2ae5\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-shortcode\"><div id=\"smart-button-container\">\n      <div style=\"text-align: center;\">\n        <div style=\"margin-bottom: 1.25rem;\">\n          <p>Pagamento Camera<\/p>\n          <select id=\"item-options\"><option value=\"1 Notte\" price=\"70\">1 Notte - 70 EUR<\/option><option value=\"2 Notti\" price=\"140\">2 Notti - 140 EUR<\/option><option value=\"3 Notti\" price=\"210\">3 Notti - 210 EUR<\/option><option value=\"4 Notti\" price=\"280\">4 Notti - 280 EUR<\/option><option value=\"5 Notti\" price=\"350\">5 Notti - 350 EUR<\/option><option value=\"6 Notti\" price=\"420\">6 Notti - 420 EUR<\/option><\/select>\n          <select style=\"visibility: hidden\" id=\"quantitySelect\"><\/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=sb&enable-funding=venmo&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();\n    var quantitySelect = document.querySelector(\"#smart-button-container #quantitySelect\");\n    if (!isNaN(quantity)) {\n      quantitySelect.style.visibility = \"visible\";\n    }\n    var orderDescription = 'Pagamento Camera';\n    if(orderDescription === '') {\n      orderDescription = 'Item';\n    }\n    paypal.Buttons({\n      style: {\n        shape: 'pill',\n        color: 'blue',\n        layout: 'horizontal',\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><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Pagamento Camera 1 Notte &#8211; 70 EUR2 Notti &#8211; 140 EUR3 Notti &#8211; 210 EUR4 Notti &#8211; 280 EUR5 Notti &#8211; 350 EUR6 Notti &#8211; 420 EUR<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1786","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>prova paypal - B&amp;B Borgo Alto<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.borgoaltobedandbreakfast.it\/en\/prova-paypal\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"prova paypal - B&amp;B Borgo Alto\" \/>\n<meta property=\"og:description\" content=\"Pagamento Camera 1 Notte &#8211; 70 EUR2 Notti &#8211; 140 EUR3 Notti &#8211; 210 EUR4 Notti &#8211; 280 EUR5 Notti &#8211; 350 EUR6 Notti &#8211; 420 EUR\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.borgoaltobedandbreakfast.it\/en\/prova-paypal\/\" \/>\n<meta property=\"og:site_name\" content=\"B&amp;B Borgo Alto\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-19T10:28:08+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/\",\"url\":\"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/\",\"name\":\"prova paypal - B&amp;B Borgo Alto\",\"isPartOf\":{\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/#website\"},\"datePublished\":\"2022-07-19T10:09:49+00:00\",\"dateModified\":\"2022-07-19T10:28:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.borgoaltobedandbreakfast.it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"prova paypal\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/#website\",\"url\":\"https:\/\/www.borgoaltobedandbreakfast.it\/\",\"name\":\"B&amp;B Borgo Alto\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.borgoaltobedandbreakfast.it\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/#organization\",\"name\":\"Borgo Alto B&B\",\"url\":\"https:\/\/www.borgoaltobedandbreakfast.it\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.borgoaltobedandbreakfast.it\/wp-content\/uploads\/2022\/06\/borgo-logo-nero.png\",\"contentUrl\":\"https:\/\/www.borgoaltobedandbreakfast.it\/wp-content\/uploads\/2022\/06\/borgo-logo-nero.png\",\"width\":2413,\"height\":724,\"caption\":\"Borgo Alto B&B\"},\"image\":{\"@id\":\"https:\/\/www.borgoaltobedandbreakfast.it\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"prova paypal - B&amp;B Borgo Alto","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/prova-paypal\/","og_locale":"en_GB","og_type":"article","og_title":"prova paypal - B&amp;B Borgo Alto","og_description":"Pagamento Camera 1 Notte &#8211; 70 EUR2 Notti &#8211; 140 EUR3 Notti &#8211; 210 EUR4 Notti &#8211; 280 EUR5 Notti &#8211; 350 EUR6 Notti &#8211; 420 EUR","og_url":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/prova-paypal\/","og_site_name":"B&amp;B Borgo Alto","article_modified_time":"2022-07-19T10:28:08+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/","url":"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/","name":"prova paypal - B&amp;B Borgo Alto","isPartOf":{"@id":"https:\/\/www.borgoaltobedandbreakfast.it\/#website"},"datePublished":"2022-07-19T10:09:49+00:00","dateModified":"2022-07-19T10:28:08+00:00","breadcrumb":{"@id":"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.borgoaltobedandbreakfast.it\/prova-paypal\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.borgoaltobedandbreakfast.it\/"},{"@type":"ListItem","position":2,"name":"prova paypal"}]},{"@type":"WebSite","@id":"https:\/\/www.borgoaltobedandbreakfast.it\/#website","url":"https:\/\/www.borgoaltobedandbreakfast.it\/","name":"B&amp;B Borgo Alto","description":"","publisher":{"@id":"https:\/\/www.borgoaltobedandbreakfast.it\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.borgoaltobedandbreakfast.it\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/www.borgoaltobedandbreakfast.it\/#organization","name":"Borgo Alto B&B","url":"https:\/\/www.borgoaltobedandbreakfast.it\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.borgoaltobedandbreakfast.it\/#\/schema\/logo\/image\/","url":"https:\/\/www.borgoaltobedandbreakfast.it\/wp-content\/uploads\/2022\/06\/borgo-logo-nero.png","contentUrl":"https:\/\/www.borgoaltobedandbreakfast.it\/wp-content\/uploads\/2022\/06\/borgo-logo-nero.png","width":2413,"height":724,"caption":"Borgo Alto B&B"},"image":{"@id":"https:\/\/www.borgoaltobedandbreakfast.it\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/pages\/1786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/comments?post=1786"}],"version-history":[{"count":22,"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/pages\/1786\/revisions"}],"predecessor-version":[{"id":1808,"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/pages\/1786\/revisions\/1808"}],"wp:attachment":[{"href":"https:\/\/www.borgoaltobedandbreakfast.it\/en\/wp-json\/wp\/v2\/media?parent=1786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}