https://www.madpaws.com.au/marketplace/_next/static/chunks/pages/billing-history-7ae7767f6f9515b5.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9403],{77346:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/billing-history",function(){return n(80095)}])},80095:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return Z},default:function(){return P}});var r=n(47568),a=n(10253),s=n(20414),i=n(85893),l=n(51664),o=n(11163),c=n(67294),u=n(2096),d=n(17544),m=n(90656),h=n(75516),p=n(23982),v=n.n(p),f=n(9351),y=n(65492),b=n(53199),_=n.n(b),g=n(27484),x=n.n(g),j=function(e){return Number.isFinite(e)?Number(e).toFixed(2):"0.00"},w=function(e,t,n){if(null==e?void 0:e.length)return e.map(function(e){return x()(e).format("DD/MM/YY")}).join(", ");var r=t?x()(t).format("DD/MM/YY"):null,a=n?x()(n).format("DD/MM/YY"):null;return"".concat(r," - ").concat(a)},N=function(e){var t,n,r,a,s=e.data,o=e.isLoading,c=e.error,d=e.isCurrentUserServices,m=(0,l.E1C)(),h=function(e){var t=(0,f.k4)(u.I7,{bookingId:String(e)});window.open(t,"_blank")},p=function(e){var t,n=(0,y.TM)(e.data.city,e.data.rewriteUrl,null===(t=e.data)||void 0===t?void 0:t.state);window.open(n,"_blank")};return o?(0,i.jsxs)("div",{className:_().loadingState,children:[(0,i.jsx)(l.AXE,{size:"small"}),"Loading payment history..."]}):c?(0,i.jsx)("div",{className:_().errorState,children:c}):o||c||0!==s.length?(0,i.jsx)("div",{className:_().tableWrapper,children:(0,i.jsxs)("table",{className:_().table,children:[(0,i.jsx)("thead",{className:_().tableHead,children:(0,i.jsxs)("tr",{className:_().tableRow,children:[m&&(0,i.jsx)("th",{className:_().tableCell,children:"Booking Id"}),m&&(0,i.jsx)("th",{className:_().tableCell,children:"Service Type"}),(0,i.jsx)("th",{className:"".concat(_().tableCell," ").concat(_().datesCell),children:"Bookings Dates"}),(0,i.jsx)("th",{className:_().tableCell,children:d?"Pet Owner":"Sitter"}),m&&(0,i.jsx)("th",{className:_().tableCell,children:"Pets"}),(0,i.jsx)("th",{className:_().tableCell,children:"Amount"})]})}),(0,i.jsx)("tbody",{children:s.reverse().map(function(e){var s,o,c,u,v,f,y,b,g,x,N,C,k;return(0,i.jsxs)("tr",{className:_().tableRow,children:[m&&(0,i.jsx)("td",{className:_().tableCell,children:(0,i.jsx)(l.ZPD,{onClick:function(){return h(e.id)},children:e.id})}),m&&(0,i.jsx)("td",{className:_().tableCell,children:null!==(t=null===(s=e.mainService)||void 0===s?void 0:null===(o=s.data)||void 0===o?void 0:null===(c=o.serviceType)||void 0===c?void 0:null===(u=c.data)||void 0===u?void 0:u.name)&&void 0!==t?t:"-"}),(0,i.jsx)("td",{className:"".concat(_().tableCell," ").concat(_().datesCell),children:w(null===(v=e.scheduledDates)||void 0===v?void 0:v.data,e.startDate,e.endDate)}),(0,i.jsx)("td",{className:_().tableCell,children:d?(0,i.jsx)("span",{children:null!==(n=null===(f=e.collocutor)||void 0===f?void 0:null===(y=f.data)||void 0===y?void 0:y.name)&&void 0!==n?n:"-"}):(0,i.jsx)(l.ZPD,{onClick:function(){return p(e.collocutor)},children:null!==(r=null===(b=e.collocutor)||void 0===b?void 0:null===(g=b.data)||void 0===g?void 0:g.name)&&void 0!==r?r:"-"})}),m&&(0,i.jsx)("td",{className:"".concat(_().tableCell," ").concat(_().petNameCell),children:(k=null!==(a=null===(x=e.pets)||void 0===x?void 0:x.data)&&void 0!==a?a:[]).length?k.map(function(e){return e.name}).join(", "):"-"}),(0,i.jsxs)("td",{className:_().tableCell,children:["$",j(null===(N=e.totalPrice)||void 0===N?void 0:null===(C=N.data)||void 0===C?void 0:C.amount)]})]},e.id)})})]})}):(0,i.jsx)("div",{className:_().emptyState,children:"No payments to show yet."})},C=n(9008),k=n.n(C),S=function(){return(0,i.jsx)(k(),{children:(0,i.jsx)("title",{children:"Billing History | Mad Paws"})})},P=function(e){var t,n,p,f=e.redeemDetails,y=(0,o.useRouter)(),b=(0,l.Vmp)(),_=(0,a.Z)((0,c.useState)(!0),2),g=_[0],x=_[1],w=(0,a.Z)((0,c.useState)(!1),2),C=w[0],k=w[1],P=(0,a.Z)((0,c.useState)(""),2),Z=P[0],E=P[1],T=(0,a.Z)((0,c.useState)(),2),B=T[0],H=T[1];(0,c.useEffect)(function(){var e;(e=(0,r.Z)(function(){return(0,s.__generator)(this,function(e){return h.Q.getSitterPayments().then(function(e){if(!e)throw Error("No response from server");H(e)}).catch(function(){E("Unable to load payment history. Please try again later."),x(!1)}).finally(function(){x(!1)}),[2]})}),function(){return e.apply(this,arguments)})()},[]);var A=Number.isFinite(null==f?void 0:f.toRedeemedBalance)?f.toRedeemedBalance:0,D=j(null==f?void 0:f.sitterBalance),R=j(null==f?void 0:f.toRedeemedBalance),F=j(null==f?void 0:f.redeemedBalance),L=(t=(0,r.Z)(function(){return(0,s.__generator)(this,function(e){switch(e.label){case 0:return k(!0),(0,d.L9)(m.GO,{sitterBalance:Number(D)}),[4,y.push(u.ST)];case 1:return e.sent(),k(!1),[2]}})}),function(){return t.apply(this,arguments)});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(S,{}),(0,i.jsx)(l.uoO,{children:(0,i.jsx)(l.X6q,{fontFamily:"heading",level:1,size:b?"large1x":"small1x",children:"Payment"})}),(0,i.jsxs)(l.Of5,{isRootLayout:!0,rowGap:"large1x",children:[(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[1,7],large:[1,5
1]},children:(0,i.jsxs)("div",{className:v().summaryCard,children:[(0,i.jsxs)("div",{className:v().summaryLabelWithTooltip,children:[(0,i.jsx)("span",{children:"Your Balance"}),(0,i.jsx)(l.eEP,{tip:"Your Mad Paws earnings will appear only after the customer\n has confirmed your completed booking.\n\n Mad Paws retains a 20% transaction fee which covers booking\n support, customer support, and marketing for our platform.\n For Pet Sitters who signed up prior to 29 June 2017, Mad Paws\n will only retain a 15% transaction fee."})]}),(0,i.jsxs)("span",{className:v().summaryValue,children:["$",D]})]})}),(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[7,13],large:[5,9]},children:(0,i.jsxs)("div",{className:v().summaryCard,children:[(0,i.jsxs)("div",{className:v().summaryLabelWithTooltip,children:[(0,i.jsx)("span",{children:"Payment Being Processed"}),(0,i.jsx)(l.eEP,{tip:"Your payment request is being processed, and your balance will be released to you within 5 - 10 business days.\n\n If you are having problems, please contact Customer Support\n on 02 8046 6536."})]}),(0,i.jsxs)("span",{className:v().summaryValue,children:["$",R]})]})}),(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[4,10],large:[9,13]},children:(0,i.jsxs)("div",{className:v().summaryCard,children:[(0,i.jsx)("span",{className:v().summaryLabel,children:"Total Amount Paid to Date"}),(0,i.jsxs)("span",{className:v().summaryValue,children:["$",F]})]})}),(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[4,10],large:[1,5]},children:(0,i.jsx)(l.zxk,{iconTrailing:C?(0,i.jsx)(l.AXE,{size:"medium"}):void 0,isDisabled:A>0||0>=Number(D)||C,isFullBleed:!0,label:A>0?"Payment Pending Approval":"Request Payment of $".concat(D),onClick:L,variant:"primary"})}),(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[1,13],large:[1,13]},children:(0,i.jsx)(l.X6q,{fontFamily:"heading",level:2,size:b?"small1x":"small2x",children:"Payment for Your Services"})}),(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[1,13],large:[1,13]},children:(0,i.jsx)(N,{data:null!==(n=null==B?void 0:B.paymentsForUser.data)&&void 0!==n?n:[],error:Z,isCurrentUserServices:!0,isLoading:g})}),(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[1,13],large:[1,13]},children:(0,i.jsx)(l.X6q,{fontFamily:"heading",level:2,size:b?"small1x":"small2x",children:"Your Payment for Services"})}),(0,i.jsx)(l._Vj,{placement:{small:[1,13],medium:[1,13],large:[1,13]},children:(0,i.jsx)(N,{data:null!==(p=null==B?void 0:B.paymentsByUser.data)&&void 0!==p?p:[],error:Z,isLoading:g})})]})]})},Z=!0},75516:function(e,t,n){"use strict";n.d(t,{Q:function(){return v}});var r=n(47568),a=n(51438),s=n(88029),i=n(26042),l=n(36305),o=n(82337),c=n(20414),u=n(87066),d=n(78065),m=n(63169),h=n(10317),p=n(65830),v=function(e){(0,s.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return n.createBookings=function(e){var t=this;return(0,r.Z)(function(){var n,r,a,s,i;return(0,c.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.woofApi.post("v3/bookings",e)];case 1:return n=o.sent(),[2,(0,l.Z)(n.data.bookings.data)];case 2:if(r=o.sent(),u.Z.isAxiosError(r))return s=(0,m.e)(null===(a=r.response)||void 0===a?void 0:a.data.errors),d.Am.error(null!==(i=s[0])&&void 0!==i?i:"Failed to send booking request"),[2,null];return[2,t.handleError(r)];case 3:return[2]}})})()},n.getBookingPaymentDetails=function(e,t,n){var a=this;return(0,r.Z)(function(){var r,s,l;return(0,c.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),r="v1/bookings/".concat(e,"/payment/details"),t&&(r+="?code=".concat(t)),[4,a.woofApi.get(r,{headers:n})];case 1:return s=o.sent(),[2,(0,i.Z)({},s.data.data)];case 2:throw l=o.sent(),a.handleError(l),l;case 3:return[2]}})})()},n.getBookings=function(e,t){var n=this;return(0,r.Z)(function(){var r,a;return(0,c.__generator)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.woofApi.get("v3/bookings/".concat(e),{headers:t})];case 1:return r=s.sent(),[2,(0,i.Z)({},r.data.data)];case 2:return a=s.sent(),[2,n.handleError(a)];case 3:return[2]}})})()},n.getSitterPayments=function(){var e=this;return(0,r.Z)(function(){var t,n;return(0,c.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e.woofApi.get("v1/bookings/payments")];case 1:return t=r.sent(),[2,(0,i.Z)({},t.data)];case 2:throw n=r.sent(),e.handleError(n),n;case 3:return[2]}})})()},n.getStripeToken=function(e,t){var n=this;return(0,r.Z)(function(){var r,a,s;return(0,c.__generator)(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),r="v3/bookings/".concat(e,"/stripe/token"),t&&(r+="?code=".concat(t)),[4,n.woofApi.post(r)];case 1:return a=l.sent(),[2,(0,i.Z)({},a.data)];case 2:throw s=l.sent(),n.handleError(s),s;case 3:return[2]}})})()},n.processBraintreeBookingPayment=function(e){var t=this;return(0,r.Z)(function(){var n;return(0,c.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.woofApi.post("v3/bookings/".concat(e.bookingId,"/payment/braintree"),(0,i.Z)({notifySitters:!0},e))];case 1:return r.sent(),[2,!0];case 2:throw n=r.sent(),t.handleError(n),Error((0,p.e$)(n));case 3:return[2]}})})()},n.processStripePayment=function(e){var t=this;return(0,r.Z)(function(){var n;return(0,c.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.woofApi.post("v3/bookings/".concat(e.bookingId,"/stripe/confirm"),(0,i.Z)({notifySitters:!0},e))];case 1:return r.sent(),[2,!0];case 2:throw n=r.sent(),t.handleError(n),Error((0,p.e$)(n));case 3:return[2]}})})()},n.sendRwbReview=function(e,t){var n=this;return(0,r.Z)(function(){var r,a,s,i,l,o;return(0,c.__generator)(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,n.woofApi.post("v3/subscriptions/".concat(e,"/reviews"),t)];case 1:return c.sent(),[2,!0];case 2:return r=c.sent(),u.Z.isAxiosError(r)?(l=(0,m.e)(null!==(i=null===(a=r.response)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.errors)&&void 0!==i?i:[]),d.Am.error(null!==(o=l[0])&&void 0!==o?o:"Something went wrong while sending your review.")):n.handleError(r),[2,!1];case 3:return[2]}})})()},n}(h.K)},63169:function(e,t,n){"use strict";n.d(t,{e:function(){return r}});var r=function(e){return e.map(function(e){return e.detail})}},23982:function(e){e.exports={summaryCard:"BillingHistory_summaryCard__Ziy9u",summaryLabel:"BillingHistory_summaryLabel__7RMfr",summaryLabelWithTooltip:"BillingHistory_summaryLabelWithTooltip__mHQO5",summaryValue:"BillingHistory_summaryValue__OMMsE"}},53199:function(e){e.exports={tableWrapper:"HistoryTable_tableWrapper__xrfFr",table:"HistoryTable_table__yw_uu",tableHead:"HistoryTable_tableHead__Bqc8R",tableCell:"HistoryTable_tableCell__RXPex",tableRow:"HistoryTable_tableRow__mEe0v",datesCell:"HistoryTable_datesCell__mAF2Y",petNameCell:"HistoryTable_petNameCell__ZI0TJ",loadingState:"HistoryTable_loadingState__OISG4",emptyState:"HistoryTable_emptyState__LFm8_",errorState:"HistoryTable_errorState__K09fc"}},9008:function(e,t,n){e.exports=n(42636)}},function(e){e.O(0,[8065,9774,2888,179],function(){return e(e.s=77346)}),_N_E=e.O()}]); 2//# sourceMappingURL=billing-history-7ae7767f6f9515b5.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.