Changeset 3244360
- Timestamp:
- 02/21/2025 09:39:23 AM (12 months ago)
- Location:
- bookster-paypal/trunk
- Files:
-
- 1 added
- 1 deleted
- 13 edited
-
assets/dist/paypal/@bookster_icons-65b3aaee.js (added)
-
assets/dist/paypal/@wordpress_i18n-d8f34da1.js (deleted)
-
assets/dist/paypal/admin.js (modified) (1 diff)
-
assets/dist/paypal/frontend.js (modified) (1 diff)
-
assets/dist/paypal/style.css (modified) (1 diff)
-
bookster-paypal.php (modified) (2 diffs)
-
languages/bookster-paypal.pot (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
src/Engine/Enqueue.php (modified) (1 diff)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (25 diffs)
-
vendor/composer/InstalledVersions.php (modified) (6 diffs)
-
vendor/composer/autoload_real.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bookster-paypal/trunk/assets/dist/paypal/admin.js
r3135815 r3244360 1 import{R as e,_ as a,a as t,b as l,c as n}from"./@ wordpress_i18n-d8f34da1.js";var o=booksterModules.antd;function r(){const r=o.Form.useFormInstance(),d=o.Form.useWatch(["addonPaymentPaypal","enabled"],r),s=o.Form.useWatch(["addonPaymentPaypal","is_live_mode"],r);return e.createElement(a.ReactCollapsible.Root,{open:d},e.createElement("div",{className:"bw-flex bw-items-center bw-gap-3 bw-bg-base-bg2/60 bw-p-3 bw-pr-4"},e.createElement(o.Form.Item,{name:["addonPaymentPaypal","enabled"],trigger:"onCheckedChange",valuePropName:"checked",noStyle:!0},e.createElement(a.Switch,{checkedChildren:"ON",unCheckedChildren:"OFF",id:"payment-paypal-enabled",onCheckedChange:function(e){const a=n.booksterHooks.applyFilters(n.HOOK_NAMES.settings.validateGatewayEnabledPath,{later:["payment","payment-later","enabled"],now:[]});e&&a.now.forEach((e=>{2===e.length&&"addonPaymentPaypal"===e[0]||r.setFieldValue(e,!1)}))}})),e.createElement(a.Label,{className:"bw-font-medium",htmlFor:"payment-paypal-enabled"},t.__("Paypal","bookster-paypal"))),e.createElement(a.CollapsibleContent,{forceMountWithAnimation:!0},e.createElement("div",{className:"bw-border-t bw-p-3 bw-pr-4"},e.createElement("div",{className:"bw-mb-3 bw-mt-1 bw-flex bw-items-center bw-gap-3"},e.createElement(o.Form.Item,{name:["addonPaymentPaypal","is_live_mode"],valuePropName:"checked",trigger:"onCheckedChange",noStyle:!0},e.createElement(a.Switch,{checkedChildren:"Live",unCheckedChildren:"Sandbox",id:"payment_paypal_is_live_mode",onClick:e=>e.stopPropagation()})),e.createElement(a.Label,{htmlFor:"payment_paypal_is_live_mode"},t.__("Sandbox or Live Mode","bookster-paypal")),e.createElement(a.Button,{className:"bw-ms-auto bw-rounded-full",color:"info",variant:"ghost",size:"icon",asChild:!0},e.createElement("a",{href:"https://developer.paypal.com/api/rest",target:"_blank"},e.createElement(l.HelpCircle,null)))),e.createElement("div",{className:"bw-grid bw-grid-cols-1 bw-gap-x-4 sm:bw-grid-cols-2"},e.createElement("div",null,e.createElement(o.Form.Item,{name:["addonPaymentPaypal","live_client_id"],label:t.__("Live Client Id","bookster-paypal"),hidden:!s,rules:[{required:d&&s}]},e.createElement(a.Input,{placeholder:t.__("Please enter the Client Id","bookster-paypal")})),e.createElement(o.Form.Item,{name:["addonPaymentPaypal","sandbox_client_id"],label:t.__("Sandbox Client Id","bookster-paypal"),hidden:s,rules:[{required:d&&!s}]},e.createElement(a.Input,{placeholder:t.__("Please enter the Client Id","bookster-paypal")}))),e.createElement("div",null,e.createElement(o.Form.Item,{name:["addonPaymentPaypal","live_client_secret"],label:t.__("Live Client Secret","bookster-paypal"),hidden:!s,rules:[{required:d&&s}]},e.createElement(a.PasswordInput,{placeholder:t.__("Please enter the Client Secret","bookster-paypal")})),e.createElement(o.Form.Item,{name:["addonPaymentPaypal","sandbox_client_secret"],label:t.__("Sandbox Client Secret","bookster-paypal"),hidden:s,rules:[{required:d&&!s}]},e.createElement(a.PasswordInput,{placeholder:t.__("Please enter the Client Secret","bookster-paypal")})))))))}n.booksterHooks.addFilter(n.HOOK_NAMES.settings.PaymentGateways,"bookster-paypal",(a=>[...a,e.createElement(r,{key:"bookster-paypal"})]),20),n.booksterHooks.addFilter(n.HOOK_NAMES.settings.validateGatewayEnabledPath,"bookster-paypal",(e=>({later:e.later,now:[...e.now,["addonPaymentPaypal","enabled"]]})),20),n.booksterHooks.addFilter(n.HOOK_NAMES.settings.initPaymentSettingsForm,"bookster-paypal",(e=>({...e,addonPaymentPaypal:window.booksterManagerData.addonPaymentPaypal})),20);1 import{R as e,_ as a,a as t,b as l,c as n}from"./@bookster_icons-65b3aaee.js";var o=booksterModules.antd;function r(){const n=o.Form.useFormInstance(),r=o.Form.useWatch(["addonPaymentPaypal","enabled"],n),s=o.Form.useWatch(["addonPaymentPaypal","is_live_mode"],n);return e.createElement(a.TabsContent,{forceMount:!0,value:"bookster-paypal",className:"bw-border-t bw-px-0 bw-py-4"},e.createElement(o.Form.Item,{name:["addonPaymentPaypal","enabled"],hidden:!0}),e.createElement("div",{className:"bw-mb-1 bw-flex bw-items-center bw-justify-between"},e.createElement("div",{className:"bw-flex bw-items-center"},e.createElement(a.Label,{htmlFor:"payment_paypal_is_live_mode",className:"bw-cursor-pointer bw-text-sm bw-leading-none"},t.__("Sandbox or Live Mode","bookster-paypal")),e.createElement("a",{href:"https://developer.paypal.com/api/rest",target:"_blank"},e.createElement(l.HelpCircle,{className:"bw-ms-1 bw-h-2.5 bw-w-2.5 bw-text-info"}))),e.createElement(o.Form.Item,{name:["addonPaymentPaypal","is_live_mode"],valuePropName:"checked",trigger:"onCheckedChange",noStyle:!0},e.createElement(a.Switch,{id:"payment_paypal_is_live_mode"}))),e.createElement("div",{className:"bw-grid bw-grid-cols-1 bw-gap-x-4 sm:bw-grid-cols-2"},e.createElement("div",null,e.createElement(o.Form.Item,{name:["addonPaymentPaypal","live_client_id"],label:t.__("Live Client Id","bookster-paypal"),hidden:!s,rules:[{required:r&&s}]},e.createElement(a.Input,{placeholder:t.__("Please enter the Client Id","bookster-paypal")})),e.createElement(o.Form.Item,{name:["addonPaymentPaypal","sandbox_client_id"],label:t.__("Sandbox Client Id","bookster-paypal"),hidden:s,rules:[{required:r&&!s}]},e.createElement(a.Input,{placeholder:t.__("Please enter the Client Id","bookster-paypal")}))),e.createElement("div",null,e.createElement(o.Form.Item,{name:["addonPaymentPaypal","live_client_secret"],label:t.__("Live Client Secret","bookster-paypal"),hidden:!s,rules:[{required:r&&s}]},e.createElement(a.PasswordInput,{placeholder:t.__("Please enter the Client Secret","bookster-paypal")})),e.createElement(o.Form.Item,{name:["addonPaymentPaypal","sandbox_client_secret"],label:t.__("Sandbox Client Secret","bookster-paypal"),hidden:s,rules:[{required:r&&!s}]},e.createElement(a.PasswordInput,{placeholder:t.__("Please enter the Client Secret","bookster-paypal")})))))}n.booksterHooks.addFilter(n.HOOK_NAMES.settings.initPaymentSettingsForm,"bookster-paypal",(e=>({...e,addonPaymentPaypal:window.booksterManagerData.addonPaymentPaypal})),30),n.booksterHooks.addFilter(n.HOOK_NAMES.settings.paymentMethods,"bookster-paypal",(e=>[...e,{label:t.__("Paypal","bookster-paypal"),slug:"bookster-paypal",enablePath:["addonPaymentPaypal","enabled"]}]),30),n.booksterHooks.addFilter(n.HOOK_NAMES.settings.PaymentMethodTabsContent,"bookster-paypal",(a=>[...a,e.createElement(r,{key:"bookster-paypal"})]),30); -
bookster-paypal/trunk/assets/dist/paypal/frontend.js
r3161763 r3244360 1 import{r as t,R as e,b as n,_ as a,a as o,c as r}from"./@ wordpress_i18n-d8f34da1.js";var i,c,s,l,u,d;(c=i||(i={})).INITIAL="initial",c.PENDING="pending",c.REJECTED="rejected",c.RESOLVED="resolved",(l=s||(s={})).LOADING_STATUS="setLoadingStatus",l.RESET_OPTIONS="resetOptions",l.SET_BRAINTREE_INSTANCE="braintreeInstance",(d=u||(u={})).NUMBER="number",d.CVV="cvv",d.EXPIRATION_DATE="expirationDate",d.EXPIRATION_MONTH="expirationMonth",d.EXPIRATION_YEAR="expirationYear",d.POSTAL_CODE="postalCode";var p=function(){return p=Object.assign||function(t){for(var e,n=1,a=arguments.length;n<a;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},p.apply(this,arguments)};function m(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(t);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]])}return n}function b(t,e,n){if(n||2===arguments.length)for(var a,o=0,r=e.length;o<r;o++)!a&&o in e||(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return t.concat(a||Array.prototype.slice.call(e))}var f="data-react-paypal-script-id",y="react-paypal-js",w="dataSdkIntegrationSource",E="paypal";function g(t){var e=t,n=f;e[n];var a=m(e,[n+""]);return"react-paypal-js-".concat(function(t){for(var e="",n=0;n<t.length;n++){var a=t[n].charCodeAt(0)*n;t[n+1]&&(a+=t[n+1].charCodeAt(0)*(n-1)),e+=String.fromCharCode(97+Math.abs(a)%26)}return e}(JSON.stringify(a)))}function v(t,e){var n,a,o,r;switch(e.type){case s.LOADING_STATUS:return"object"==typeof e.value?p(p({},t),{loadingStatus:e.value.state,loadingStatusErrorMessage:e.value.message}):p(p({},t),{loadingStatus:e.value});case s.RESET_OPTIONS:return o=t.options[f],(null==(r=self.document.querySelector("script[".concat(f,'="').concat(o,'"]')))?void 0:r.parentNode)&&r.parentNode.removeChild(r),p(p({},t),{loadingStatus:i.PENDING,options:p(p((n={},n[w]=y,n),e.value),(a={},a[f]="".concat(g(e.value)),a))});case s.SET_BRAINTREE_INSTANCE:return p(p({},t),{braintreePayPalCheckoutInstance:e.value});default:return t}}var h=t.createContext(null);t.createContext({});var S=function(n){var a,o=n.className,r=void 0===o?"":o,c=n.disabled,s=void 0!==c&&c,l=n.children,u=n.forceReRender,d=void 0===u?[]:u,f=m(n,["className","disabled","children","forceReRender"]),y=s?{opacity:.38}:{},w="".concat(r," ").concat(s?"paypal-buttons-disabled":"").trim(),g=t.useRef(null),v=t.useRef(null),P=(a=function(t){if("function"==typeof(null==t?void 0:t.dispatch)&&0!==t.dispatch.length)return t;throw new Error("usePayPalScriptReducer must be used within a PayPalScriptProvider")}(t.useContext(h)),[p(p({},a),{isInitial:a.loadingStatus===i.INITIAL,isPending:a.loadingStatus===i.PENDING,isResolved:a.loadingStatus===i.RESOLVED,isRejected:a.loadingStatus===i.REJECTED}),a.dispatch])[0],k=P.isResolved,I=P.options,N=t.useState(null),A=N[0],O=N[1],T=t.useState(!0),C=T[0],j=T[1],R=t.useState(null)[1];function x(){null!==v.current&&v.current.close().catch((function(){}))}return t.useEffect((function(){if(!1===k)return x;var t,e=(void 0===(t=I.dataNamespace)&&(t=E),window[t]);if(void 0===e||void 0===e.Buttons)return R((function(){throw new Error(function(t){var e=t.reactComponentName,n=t.sdkComponentKey,a=t.sdkRequestedComponents,o=void 0===a?"":a,r=t.sdkDataNamespace,i=void 0===r?E:r,c=n.charAt(0).toUpperCase().concat(n.substring(1)),s="Unable to render <".concat(e," /> because window.").concat(i,".").concat(c," is undefined."),l="string"==typeof o?o:o.join(",");if(!l.includes(n)){var u=[l,n].filter(Boolean).join();s+="\nTo fix the issue, add '".concat(n,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(u,"'}}>`.")}return s}({reactComponentName:S.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:I.components,sdkDataNamespace:I.dataNamespace}))})),x;try{v.current=e.Buttons(p(p({},f),{onInit:function(t,e){O(e),"function"==typeof f.onInit&&f.onInit(t,e)}}))}catch(n){return R((function(){throw new Error("Failed to render <PayPalButtons /> component. Failed to initialize: ".concat(n))}))}return!1===v.current.isEligible()?(j(!1),x):g.current?(v.current.render(g.current).catch((function(t){null!==g.current&&0!==g.current.children.length&&R((function(){throw new Error("Failed to render <PayPalButtons /> component. ".concat(t))}))})),x):x}),b(b([k],d,!0),[f.fundingSource],!1)),t.useEffect((function(){null!==A&&(!0===s?A.disable().catch((function(){})):A.enable().catch((function(){})))}),[s,A]),e.createElement(e.Fragment,null,C?e.createElement("div",{ref:g,style:y,className:w}):l)};function P(t,e){void 0===e&&(e={});var n=document.createElement("script");return n.src=t,Object.keys(e).forEach((function(t){n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function k(t){return window[t]}function I(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}S.displayName="PayPalButtons";var N=function(n){var a,o=n.options,r=void 0===o?{clientId:"test"}:o,c=n.children,l=n.deferLoading,u=void 0!==l&&l,d=t.useReducer(v,{options:p(p({},r),(a={},a.dataJsSdkLibrary=y,a[w]=y,a[f]="".concat(g(r)),a)),loadingStatus:u?i.INITIAL:i.PENDING}),m=d[0],b=d[1];return t.useEffect((function(){if(!1===u&&m.loadingStatus===i.INITIAL)return b({type:s.LOADING_STATUS,value:i.PENDING});if(m.loadingStatus===i.PENDING){var t=!0;return function(t,e){if(void 0===e&&(e=Promise),I(t,e),"undefined"==typeof document)return e.resolve(null);var n=function(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseUrl&&(e=t.sdkBaseUrl,delete t.sdkBaseUrl);var n,a,o=t,r=Object.keys(o).filter((function(t){return void 0!==o[t]&&null!==o[t]&&""!==o[t]})).reduce((function(t,e){var n,a=o[e].toString();return n=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)).substring(0,4)||"crossorigin"===e?t.attributes[e]=a:t.queryParams[e]=a,t}),{queryParams:{},attributes:{}}),i=r.queryParams,c=r.attributes;return i["merchant-id"]&&-1!==i["merchant-id"].indexOf(",")&&(c["data-merchant-id"]=i["merchant-id"],i["merchant-id"]="*"),{url:"".concat(e,"?").concat((n=i,a="",Object.keys(n).forEach((function(t){0!==a.length&&(a+="&"),a+=t+"="+n[t]})),a)),attributes:c}}(t),a=n.url,o=n.attributes,r=o["data-namespace"]||"paypal",i=k(r);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var a=P(t,e),o=n.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(a.dataset).length)return null;var r=!0;return Object.keys(o.dataset).forEach((function(t){o.dataset[t]!==a.dataset[t]&&(r=!1)})),r?n:null}(a,o)&&i?e.resolve(i):function(t,e){void 0===e&&(e=Promise),I(t,e);var n=t.url,a=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==a&&"object"!=typeof a)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.onSuccess,n=t.onError,a=P(t.url,t.attributes);a.onerror=n,a.onload=e,document.head.insertBefore(a,document.head.firstElementChild)}({url:n,attributes:a,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(t)}})}))}({url:a,attributes:o},e).then((function(){var t=k(r);if(t)return t;throw new Error("The window.".concat(r," global variable is not available."))}))}(m.options).then((function(){t&&b({type:s.LOADING_STATUS,value:i.RESOLVED})})).catch((function(e){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(e)),t&&b({type:s.LOADING_STATUS,value:{state:i.REJECTED,message:String(e)}})})),function(){t=!1}}}),[m.options,u,m.loadingStatus]),e.createElement(h.Provider,{value:p(p({},m),{dispatch:b})},c)},A=booksterModules.utils;const O=A.CURRENCY.toUpperCase();function T(){return window.booksterPublicData}var C=booksterModules.booking,j=booksterModules.decimal;function R(){return C.useBookingStore()}function x(t,e){const n=R();return A.useStore(n,t,e)}const D="paypalPaymentForm",L={isLoading:!1,transactionId:null,orderId:null,orderAmount:null};function _(){const{bookingDetailsValue:t}=C.useBookingLogic().input;return e.createElement(e.Fragment,null,e.createElement("p",{className:"bw-mb-4 bw-mt-6 bw-flex bw-items-center bw-justify-center bw-gap-1.5 bw-text-sm bw-font-semibold bw-text-success"},e.createElement(n.Lock,{className:"bw-h-3.5 bw-w-3.5"}),e.createElement("span",{className:"bw-overflow-x-auto bw-text-nowrap"},"All transactions are secure, your card information will not be stored.")),e.createElement("div",{className:"bw-rounded-lg bw-bg-base-bg2 bw-px-4 bw-py-2"},"Total booking price:"," ",e.createElement("strong",null,t&&A.formatPrice(t.tax.total))))}function B({children:t,...n}){return e.createElement("div",{className:"bw-relative bw-mb-4 bw-rounded bw-border bw-border-error/80 bw-bg-error/10 bw-px-4 bw-py-3 bw-text-error",...n},e.createElement("span",{className:"bw-block sm:bw-inline"},t))}function M(){const r=R(),i=x((t=>t.select.contact)),{isLoading:c}=x((t=>t.addonPaymentPaypal)),s=C.useBookingLogic(),{apptInput:l,transactionInput:u,bookingMetaInput:d,bookingDetailsValue:p}=s.input,m=s.process,[b,f]=t.useState(null);if(!(p&&l&&u&&i&&d))throw new Error("Sorry, Your Booking Selection is not Complete!");return e.createElement(e.Fragment,null,e.createElement(C.MainHeader,null),e.createElement(a.ScrollArea,{className:"btr-main-scrollarea bw-flex-grow"},e.createElement(a.XyzTransition,{appear:!0,xyz:"fade down-4"},e.createElement("div",{className:"bw-mx-auto bw-flex bw-min-h-[30rem] bw-max-w-[34rem] bw-flex-col bw-justify-center bw-p-4 bw-pt-8"},e.createElement("div",{className:"bw-flex-none"},b&&e.createElement(B,null,b),e.createElement(S,{style:{layout:"vertical"},createOrder:async()=>{const{orderAmount:t,orderId:e,transactionId:n}=r.getState().addonPaymentPaypal,a=p.tax.total;if(e&&t&&t.equals(a))return e;try{const t={apptInput:l,transactionInput:u,contactInput:i,bookingMetaInput:d||{}};if(e&&n){const o=await async function(t,e){return await A.api.patch("paypal/orders/amount",{json:{bookingRequestInput:e,transactionId:t}}).json()}(n,t);if(!a.equals(j.Decimal.fromString(o.orderAmount)))throw new Error("Sorry, Cannot calculate your Checkout!");return r.setState((t=>{t.addonPaymentPaypal.orderAmount=j.Decimal.fromString(o.orderAmount)})),e}{const e=await async function(t){return await A.api.post("paypal/orders",{json:{bookingRequestInput:t}}).json()}(t);if(!a.equals(j.Decimal.fromString(e.orderAmount)))throw new Error("Sorry, Cannot calculate your Checkout!");return r.setState((t=>{t.addonPaymentPaypal.orderAmount=a,t.addonPaymentPaypal.transactionId=e.transactionId,t.addonPaymentPaypal.orderId=e.orderId})),e.orderId}}catch(o){throw f(await A.getErrorMsg(o)),o}},onApprove:async()=>{const{orderId:t,transactionId:e}=r.getState().addonPaymentPaypal;try{if(r.setState((t=>{t.addonPaymentPaypal.isLoading=!0})),!t||!e)throw"Paypal Order Missing!";await async function(t){return await A.api.patch("paypal/orders/capture",{json:{transactionId:t}}).json()}(e);const{appointment:n,transaction:a,customer:o}=await A.requestBooking({apptInput:l,bookingMetaInput:d,transactionInput:u,contactInput:i});r.setState((t=>{t.booked.state="success",t.booked.appointment=n,t.booked.transaction=a,t.booked.customer=o})),m.mutate.nextAct()}catch(n){throw f(await A.getErrorMsg(n)),n}finally{r.setState((t=>{t.addonPaymentPaypal.isLoading=!1}))}}}),e.createElement(_,null),e.createElement(a.LoadingOverlay,{className:"-bw-inset-4 bw-z-[10000] bw-text-lg bw-font-medium bw-text-base-foreground/80 bw-opacity-80",loading:c},e.createElement(n.Loader2,{className:"bw-mr-4 bw-h-6 bw-w-6 bw-animate-spin"}),o.__("Booking your Appointment!","bookster-paypal")))))),e.createElement(C.MainFooter,{prevButton:e.createElement(a.Button,{key:"paypal-prev-btn",className:"bw-pl-0",variant:"link",disabled:c,onClick:()=>m.mutate.prevAct()},e.createElement(n.ArrowLeft,null),"Back")}))}function F(t){return e.createElement("div",{...t},e.createElement(N,{options:{clientId:T().addonPaymentPaypal.client_id,intent:"capture",components:"buttons",currency:O}},e.createElement(M,null)))}"payment-paypal"===T().paymentGateway.now&&(r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingConfig,"bookster-paypal",(function(t){const e=t.process.steps.map((t=>"checkout"===t.name?{...t,acts:[...t.acts,D]}:t));return{...t,process:{...t.process,steps:e}}})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingParts,"bookster-paypal",(function(t,n,a,o){return o.process.computed.act===D?{...t,main:{key:"paypal-payment-form",node:e.createElement(F,null)}}:t})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingInitState,"bookster-paypal",(function(t){return{...t,addonPaymentPaypal:L}})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingLogic,"bookster-paypal",(function(t,e,n){const{transactionId:a}=n.addonPaymentPaypal;return null!==a&&t.input.transactionInput&&(t.input.transactionInput.transactionId=a),t})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.mutatePrevAct,"bookster-paypal",(function(t,e,n,{newPhase:a,oldPhase:o}){return a!==o&&"complete"===o&&(e.addonPaymentPaypal=L),t})));1 import{r as t,R as e,b as n,_ as a,a as o,c as r}from"./@bookster_icons-65b3aaee.js";var i,c,s,l,u,d;(c=i||(i={})).INITIAL="initial",c.PENDING="pending",c.REJECTED="rejected",c.RESOLVED="resolved",(l=s||(s={})).LOADING_STATUS="setLoadingStatus",l.RESET_OPTIONS="resetOptions",l.SET_BRAINTREE_INSTANCE="braintreeInstance",(d=u||(u={})).NUMBER="number",d.CVV="cvv",d.EXPIRATION_DATE="expirationDate",d.EXPIRATION_MONTH="expirationMonth",d.EXPIRATION_YEAR="expirationYear",d.POSTAL_CODE="postalCode";var p=function(){return p=Object.assign||function(t){for(var e,n=1,a=arguments.length;n<a;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},p.apply(this,arguments)};function m(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(t);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]])}return n}function b(t,e,n){if(n||2===arguments.length)for(var a,o=0,r=e.length;o<r;o++)!a&&o in e||(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return t.concat(a||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var f="data-react-paypal-script-id",y="react-paypal-js",w="dataSdkIntegrationSource",E="paypal";function g(t){var e=t,n=f;e[n];var a=m(e,[n+""]);return"react-paypal-js-".concat(function(t){for(var e="",n=0;n<t.length;n++){var a=t[n].charCodeAt(0)*n;t[n+1]&&(a+=t[n+1].charCodeAt(0)*(n-1)),e+=String.fromCharCode(97+Math.abs(a)%26)}return e}(JSON.stringify(a)))}function v(t,e){var n,a,o,r;switch(e.type){case s.LOADING_STATUS:return"object"==typeof e.value?p(p({},t),{loadingStatus:e.value.state,loadingStatusErrorMessage:e.value.message}):p(p({},t),{loadingStatus:e.value});case s.RESET_OPTIONS:return o=t.options[f],(null==(r=self.document.querySelector("script[".concat(f,'="').concat(o,'"]')))?void 0:r.parentNode)&&r.parentNode.removeChild(r),p(p({},t),{loadingStatus:i.PENDING,options:p(p((n={},n[w]=y,n),e.value),(a={},a[f]="".concat(g(e.value)),a))});case s.SET_BRAINTREE_INSTANCE:return p(p({},t),{braintreePayPalCheckoutInstance:e.value});default:return t}}var h=t.createContext(null);t.createContext({});var S=function(n){var a,o,r=n.className,c=void 0===r?"":r,s=n.disabled,l=void 0!==s&&s,u=n.children,d=n.forceReRender,f=void 0===d?[]:d,y=m(n,["className","disabled","children","forceReRender"]),w=l?{opacity:.38}:{},g="".concat(c," ").concat(l?"paypal-buttons-disabled":"").trim(),v=t.useRef(null),P=t.useRef(null),k=(o=function(t){if("function"==typeof(null==t?void 0:t.dispatch)&&0!==t.dispatch.length)return t;throw new Error("usePayPalScriptReducer must be used within a PayPalScriptProvider")}(t.useContext(h)),[p(p({},o),{isInitial:o.loadingStatus===i.INITIAL,isPending:o.loadingStatus===i.PENDING,isResolved:o.loadingStatus===i.RESOLVED,isRejected:o.loadingStatus===i.REJECTED}),o.dispatch])[0],I=k.isResolved,N=k.options,A=t.useState(null),O=A[0],T=A[1],x=t.useState(!0),C=x[0],j=x[1],R=t.useState(null)[1];function D(){null!==P.current&&P.current.close().catch((function(){}))}return(null===(a=P.current)||void 0===a?void 0:a.updateProps)&&P.current.updateProps({message:y.message}),t.useEffect((function(){if(!1===I)return D;var t,e=(void 0===(t=N.dataNamespace)&&(t=E),window[t]);if(void 0===e||void 0===e.Buttons)return R((function(){throw new Error(function(t){var e=t.reactComponentName,n=t.sdkComponentKey,a=t.sdkRequestedComponents,o=void 0===a?"":a,r=t.sdkDataNamespace,i=void 0===r?E:r,c=n.charAt(0).toUpperCase().concat(n.substring(1)),s="Unable to render <".concat(e," /> because window.").concat(i,".").concat(c," is undefined."),l="string"==typeof o?o:o.join(",");if(!l.includes(n)){var u=[l,n].filter(Boolean).join();s+="\nTo fix the issue, add '".concat(n,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(u,"'}}>`.")}return s}({reactComponentName:S.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:N.components,sdkDataNamespace:N.dataNamespace}))})),D;try{P.current=e.Buttons(p(p({},y),{onInit:function(t,e){T(e),"function"==typeof y.onInit&&y.onInit(t,e)}}))}catch(n){return R((function(){throw new Error("Failed to render <PayPalButtons /> component. Failed to initialize: ".concat(n))}))}return!1===P.current.isEligible()?(j(!1),D):v.current?(P.current.render(v.current).catch((function(t){null!==v.current&&0!==v.current.children.length&&R((function(){throw new Error("Failed to render <PayPalButtons /> component. ".concat(t))}))})),D):D}),b(b([I],f,!0),[y.fundingSource],!1)),t.useEffect((function(){null!==O&&(!0===l?O.disable().catch((function(){})):O.enable().catch((function(){})))}),[l,O]),e.createElement(e.Fragment,null,C?e.createElement("div",{ref:v,style:w,className:g}):u)};function P(t,e){void 0===e&&(e={});var n=document.createElement("script");return n.src=t,Object.keys(e).forEach((function(t){n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function k(t){return window[t]}function I(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var n=t.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}S.displayName="PayPalButtons";var N=function(n){var a,o=n.options,r=void 0===o?{clientId:"test"}:o,c=n.children,l=n.deferLoading,u=void 0!==l&&l,d=t.useReducer(v,{options:p(p({},r),(a={},a.dataJsSdkLibrary=y,a[w]=y,a[f]="".concat(g(r)),a)),loadingStatus:u?i.INITIAL:i.PENDING}),m=d[0],b=d[1];return t.useEffect((function(){if(!1===u&&m.loadingStatus===i.INITIAL)return b({type:s.LOADING_STATUS,value:i.PENDING});if(m.loadingStatus===i.PENDING){var t=!0;return function(t,e){if(void 0===e&&(e=Promise),I(t,e),"undefined"==typeof document)return e.resolve(null);var n=function(t){var e="sandbox"===t.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete t.environment,t.sdkBaseUrl&&(e=t.sdkBaseUrl,delete t.sdkBaseUrl);var n,a,o=t,r=Object.keys(o).filter((function(t){return void 0!==o[t]&&null!==o[t]&&""!==o[t]})).reduce((function(t,e){var n,a=o[e].toString();return n=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)).substring(0,4)||"crossorigin"===e?t.attributes[e]=a:t.queryParams[e]=a,t}),{queryParams:{},attributes:{}}),i=r.queryParams,c=r.attributes;return i["merchant-id"]&&-1!==i["merchant-id"].indexOf(",")&&(c["data-merchant-id"]=i["merchant-id"],i["merchant-id"]="*"),{url:"".concat(e,"?").concat((n=i,a="",Object.keys(n).forEach((function(t){0!==a.length&&(a+="&"),a+=t+"="+n[t]})),a)),attributes:c}}(t),a=n.url,o=n.attributes,r=o["data-namespace"]||"paypal",i=k(r);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var a=P(t,e),o=n.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(a.dataset).length)return null;var r=!0;return Object.keys(o.dataset).forEach((function(t){o.dataset[t]!==a.dataset[t]&&(r=!1)})),r?n:null}(a,o)&&i?e.resolve(i):function(t,e){void 0===e&&(e=Promise),I(t,e);var n=t.url,a=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==a&&"object"!=typeof a)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.onSuccess,n=t.onError,a=P(t.url,t.attributes);a.onerror=n,a.onload=e,document.head.insertBefore(a,document.head.firstElementChild)}({url:n,attributes:a,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(t)}})}))}({url:a,attributes:o},e).then((function(){var t=k(r);if(t)return t;throw new Error("The window.".concat(r," global variable is not available."))}))}(m.options).then((function(){t&&b({type:s.LOADING_STATUS,value:i.RESOLVED})})).catch((function(e){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(e)),t&&b({type:s.LOADING_STATUS,value:{state:i.REJECTED,message:String(e)}})})),function(){t=!1}}}),[m.options,u,m.loadingStatus]),e.createElement(h.Provider,{value:p(p({},m),{dispatch:b})},c)};function A(){}t.createContext({cardFieldsForm:null,fields:{},registerField:A,unregisterField:A});var O=booksterModules.utils;const T=O.CURRENCY.toUpperCase();function x(){return window.booksterPublicData}var C=booksterModules.booking,j=booksterModules.decimal;function R(){return C.useBookingStore()}function D(t,e){const n=R();return O.useStore(n,t,e)}const L="paypalPaymentForm",_={isLoading:!1,transactionId:null,orderId:null,orderAmount:null};function F(){const{bookingDetailsValue:t}=C.useBookingLogic().input;return e.createElement(e.Fragment,null,e.createElement("p",{className:"bw-mb-4 bw-mt-6 bw-flex bw-items-center bw-justify-center bw-gap-1.5 bw-text-sm bw-font-semibold bw-text-success"},e.createElement(n.Lock,{className:"bw-h-3.5 bw-w-3.5"}),e.createElement("span",{className:"bw-overflow-x-auto bw-text-nowrap"},"All transactions are secure, your card information will not be stored.")),e.createElement("div",{className:"bw-rounded-lg bw-bg-gray-50 bw-px-4 bw-py-2"},"Total booking price:"," ",e.createElement("strong",null,t&&O.formatPrice(t.tax.total))))}function B({children:t,...n}){return e.createElement("div",{className:"bw-relative bw-mb-4 bw-rounded bw-border bw-border-error/80 bw-bg-error/10 bw-px-4 bw-py-3 bw-text-error",...n},e.createElement("span",{className:"bw-block sm:bw-inline"},t))}function M(){const r=R(),i=D((t=>t.select.contact)),{isLoading:c}=D((t=>t.addonPaymentPaypal)),s=C.useBookingLogic(),{apptInput:l,transactionInput:u,bookingMetaInput:d,bookingDetailsValue:p}=s.input,m=s.process,[b,f]=t.useState(null);if(!(p&&l&&u&&i&&d))throw new Error("Sorry, Your Booking Selection is not Complete!");return e.createElement(e.Fragment,null,e.createElement(C.MainHeader,null),e.createElement(a.ScrollArea,{className:"btr-main-scrollarea bw-flex-grow"},e.createElement(a.XyzTransition,{appear:!0,xyz:"fade down-4"},e.createElement("div",{className:"bw-mx-auto bw-flex bw-min-h-[30rem] bw-max-w-[34rem] bw-flex-col bw-justify-center bw-p-4 bw-pt-8"},e.createElement("div",{className:"bw-flex-none"},b&&e.createElement(B,null,b),e.createElement(S,{style:{layout:"vertical"},createOrder:async()=>{const{orderAmount:t,orderId:e,transactionId:n}=r.getState().addonPaymentPaypal,a=p.tax.total;if(e&&t&&t.equals(a))return e;try{const t={apptInput:l,transactionInput:u,contactInput:i,bookingMetaInput:d||{}};if(e&&n){const o=await async function(t,e){return await O.api.patch("paypal/orders/amount",{json:{bookingRequestInput:e,transactionId:t}}).json()}(n,t);if(!a.equals(j.Decimal.fromString(o.orderAmount)))throw new Error("Sorry, Cannot calculate your Checkout!");return r.setState((t=>{t.addonPaymentPaypal.orderAmount=j.Decimal.fromString(o.orderAmount)})),e}{const e=await async function(t){return await O.api.post("paypal/orders",{json:{bookingRequestInput:t}}).json()}(t);if(!a.equals(j.Decimal.fromString(e.orderAmount)))throw new Error("Sorry, Cannot calculate your Checkout!");return r.setState((t=>{t.addonPaymentPaypal.orderAmount=a,t.addonPaymentPaypal.transactionId=e.transactionId,t.addonPaymentPaypal.orderId=e.orderId})),e.orderId}}catch(o){throw f(await O.getErrorMsg(o)),o}},onApprove:async()=>{const{orderId:t,transactionId:e}=r.getState().addonPaymentPaypal;try{if(r.setState((t=>{t.addonPaymentPaypal.isLoading=!0})),!t||!e)throw"Paypal Order Missing!";await async function(t){return await O.api.patch("paypal/orders/capture",{json:{transactionId:t}}).json()}(e);const{appointment:n,transaction:a,customer:o}=await O.requestBooking({apptInput:l,bookingMetaInput:d,transactionInput:u,contactInput:i});r.setState((t=>{t.booked.state="success",t.booked.appointment=n,t.booked.transaction=a,t.booked.customer=o})),m.mutate.nextAct()}catch(n){throw f(await O.getErrorMsg(n)),n}finally{r.setState((t=>{t.addonPaymentPaypal.isLoading=!1}))}}}),e.createElement(F,null),e.createElement(a.LoadingOverlay,{className:"-bw-inset-4 bw-z-[10000] bw-text-lg bw-font-medium bw-text-gray-500 bw-opacity-80",loading:c},e.createElement(n.Loader2,{className:"bw-mr-4 bw-h-6 bw-w-6 bw-animate-spin"}),o.__("Booking your Appointment!","bookster-paypal")))))),e.createElement(C.MainFooter,{prevButton:e.createElement(a.Button,{key:"paypal-prev-btn",className:"bw-me-auto bw-pl-0",variant:"link",disabled:c,onClick:()=>m.mutate.prevAct()},e.createElement(n.ArrowLeft,null),"Back")}))}function q(t){return e.createElement("div",{...t},e.createElement(N,{options:{clientId:x().addonPaymentPaypal.client_id,intent:"capture",components:"buttons",currency:T}},e.createElement(M,null)))}"payment-paypal"===x().paymentGateway.now&&(r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingConfig,"bookster-paypal",(function(t){const e=t.process.steps.map((t=>"checkout"===t.name?{...t,acts:[...t.acts,L]}:t));return{...t,process:{...t.process,steps:e}}})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingParts,"bookster-paypal",(function(t,n,a,o){return o.process.computed.act===L?{...t,main:{key:"paypal-payment-form",node:e.createElement(q,null)}}:t})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingInitState,"bookster-paypal",(function(t){return{...t,addonPaymentPaypal:_}})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.bookingLogic,"bookster-paypal",(function(t,e,n){const{transactionId:a}=n.addonPaymentPaypal;return null!==a&&t.input.transactionInput&&(t.input.transactionInput.transactionId=a),t})),r.booksterHooks.addFilter(r.HOOK_NAMES.bookingForm.mutatePrevAct,"bookster-paypal",(function(t,e,n,{newPhase:a,oldPhase:o}){return a!==o&&"complete"===o&&(e.addonPaymentPaypal=_),t}))); -
bookster-paypal/trunk/assets/dist/paypal/style.css
r3135815 r3244360 1 div.bookster-root .-bw-inset-4{top:-1rem;right:-1rem;bottom:-1rem;left:-1rem}div.bookster-root .bw-z-\[10000\]{z-index:10000}div.bookster-root .bw-h- 3\.5{height:.875rem}div.bookster-root .bw-min-h-\[30rem\]{min-height:30rem}div.bookster-root .bw-w-3\.5{width:.875rem}div.bookster-root .bw-max-w-\[34rem\]{max-width:34rem}@keyframes bw-spin{to{transform:rotate(1turn)}}div.bookster-root .bw-animate-spin{animation:bw-spin 1s linear infinite}div.bookster-root .bw-gap-1\.5{gap:.375rem}div.bookster-root .bw-gap-x-4{-moz-column-gap:1rem;column-gap:1rem}div.bookster-root .bw-overflow-x-auto{overflow-x:auto}div.bookster-root .bw-text-nowrap{text-wrap:nowrap}div.bookster-root .bw-bg-base-bg2\/60{background-color:rgb(var(--btr-bbg2)/.6)}div.bookster-root .bw-bg-error\/10{background-color:rgb(var(--btr-er)/.1)}div.bookster-root .bw-opacity-80{opacity:.8}@media (min-width:576px){div.bookster-root .sm\:bw-inline{display:inline}div.bookster-root .sm\:bw-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}1 div.bookster-root .-bw-inset-4{top:-1rem;right:-1rem;bottom:-1rem;left:-1rem}div.bookster-root .bw-z-\[10000\]{z-index:10000}div.bookster-root .bw-h-2\.5{height:.625rem}div.bookster-root .bw-h-3\.5{height:.875rem}div.bookster-root .bw-min-h-\[30rem\]{min-height:30rem}div.bookster-root .bw-w-2\.5{width:.625rem}div.bookster-root .bw-w-3\.5{width:.875rem}div.bookster-root .bw-max-w-\[34rem\]{max-width:34rem}@keyframes bw-spin{to{transform:rotate(1turn)}}div.bookster-root .bw-animate-spin{animation:bw-spin 1s linear infinite}div.bookster-root .bw-gap-1\.5{gap:.375rem}div.bookster-root .bw-gap-x-4{-moz-column-gap:1rem;column-gap:1rem}div.bookster-root .bw-overflow-x-auto{overflow-x:auto}div.bookster-root .bw-text-nowrap{text-wrap:nowrap}div.bookster-root .bw-bg-error\/10{background-color:rgb(var(--btr-er)/.1)}div.bookster-root .bw-opacity-80{opacity:.8}@media (min-width:576px){div.bookster-root .sm\:bw-inline{display:inline}div.bookster-root .sm\:bw-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}} -
bookster-paypal/trunk/bookster-paypal.php
r3161763 r3244360 13 13 * Requires Plugins: bookster 14 14 * Description: Official Bookster Paypal addon - Intergrate Paypal Payment to your Bookings. 15 * Version: 2. 0.015 * Version: 2.1.0 16 16 * Requires at least: 6.2 17 17 * Requires PHP: 7.4 … … 27 27 } 28 28 29 define( 'BOOKSTER_PAYPAL_VERSION', '2. 0.0' );29 define( 'BOOKSTER_PAYPAL_VERSION', '2.1.0' ); 30 30 31 31 define( 'BOOKSTER_PAYPAL_PLUGIN_FILE', __FILE__ ); -
bookster-paypal/trunk/languages/bookster-paypal.pot
r3161763 r3244360 1 # Copyright (C) 202 4WPBookster1 # Copyright (C) 2025 WPBookster 2 2 # This file is distributed under the GPL v3 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Bookster Paypal 1.1.0\n"5 "Project-Id-Version: Bookster Paypal 2.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bookster-paypal\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-09-26T08:09:20+00:00\n"12 "POT-Creation-Date: 2025-02-17T01:57:32+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 6.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "X-Domain: bookster-paypal\n" 16 16 17 17 #. Plugin Name of the plugin 18 #: bookster-paypal.php 18 19 msgid "Bookster Paypal" 19 20 msgstr "" 20 21 21 22 #. Plugin URI of the plugin 23 #: bookster-paypal.php 22 24 msgid "https://wpbookster.com/" 23 25 msgstr "" 24 26 25 27 #. Description of the plugin 28 #: bookster-paypal.php 26 29 msgid "Official Bookster Paypal addon - Intergrate Paypal Payment to your Bookings." 27 30 msgstr "" 28 31 29 32 #. Author of the plugin 33 #: bookster-paypal.php 30 34 msgid "WPBookster" 31 35 msgstr "" 32 36 33 37 #. Author URI of the plugin 38 #: bookster-paypal.php 34 39 msgid "https://wpbookster.com/about" 35 40 msgstr "" … … 51 56 #: src/Engine/PaypalSettings.php:59 52 57 msgid "Settings" 53 msgstr ""54 55 #: assets/dist/paypal/admin.js:156 msgid "Paypal"57 58 msgstr "" 58 59 … … 85 86 msgstr "" 86 87 88 #: assets/dist/paypal/admin.js:1 89 msgid "Paypal" 90 msgstr "" 91 87 92 #: assets/dist/paypal/frontend.js:1 88 93 msgid "Booking your Appointment!" -
bookster-paypal/trunk/readme.txt
r3161763 r3244360 4 4 Tags: online payments, appointments, paypal, payments, checkout 5 5 Requires at least: 5.2 6 Tested up to: 6. 67 Stable tag: 2. 0.06 Tested up to: 6.7.2 7 Stable tag: 2.1.0 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 54 54 == Changelog == 55 55 56 = Feb 21, 2025 – Version 2.1.0 = 57 - Improved: Compatible with Bookster version 2.1.0 58 - Improved: UI/UX 59 56 60 = Oct 2, 2024 - Version 2.0.0 = 57 61 - Added: Compatibility with Bookster v2.0.0 -
bookster-paypal/trunk/src/Engine/Enqueue.php
r3135815 r3244360 39 39 $deps = [ ScriptName::LIB_CORE, ScriptName::LIB_ICONS, ScriptName::LIB_COMPONENTS, ScriptName::LIB_BOOKING, 'react', 'react-dom', 'wp-hooks', 'wp-i18n' ]; 40 40 41 wp_register_script( self::FRONTEND_SCRIPT, BOOKSTER_PAYPAL_PLUGIN_URL . 'assets/dist/paypal/frontend.js', $deps, BOOKSTER_PAYPAL_VERSION, false );41 wp_register_script( self::FRONTEND_SCRIPT, BOOKSTER_PAYPAL_PLUGIN_URL . 'assets/dist/paypal/frontend.js', $deps, BOOKSTER_PAYPAL_VERSION, true ); 42 42 wp_set_script_translations( self::FRONTEND_SCRIPT, 'bookster-paypal', BOOKSTER_PAYPAL_PLUGIN_PATH . 'languages' ); 43 43 44 wp_register_script( self::ADMIN_SCRIPT, BOOKSTER_PAYPAL_PLUGIN_URL . 'assets/dist/paypal/admin.js', $deps, BOOKSTER_PAYPAL_VERSION, false );44 wp_register_script( self::ADMIN_SCRIPT, BOOKSTER_PAYPAL_PLUGIN_URL . 'assets/dist/paypal/admin.js', $deps, BOOKSTER_PAYPAL_VERSION, true ); 45 45 wp_set_script_translations( self::ADMIN_SCRIPT, 'bookster-paypal', BOOKSTER_PAYPAL_PLUGIN_PATH . 'languages' ); 46 46 } -
bookster-paypal/trunk/vendor/autoload.php
r3120716 r3244360 4 4 5 5 if (PHP_VERSION_ID < 50600) { 6 echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; 7 exit(1); 6 if (!headers_sent()) { 7 header('HTTP/1.1 500 Internal Server Error'); 8 } 9 $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; 10 if (!ini_get('display_errors')) { 11 if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 12 fwrite(STDERR, $err); 13 } elseif (!headers_sent()) { 14 echo $err; 15 } 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 8 21 } 9 22 10 23 require_once __DIR__ . '/composer/autoload_real.php'; 11 24 12 return ComposerAutoloaderInitb a5ec13b608a9d093bc629ca1333162d::getLoader();25 return ComposerAutoloaderInitbdefbc1b05bb26f9e417e43e41232339::getLoader(); -
bookster-paypal/trunk/vendor/composer/ClassLoader.php
r3120716 r3244360 43 43 class ClassLoader 44 44 { 45 /** @var ?string */ 45 /** @var \Closure(string):void */ 46 private static $includeFile; 47 48 /** @var string|null */ 46 49 private $vendorDir; 47 50 48 51 // PSR-4 49 52 /** 50 * @var array[] 51 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 52 54 */ 53 55 private $prefixLengthsPsr4 = array(); 54 56 /** 55 * @var array[] 56 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 57 58 */ 58 59 private $prefixDirsPsr4 = array(); 59 60 /** 60 * @var array[] 61 * @psalm-var array<string, string> 61 * @var list<string> 62 62 */ 63 63 private $fallbackDirsPsr4 = array(); … … 65 65 // PSR-0 66 66 /** 67 * @var array[] 68 * @psalm-var array<string, array<string, string[]>> 67 * List of PSR-0 prefixes 68 * 69 * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) 70 * 71 * @var array<string, array<string, list<string>>> 69 72 */ 70 73 private $prefixesPsr0 = array(); 71 74 /** 72 * @var array[] 73 * @psalm-var array<string, string> 75 * @var list<string> 74 76 */ 75 77 private $fallbackDirsPsr0 = array(); … … 79 81 80 82 /** 81 * @var string[] 82 * @psalm-var array<string, string> 83 * @var array<string, string> 83 84 */ 84 85 private $classMap = array(); … … 88 89 89 90 /** 90 * @var bool[] 91 * @psalm-var array<string, bool> 91 * @var array<string, bool> 92 92 */ 93 93 private $missingClasses = array(); 94 94 95 /** @var ?string*/95 /** @var string|null */ 96 96 private $apcuPrefix; 97 97 98 98 /** 99 * @var self[]99 * @var array<string, self> 100 100 */ 101 101 private static $registeredLoaders = array(); 102 102 103 103 /** 104 * @param ?string$vendorDir104 * @param string|null $vendorDir 105 105 */ 106 106 public function __construct($vendorDir = null) 107 107 { 108 108 $this->vendorDir = $vendorDir; 109 } 110 111 /** 112 * @return string[] 109 self::initializeIncludeClosure(); 110 } 111 112 /** 113 * @return array<string, list<string>> 113 114 */ 114 115 public function getPrefixes() … … 122 123 123 124 /** 124 * @return array[] 125 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 126 126 */ 127 127 public function getPrefixesPsr4() … … 131 131 132 132 /** 133 * @return array[] 134 * @psalm-return array<string, string> 133 * @return list<string> 135 134 */ 136 135 public function getFallbackDirs() … … 140 139 141 140 /** 142 * @return array[] 143 * @psalm-return array<string, string> 141 * @return list<string> 144 142 */ 145 143 public function getFallbackDirsPsr4() … … 149 147 150 148 /** 151 * @return string[] Array of classname => path 152 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 153 150 */ 154 151 public function getClassMap() … … 158 155 159 156 /** 160 * @param string[] $classMap Class to filename map 161 * @psalm-param array<string, string> $classMap 157 * @param array<string, string> $classMap Class to filename map 162 158 * 163 159 * @return void … … 176 172 * appending or prepending to the ones previously set for this prefix. 177 173 * 178 * @param string $prefix The prefix179 * @param string[]|string $paths The PSR-0 root directories180 * @param bool $prepend Whether to prepend the directories174 * @param string $prefix The prefix 175 * @param list<string>|string $paths The PSR-0 root directories 176 * @param bool $prepend Whether to prepend the directories 181 177 * 182 178 * @return void … … 184 180 public function add($prefix, $paths, $prepend = false) 185 181 { 182 $paths = (array) $paths; 186 183 if (!$prefix) { 187 184 if ($prepend) { 188 185 $this->fallbackDirsPsr0 = array_merge( 189 (array)$paths,186 $paths, 190 187 $this->fallbackDirsPsr0 191 188 ); … … 193 190 $this->fallbackDirsPsr0 = array_merge( 194 191 $this->fallbackDirsPsr0, 195 (array)$paths192 $paths 196 193 ); 197 194 } … … 202 199 $first = $prefix[0]; 203 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 204 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 205 202 206 203 return; … … 208 205 if ($prepend) { 209 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 210 (array)$paths,207 $paths, 211 208 $this->prefixesPsr0[$first][$prefix] 212 209 ); … … 214 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 215 212 $this->prefixesPsr0[$first][$prefix], 216 (array)$paths213 $paths 217 214 ); 218 215 } … … 223 220 * appending or prepending to the ones previously set for this namespace. 224 221 * 225 * @param string $prefix The prefix/namespace, with trailing '\\'226 * @param string[]|string $paths The PSR-4 base directories227 * @param bool $prepend Whether to prepend the directories222 * @param string $prefix The prefix/namespace, with trailing '\\' 223 * @param list<string>|string $paths The PSR-4 base directories 224 * @param bool $prepend Whether to prepend the directories 228 225 * 229 226 * @throws \InvalidArgumentException … … 233 230 public function addPsr4($prefix, $paths, $prepend = false) 234 231 { 232 $paths = (array) $paths; 235 233 if (!$prefix) { 236 234 // Register directories for the root namespace. 237 235 if ($prepend) { 238 236 $this->fallbackDirsPsr4 = array_merge( 239 (array)$paths,237 $paths, 240 238 $this->fallbackDirsPsr4 241 239 ); … … 243 241 $this->fallbackDirsPsr4 = array_merge( 244 242 $this->fallbackDirsPsr4, 245 (array)$paths243 $paths 246 244 ); 247 245 } … … 253 251 } 254 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 255 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 256 254 } elseif ($prepend) { 257 255 // Prepend directories for an already registered namespace. 258 256 $this->prefixDirsPsr4[$prefix] = array_merge( 259 (array)$paths,257 $paths, 260 258 $this->prefixDirsPsr4[$prefix] 261 259 ); … … 264 262 $this->prefixDirsPsr4[$prefix] = array_merge( 265 263 $this->prefixDirsPsr4[$prefix], 266 (array)$paths264 $paths 267 265 ); 268 266 } … … 273 271 * replacing any others previously set for this prefix. 274 272 * 275 * @param string $prefix The prefix276 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 277 275 * 278 276 * @return void … … 291 289 * replacing any others previously set for this namespace. 292 290 * 293 * @param string $prefix The prefix/namespace, with trailing '\\'294 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 295 293 * 296 294 * @throws \InvalidArgumentException … … 426 424 { 427 425 if ($file = $this->findFile($class)) { 428 includeFile($file); 426 $includeFile = self::$includeFile; 427 $includeFile($file); 429 428 430 429 return true; … … 477 476 478 477 /** 479 * Returns the currently registered loaders indexed by their corresponding vendor directories.480 * 481 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 482 481 */ 483 482 public static function getRegisteredLoaders() … … 556 555 return false; 557 556 } 557 558 /** 559 * @return void 560 */ 561 private static function initializeIncludeClosure() 562 { 563 if (self::$includeFile !== null) { 564 return; 565 } 566 567 /** 568 * Scope isolated include. 569 * 570 * Prevents access to $this/self from included files. 571 * 572 * @param string $file 573 * @return void 574 */ 575 self::$includeFile = \Closure::bind(static function($file) { 576 include $file; 577 }, null, null); 578 } 558 579 } 559 560 /**561 * Scope isolated include.562 *563 * Prevents access to $this/self from included files.564 *565 * @param string $file566 * @return void567 * @private568 */569 function includeFile($file)570 {571 include $file;572 } -
bookster-paypal/trunk/vendor/composer/InstalledVersions.php
r3120716 r3244360 34 34 35 35 /** 36 * @var bool 37 */ 38 private static $installedIsLocalDir; 39 40 /** 36 41 * @var bool|null 37 42 */ … … 99 104 foreach (self::getInstalled() as $installed) { 100 105 if (isset($installed['versions'][$packageName])) { 101 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);106 return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; 102 107 } 103 108 } … … 120 125 public static function satisfies(VersionParser $parser, $packageName, $constraint) 121 126 { 122 $constraint = $parser->parseConstraints( $constraint);127 $constraint = $parser->parseConstraints((string) $constraint); 123 128 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 124 129 … … 310 315 self::$installed = $data; 311 316 self::$installedByVendor = array(); 317 318 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 319 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 320 // so we have to assume it does not, and that may result in duplicate data being returned when listing 321 // all installed packages for example 322 self::$installedIsLocalDir = false; 312 323 } 313 324 … … 323 334 324 335 $installed = array(); 336 $copiedLocalDir = false; 325 337 326 338 if (self::$canGetVendors) { 339 $selfDir = strtr(__DIR__, '\\', '/'); 327 340 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 341 $vendorDir = strtr($vendorDir, '\\', '/'); 328 342 if (isset(self::$installedByVendor[$vendorDir])) { 329 343 $installed[] = self::$installedByVendor[$vendorDir]; 330 344 } elseif (is_file($vendorDir.'/composer/installed.php')) { 331 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; 332 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 333 self::$installed = $installed[count($installed) - 1]; 345 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 346 $required = require $vendorDir.'/composer/installed.php'; 347 self::$installedByVendor[$vendorDir] = $required; 348 $installed[] = $required; 349 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 350 self::$installed = $required; 351 self::$installedIsLocalDir = true; 334 352 } 353 } 354 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 355 $copiedLocalDir = true; 335 356 } 336 357 } … … 341 362 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 342 363 if (substr(__DIR__, -8, 1) !== 'C') { 343 self::$installed = require __DIR__ . '/installed.php'; 364 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 365 $required = require __DIR__ . '/installed.php'; 366 self::$installed = $required; 344 367 } else { 345 368 self::$installed = array(); 346 369 } 347 370 } 348 $installed[] = self::$installed; 371 372 if (self::$installed !== array() && !$copiedLocalDir) { 373 $installed[] = self::$installed; 374 } 349 375 350 376 return $installed; -
bookster-paypal/trunk/vendor/composer/autoload_real.php
r3120716 r3244360 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInitb a5ec13b608a9d093bc629ca1333162d5 class ComposerAutoloaderInitbdefbc1b05bb26f9e417e43e41232339 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInitb a5ec13b608a9d093bc629ca1333162d', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitbdefbc1b05bb26f9e417e43e41232339', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInitb a5ec13b608a9d093bc629ca1333162d', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitbdefbc1b05bb26f9e417e43e41232339', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInitb a5ec13b608a9d093bc629ca1333162d::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInitbdefbc1b05bb26f9e417e43e41232339::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
bookster-paypal/trunk/vendor/composer/autoload_static.php
r3135815 r3244360 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInitb a5ec13b608a9d093bc629ca1333162d7 class ComposerStaticInitbdefbc1b05bb26f9e417e43e41232339 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 28 28 { 29 29 return \Closure::bind(function () use ($loader) { 30 $loader->prefixLengthsPsr4 = ComposerStaticInitb a5ec13b608a9d093bc629ca1333162d::$prefixLengthsPsr4;31 $loader->prefixDirsPsr4 = ComposerStaticInitb a5ec13b608a9d093bc629ca1333162d::$prefixDirsPsr4;32 $loader->classMap = ComposerStaticInitb a5ec13b608a9d093bc629ca1333162d::$classMap;30 $loader->prefixLengthsPsr4 = ComposerStaticInitbdefbc1b05bb26f9e417e43e41232339::$prefixLengthsPsr4; 31 $loader->prefixDirsPsr4 = ComposerStaticInitbdefbc1b05bb26f9e417e43e41232339::$prefixDirsPsr4; 32 $loader->classMap = ComposerStaticInitbdefbc1b05bb26f9e417e43e41232339::$classMap; 33 33 34 34 }, null, ClassLoader::class); -
bookster-paypal/trunk/vendor/composer/installed.php
r3161763 r3244360 4 4 'pretty_version' => 'dev-develop', 5 5 'version' => 'dev-develop', 6 'reference' => ' dea5b652a104261a0c370f254b3273acece5bb8d',6 'reference' => '5b82c01500f2e3ec05a0806ec18d87fcf4034737', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-develop', 15 15 'version' => 'dev-develop', 16 'reference' => ' dea5b652a104261a0c370f254b3273acece5bb8d',16 'reference' => '5b82c01500f2e3ec05a0806ec18d87fcf4034737', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.