{"version":3,"sources":["webpack:///./src/web-api/payment-service.ts"],"names":["PaymentService","ServiceWithSession","constructor","session","super","orderAmount","currencyCode","formId","clientToken","this","serviceRequest","method","endpoint","data","OrderAmount","CurrencyCode","FormId","ClientToken","headers","getValidationHeaders","token","paymentMethod","concat","params","response"],"mappings":"gGAAA,2DAGe,MAAMA,UAAuBC,IAC3CC,YAAYC,GACXC,MAAMD,GAGP,kBAAkBE,EAAqBC,EAAsBC,EAAgBC,GAC5E,OAAOC,KAAKC,eAAe,CAC1BC,OAAQ,OACRC,SAAU,+BACVC,KAAM,CACLC,YAAaT,EACbU,aAAcT,EACdU,OAAQT,EACRU,YAAaT,GAEdU,QAAST,KAAKU,yBAIhB,oBAAoBC,EAAeC,EAAuBb,GACzD,OAAOC,KAAKC,eAAe,CAC1BC,OAAQ,MACRC,SAAU,0CAAFU,OAA4CF,EAAK,mBAAAE,OAAkBD,EAAa,iBAAAC,OAAgBd,GACxGU,QAAST,KAAKU,yBAIhB,wBAQC,aAPqBV,KAAKC,eAAe,CACxCC,OAAQ,MACRC,SAAU,gCACVW,OAAQ,CAAEhB,OAAQE,KAAKN,QAAQI,QAC/BW,QAAST,KAAKU,0BAGDK,SAASX","file":"183.3e3ee137577ace4e559b.js","sourcesContent":["import { ServiceWithSession } from './base-service';\r\nimport type { FormSession } from './form-session';\r\n\r\nexport default class PaymentService extends ServiceWithSession {\r\n\tconstructor(session: FormSession) {\r\n\t\tsuper(session);\r\n\t}\r\n\r\n\tasync createOrder(orderAmount: number, currencyCode: string, formId: string, clientToken: string) {\r\n\t\treturn this.serviceRequest({\r\n\t\t\tmethod: 'POST',\r\n\t\t\tendpoint: 'svc/paypal-form/create-order',\r\n\t\t\tdata: {\r\n\t\t\t\tOrderAmount: orderAmount,\r\n\t\t\t\tCurrencyCode: currencyCode,\r\n\t\t\t\tFormId: formId,\r\n\t\t\t\tClientToken: clientToken\r\n\t\t\t},\r\n\t\t\theaders: this.getValidationHeaders()\r\n\t\t});\r\n\t}\r\n\r\n\tasync getIdentifier(token: string, paymentMethod: string, clientToken: string) {\r\n\t\treturn this.serviceRequest({\r\n\t\t\tmethod: 'GET',\r\n\t\t\tendpoint: `svc/paypal-form/identifier?payPalToken=${token}&paymentMethod=${paymentMethod}&clientToken=${clientToken}`,\r\n\t\t\theaders: this.getValidationHeaders()\r\n\t\t});\r\n\t}\r\n\r\n\tasync getPayPalConfig(): Promise {\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'GET',\r\n\t\t\tendpoint: 'svc/paypal-form/client-config',\r\n\t\t\tparams: { formId: this.session.formId },\r\n\t\t\theaders: this.getValidationHeaders()\r\n\t\t});\r\n\r\n\t\treturn result.response.data as PayPalClientConfig;\r\n\t}\r\n}\r\n\r\nexport type PayPalClientConfig = {\r\n\tClientToken: string;\r\n\tMerchantId: string;\r\n\tTrackingId: string;\r\n};"],"sourceRoot":""}