{ "version": 3, "sources": ["libs/billing/src/lib/pricing/currency.ts", "libs/billing/src/lib/payment/dispute.ts", "libs/billing/src/lib/payment/payment-source.ts", "libs/billing/src/lib/payment/payment-status.ts", "libs/billing/src/lib/payment/payment-allocation-type.ts", "libs/billing/src/lib/payment/payment.ts", "libs/billing/src/lib/payment-card/payment-card.ts", "libs/billing/src/lib/payment-card/payment-card.service.ts", "libs/billing/src/lib/payment/retail-payment.ts", "libs/billing/src/lib/payment/retail-status.ts", "libs/billing/src/lib/payment/provider-determinant.ts", "libs/billing/src/lib/payment/payment.service.ts", "libs/billing/src/lib/retail-customer-configuration/retail-customer-configuration.ts", "libs/billing/src/lib/retail-customer-configuration/retail-customer-configuration.service.ts", "libs/billing/src/lib/merchant/payout-summary.ts", "libs/billing/src/lib/merchant/retail-configuration.ts", "libs/billing/src/lib/http-shared/error-handlers.ts", "libs/billing/src/lib/merchant/merchant.ts", "libs/billing/src/lib/merchant/merchant.service.ts"], "sourcesContent": ["import { Currency as CurrencyApi } from '@vendasta/billing';\n\nexport enum Currency {\n USD = 'USD',\n CAD = 'CAD',\n EUR = 'EUR',\n AUD = 'AUD',\n GBP = 'GBP',\n NZD = 'NZD',\n BRL = 'BRL',\n CHF = 'CHF',\n CNY = 'CNY',\n CZK = 'CZK',\n INR = 'INR',\n JPY = 'JPY',\n KHR = 'KHR',\n KRW = 'KRW',\n MXN = 'MXN',\n NOK = 'NOK',\n RUB = 'RUB',\n SEK = 'SEK',\n SGD = 'SGD',\n TRY = 'TRY',\n ZAR = 'ZAR',\n DZD = 'DZD',\n AWG = 'AWG',\n FJD = 'FJD',\n KYD = 'KYD',\n}\n\nexport function currencyFromApi(cApi: CurrencyApi | undefined): Currency {\n switch (cApi) {\n case CurrencyApi.USD:\n return Currency.USD;\n case CurrencyApi.CAD:\n return Currency.CAD;\n case CurrencyApi.EUR:\n return Currency.EUR;\n case CurrencyApi.AUD:\n return Currency.AUD;\n case CurrencyApi.GBP:\n return Currency.GBP;\n case CurrencyApi.NZD:\n return Currency.NZD;\n case CurrencyApi.BRL:\n return Currency.BRL;\n case CurrencyApi.CHF:\n return Currency.CHF;\n case CurrencyApi.CNY:\n return Currency.CNY;\n case CurrencyApi.CZK:\n return Currency.CZK;\n case CurrencyApi.INR:\n return Currency.INR;\n case CurrencyApi.JPY:\n return Currency.JPY;\n case CurrencyApi.KHR:\n return Currency.KHR;\n case CurrencyApi.KRW:\n return Currency.KRW;\n case CurrencyApi.MXN:\n return Currency.MXN;\n case CurrencyApi.NOK:\n return Currency.NOK;\n case CurrencyApi.RUB:\n return Currency.RUB;\n case CurrencyApi.SEK:\n return Currency.SEK;\n case CurrencyApi.SGD:\n return Currency.SGD;\n case CurrencyApi.TRY:\n return Currency.TRY;\n case CurrencyApi.ZAR:\n return Currency.ZAR;\n case CurrencyApi.DZD:\n return Currency.DZD;\n case CurrencyApi.AWG:\n return Currency.AWG;\n case CurrencyApi.FJD:\n return Currency.FJD;\n case CurrencyApi.KYD:\n return Currency.KYD;\n default:\n return Currency.USD;\n }\n}\n", "import {\n Dispute as DisputeApi,\n DisputeEvidence as DisputeEvidenceApi,\n DisputeEvidenceDetails as DisputeEvidenceDetailsApi,\n DisputeStatus as DisputeStatusApi,\n File as FileApi,\n} from '@vendasta/billing';\n\nexport enum DisputeStatus {\n WARNING_NEEDS_RESPONSE = 'Warning Needs Response',\n WARNING_UNDER_REVIEW = 'Warning Under Review',\n WARNING_CLOSED = 'Warning Closed',\n NEEDS_RESPONSE = 'Needs Response',\n UNDER_REVIEW = 'Under Review',\n CHARGE_REFUNDED = 'Charge Refunded',\n LOST = 'Lost',\n WON = 'Won',\n UNKNOWN = 'Unknown',\n}\n\nexport interface Dispute {\n id: string;\n paymentId: string;\n status?: DisputeStatus;\n amount: number;\n created: Date;\n currencyCode: string;\n evidence?: DisputeEvidence;\n evidenceDetails?: DisputeEvidenceDetails;\n isChargeRefundable: boolean;\n reason: string;\n fee: number;\n feeCurrencyCode: string;\n}\n\nexport interface DisputeEvidence {\n customerCommunication?: File;\n customerSignature?: File;\n shippingDocumentation?: File;\n receipt?: File;\n uncategorizedFile?: File;\n billingAddress: string;\n customerEmailAddress: string;\n customerName: string;\n productDescription: string;\n}\n\nexport interface DisputeEvidenceRequest {\n billingAddress?: string;\n customerEmailAddress?: string;\n customerName?: string;\n productDescription?: string;\n customerSignatureFileId?: string;\n customerCommunicationFileId?: string;\n receiptFileId?: string;\n shippingDocumentationFileId?: string;\n uncategorizedFileId?: string;\n}\n\nexport interface File {\n created: Date;\n id: string;\n filename: string;\n url: string;\n}\n\nexport interface DisputeEvidenceDetails {\n dueBy: Date;\n hasEvidence: boolean;\n pastDue: boolean;\n submissionCount: number;\n}\n\nexport function disputeFromApi(dispute: DisputeApi): Dispute | undefined {\n if (!dispute) {\n return undefined;\n }\n return {\n id: dispute.id || '',\n paymentId: dispute.paymentId || '',\n status: disputeStatusFromApi(dispute.status),\n amount: dispute.amount || 0,\n created: dispute.created,\n currencyCode: dispute.currencyCode,\n evidence: disputeEvidenceFromApi(dispute.evidence),\n evidenceDetails: disputeEvidenceDetailsFromApi(dispute.evidenceDetails),\n isChargeRefundable: dispute.isChargeRefundable || false,\n reason: dispute.reason || '',\n fee: dispute.fee,\n feeCurrencyCode: dispute.feeCurrencyCode,\n };\n}\n\nfunction disputeEvidenceFromApi(evidence: DisputeEvidenceApi): DisputeEvidence | undefined {\n if (!evidence) {\n return undefined;\n }\n return {\n customerCommunication: fileFromApi(evidence.customerCommunication),\n customerSignature: fileFromApi(evidence.customerSignature),\n shippingDocumentation: fileFromApi(evidence.shippingDocumentation),\n receipt: fileFromApi(evidence.receipt),\n uncategorizedFile: fileFromApi(evidence.uncategorizedFile),\n billingAddress: evidence.billingAddress || '',\n customerEmailAddress: evidence.customerEmailAddress || '',\n customerName: evidence.customerName || '',\n productDescription: evidence.productDescription || '',\n };\n}\n\nfunction fileFromApi(file: FileApi): File | undefined {\n if (!file) {\n return undefined;\n }\n return {\n id: file.id || '',\n created: file.created,\n filename: file.filename || '',\n url: file.url || '',\n };\n}\n\nfunction disputeEvidenceDetailsFromApi(evidence: DisputeEvidenceDetailsApi): DisputeEvidenceDetails | undefined {\n if (!evidence) {\n return undefined;\n }\n return {\n dueBy: evidence.dueBy,\n hasEvidence: evidence.hasEvidence,\n pastDue: evidence.pastDue,\n submissionCount: evidence.submissionCount,\n };\n}\n\nexport function disputeStatusFromApi(status: DisputeStatusApi): DisputeStatus | undefined {\n switch (status) {\n case DisputeStatusApi.DISPUTE_STATUS_WARNING_NEEDS_RESPONSE:\n return DisputeStatus.WARNING_NEEDS_RESPONSE;\n case DisputeStatusApi.DISPUTE_STATUS_WARNING_UNDER_REVIEW:\n return DisputeStatus.WARNING_UNDER_REVIEW;\n case DisputeStatusApi.DISPUTE_STATUS_WARNING_CLOSED:\n return DisputeStatus.WARNING_CLOSED;\n case DisputeStatusApi.DISPUTE_STATUS_NEEDS_RESPONSE:\n return DisputeStatus.NEEDS_RESPONSE;\n case DisputeStatusApi.DISPUTE_STATUS_UNDER_REVIEW:\n return DisputeStatus.UNDER_REVIEW;\n case DisputeStatusApi.DISPUTE_STATUS_CHARGE_REFUNDED:\n return DisputeStatus.CHARGE_REFUNDED;\n case DisputeStatusApi.DISPUTE_STATUS_LOST:\n return DisputeStatus.LOST;\n case DisputeStatusApi.DISPUTE_STATUS_WON:\n return DisputeStatus.WON;\n default:\n return undefined;\n }\n}\n", "import { PaymentSource as PaymentSourceApi } from '@vendasta/billing';\n\nexport enum PaymentSource {\n UNSET = 'Unset',\n STRIPE = 'Stripe',\n VCASH = 'vCash',\n}\n\nexport function paymentSourceFromApi(pApi: PaymentSourceApi | undefined): PaymentSource {\n switch (pApi) {\n case PaymentSourceApi.PAYMENT_SOURCE_STRIPE:\n return PaymentSource.STRIPE;\n case PaymentSourceApi.PAYMENT_SOURCE_VCASH:\n return PaymentSource.VCASH;\n default:\n return PaymentSource.UNSET;\n }\n}\n", "import { PaymentStatus as PaymentStatusApi } from '@vendasta/billing';\n\nexport enum PaymentStatus {\n Unset = 'UNSET',\n Failed = 'FAILED',\n Succeeded = 'SUCCEEDED',\n}\n\nexport function paymentStatusFromApi(psApi: PaymentStatusApi | undefined): PaymentStatus {\n switch (psApi) {\n case PaymentStatusApi.PAYMENT_STATUS_FAILED:\n return PaymentStatus.Failed;\n case PaymentStatusApi.PAYMENT_STATUS_SUCCEEDED:\n return PaymentStatus.Succeeded;\n }\n return PaymentStatus.Unset;\n}\n", "import { PaymentAllocationType as PaymentAllocationTypeApi } from '@vendasta/billing';\n\nexport enum PaymentAllocationType {\n UNSET = 'UNSET',\n PURCHASE = 'PURCHASE',\n INVOICE = 'INVOICE',\n}\n\nexport function paymentAllocationTypeFromApi(pApi: PaymentAllocationTypeApi): PaymentAllocationType {\n switch (pApi) {\n case PaymentAllocationTypeApi.PAYMENT_ALLOCATION_TYPE_INVOICE:\n return PaymentAllocationType.INVOICE;\n case PaymentAllocationTypeApi.PAYMENT_ALLOCATION_TYPE_PURCHASE:\n return PaymentAllocationType.PURCHASE;\n default:\n return PaymentAllocationType.UNSET;\n }\n}\n", "import { PaymentPaymentAllocationInterface, PaymentInterface } from '@vendasta/billing';\nimport { Currency, currencyFromApi } from '../pricing';\nimport { PaymentSource, paymentSourceFromApi } from './payment-source';\nimport { PaymentStatus, paymentStatusFromApi } from './payment-status';\nimport { PaymentAllocationType, paymentAllocationTypeFromApi } from './payment-allocation-type';\n\nexport interface Intent {\n stripeClientSecret?: string;\n intentId?: string;\n}\n\nexport interface ListPaymentsFilter {\n merchantId?: string;\n allocationIds?: string[];\n start?: Date;\n end?: Date;\n}\n\nexport interface Payment {\n merchantId: string;\n created?: Date;\n currency: Currency;\n paymentSource: PaymentSource;\n allocations: PaymentAllocation[];\n total: number;\n description: string;\n externalReferenceId: string;\n status: PaymentStatus;\n}\n\nexport interface PaymentAllocation {\n referenceId: string;\n amount: number;\n type: PaymentAllocationType;\n}\n\nexport function paymentFromApi(pApi: PaymentInterface): Payment {\n return {\n merchantId: pApi.merchantId || '',\n created: pApi.created ? new Date(pApi.created) : undefined,\n currency: pApi.currency ? currencyFromApi(pApi.currency) : Currency.USD,\n paymentSource: paymentSourceFromApi(pApi.paymentSource),\n allocations: pApi.allocations ? pApi.allocations.map((p) => paymentAllocationFromApi(p)) : [],\n total: pApi.total || 0,\n description: pApi.description || '',\n externalReferenceId: pApi.externalReferenceId || '',\n status: paymentStatusFromApi(pApi.status),\n };\n}\n\nexport function paymentAllocationFromApi(pApi: PaymentPaymentAllocationInterface): PaymentAllocation {\n return {\n referenceId: pApi.referenceId || '',\n amount: pApi.amount || 0,\n type: pApi.type ? paymentAllocationTypeFromApi(pApi.type) : PaymentAllocationType.UNSET,\n };\n}\n\nexport interface RetailProvider {\n statementDescriptor: string;\n stripeConnectId: string;\n}\n\nexport interface DeclineReason {\n description: string;\n nextSteps: string;\n}\n\nexport const DeclineReasons: Map = new Map([\n [\n 'authentication_required',\n {\n description: 'The card was declined as the transaction requires authentication.',\n nextSteps: 'The customer should try again and authenticate their card when prompted during the transaction.',\n },\n ],\n [\n 'approve_with_id',\n {\n description: 'The payment cannot be authorized.',\n nextSteps:\n 'The payment should be attempted again. If it still cannot be processed, the customer needs to contact their card issuer.',\n },\n ],\n [\n 'call_issuer',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'card_not_supported',\n {\n description: 'The card does not support the specified currency.',\n nextSteps:\n 'The customer needs to check with the issuer whether the card can be used for the type of currency specified.',\n },\n ],\n [\n 'do_not_honor',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'do_not_try_again',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer should contact their card issuer for more information.',\n },\n ],\n [\n 'duplicate_transaction',\n {\n description: 'A transaction with identical amount and credit card information was submitted very recently.',\n nextSteps: 'Check to see if a recent payment already exists.',\n },\n ],\n [\n 'expired_card',\n {\n description: 'The card has expired.',\n nextSteps: 'The customer should use another card.',\n },\n ],\n [\n 'fraudulent',\n {\n description: 'The payment has been declined as Stripe suspects it is fraudulent.',\n nextSteps:\n 'Do not report more detailed information to your customer. Instead, present as you would the generic_decline described below.',\n },\n ],\n [\n 'generic_decline',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'incorrect_number',\n {\n description: 'The card number is incorrect.',\n nextSteps: 'The customer should try again using the correct card number.',\n },\n ],\n [\n 'incorrect_cvc',\n {\n description: 'The CVC number is incorrect.',\n nextSteps: 'The customer should try again using the correct CVC.',\n },\n ],\n [\n 'incorrect_pin',\n {\n description: 'The PIN entered is incorrect. This decline code only applies to payments made with a card reader.',\n nextSteps: 'The customer should try again using the correct PIN.',\n },\n ],\n [\n 'incorrect_zip',\n {\n description: 'The ZIP/postal code is incorrect.',\n nextSteps: 'The customer should try again using the correct billing ZIP/postal code.',\n },\n ],\n [\n 'insufficient_funds',\n {\n description: 'The card has insufficient funds to complete the purchase.',\n nextSteps: 'The customer should use an alternative payment method.',\n },\n ],\n [\n 'invalid_account',\n {\n description: 'The card, or account the card is connected to, is invalid.',\n nextSteps: 'The customer needs to contact their card issuer to check that the card is working correctly.',\n },\n ],\n [\n 'invalid_amount',\n {\n description: 'The payment amount is invalid, or exceeds the amount that is allowed.',\n nextSteps:\n 'If the amount appears to be correct, the customer needs to check with their card issuer that they can make purchases of that amount.',\n },\n ],\n [\n 'invalid_cvc',\n {\n description: 'The CVC number is incorrect.',\n nextSteps: 'The customer should try again using the correct CVC.',\n },\n ],\n [\n 'invalid_expiry_year',\n {\n description: 'The expiration year invalid.',\n nextSteps: 'The customer should try again using the correct expiration date.',\n },\n ],\n [\n 'invalid_number',\n {\n description: 'The card number is incorrect.',\n nextSteps: 'The customer should try again using the correct card number.',\n },\n ],\n [\n 'invalid_pin',\n {\n description: 'The PIN entered is incorrect. This decline code only applies to payments made with a card reader.',\n nextSteps: 'The customer should try again using the correct PIN.',\n },\n ],\n [\n 'issuer_not_available',\n {\n description: 'The card issuer could not be reached, so the payment could not be authorized.',\n nextSteps:\n 'The payment should be attempted again. If it still cannot be processed, the customer needs to contact their card issuer.',\n },\n ],\n [\n 'lost_card',\n {\n description: 'The payment has been declined because the card is reported lost.',\n nextSteps:\n 'The specific reason for the decline should not be reported to the customer. Instead, it needs to be presented as a generic decline.',\n },\n ],\n [\n 'merchant_blacklist',\n {\n description: \"The payment has been declined because it matches a value on the Stripe user's block list.\",\n nextSteps:\n 'Do not report more detailed information to your customer. Instead, present as you would the generic_decline described above.',\n },\n ],\n [\n 'new_account_information_available',\n {\n description: 'The card, or account the card is connected to, is invalid.',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'no_action_taken',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer should contact their card issuer for more information.',\n },\n ],\n [\n 'not_permitted',\n {\n description: 'The payment is not permitted.',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'offline_pin_required',\n {\n description: 'The card has been declined as it requires a PIN.',\n nextSteps: 'The customer should try again by inserting their card and entering a PIN.',\n },\n ],\n [\n 'online_or_offline_pin_required',\n {\n description: 'The card has been declined as it requires a PIN.',\n nextSteps:\n 'If the card reader supports Online PIN, the customer should be prompted for a PIN without a new transaction being created. If the card reader does not support Online PIN, the customer should try again by inserting their card and entering a PIN.',\n },\n ],\n [\n 'pickup_card',\n {\n description: 'The card cannot be used to make this payment (it is possible it has been reported lost or stolen).',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'pin_try_exceeded',\n {\n description: 'The allowable number of PIN tries has been exceeded.',\n nextSteps: 'The customer must use another card or method of payment.',\n },\n ],\n [\n 'processing_error',\n {\n description: 'An error occurred while processing the card.',\n nextSteps: 'The payment should be attempted again. If it still cannot be processed, try again later.',\n },\n ],\n [\n 'reenter_transaction',\n {\n description: 'The payment could not be processed by the issuer for an unknown reason.',\n nextSteps:\n 'The payment should be attempted again. If it still cannot be processed, the customer needs to contact their card issuer.',\n },\n ],\n [\n 'restricted_card',\n {\n description: 'The card cannot be used to make this payment (it is possible it has been reported lost or stolen).',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'revocation_of_all_authorizations',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer should contact their card issuer for more information.',\n },\n ],\n [\n 'revocation_of_authorization',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer should contact their card issuer for more information.',\n },\n ],\n [\n 'security_violation',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'service_not_allowed',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer should contact their card issuer for more information.',\n },\n ],\n [\n 'stolen_card',\n {\n description: 'The payment has been declined because the card is reported stolen.',\n nextSteps:\n 'The specific reason for the decline should not be reported to the customer. Instead, it needs to be presented as a generic decline.',\n },\n ],\n [\n 'stop_payment_order',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer should contact their card issuer for more information.',\n },\n ],\n [\n 'testmode_decline',\n {\n description: 'A Stripe test card number was used.',\n nextSteps: 'A genuine card must be used to make a payment.',\n },\n ],\n [\n 'transaction_not_allowed',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps: 'The customer needs to contact their card issuer for more information.',\n },\n ],\n [\n 'try_again_later',\n {\n description: 'The card has been declined for an unknown reason.',\n nextSteps:\n 'Ask the customer to attempt the payment again. If subsequent payments are declined, the customer should contact their card issuer for more information.',\n },\n ],\n [\n 'withdrawal_count_limit_exceeded',\n {\n description: 'The customer has exceeded the balance or credit limit available on their card.',\n nextSteps: 'The customer should use an alternative payment method.',\n },\n ],\n]);\n", "import { PaymentCard as ApiPaymentCard, PaymentCardCARD_TYPE, PaymentCardFUNDING_TYPE } from '@vendasta/billing';\n\nexport interface PaymentCard {\n cardType: PaymentCardTypeLabel;\n fundingType: FundingTypeLabel;\n cardId: string;\n lastFourDigits: string;\n expiryMonth: number;\n expiryYear: number;\n cardholderName?: string;\n address?: string;\n city?: string;\n state?: string;\n country?: string;\n zipCode?: string;\n default?: boolean;\n}\n\nexport enum FundingType {\n PREPAID = 'Pre-paid',\n DEBIT = 'Debit',\n CREDIT = 'Credit',\n UNKNOWN = 'Unknown',\n}\n\nexport interface FundingTypeLabel {\n value: string;\n id: FundingType;\n}\n\nexport enum PaymentCardType {\n AMEX = 'American Express',\n VISA = 'Visa',\n MASTERCARD = 'Mastercard',\n JCB = 'JCB',\n DINERS_CLUB = 'Diners Club',\n DISCOVER = 'Discover',\n UNKNOWN = 'Unknown',\n}\n\nexport interface PaymentCardTypeLabel {\n id: PaymentCardType;\n value: string;\n}\n\nconst unknownCardType = { id: PaymentCardType.UNKNOWN, value: 'Unknown' };\nconst paymentCardTypeLabelMap = new Map([\n [PaymentCardCARD_TYPE.AMEX, { id: PaymentCardType.AMEX, value: 'American Express' }],\n [PaymentCardCARD_TYPE.VISA, { id: PaymentCardType.VISA, value: 'Visa' }],\n [PaymentCardCARD_TYPE.MASTERCARD, { id: PaymentCardType.MASTERCARD, value: 'Mastercard' }],\n [PaymentCardCARD_TYPE.JCB, { id: PaymentCardType.JCB, value: 'JCB' }],\n [PaymentCardCARD_TYPE.DINERS_CLUB, { id: PaymentCardType.DINERS_CLUB, value: 'Diners Club' }],\n [PaymentCardCARD_TYPE.DISCOVER, { id: PaymentCardType.DISCOVER, value: 'Discover' }],\n [PaymentCardCARD_TYPE.UNKNOWN, unknownCardType],\n]);\n\nfunction convertApiPaymentCardType(t: PaymentCardCARD_TYPE): PaymentCardTypeLabel {\n return paymentCardTypeLabelMap.get(t) || unknownCardType;\n}\n\nconst unknownFundingType = { id: FundingType.UNKNOWN, value: 'Unknown' };\nconst fundingTypeLabelMap = new Map([\n [PaymentCardFUNDING_TYPE.FUNDING_TYPE_DEBIT, { id: FundingType.DEBIT, value: 'Debit' }],\n [PaymentCardFUNDING_TYPE.FUNDING_TYPE_CREDIT, { id: FundingType.CREDIT, value: 'Credit' }],\n [PaymentCardFUNDING_TYPE.FUNDING_TYPE_PREPAID, { id: FundingType.PREPAID, value: 'Pre-paid' }],\n [PaymentCardFUNDING_TYPE.FUNDING_TYPE_UNKNOWN, unknownFundingType],\n]);\n\nexport function convertApiFundingType(t: PaymentCardFUNDING_TYPE): FundingTypeLabel {\n return fundingTypeLabelMap.get(t) || unknownFundingType;\n}\n\nexport function convertApiPaymentCardDetails(c: ApiPaymentCard): PaymentCard {\n return {\n cardType: convertApiPaymentCardType(c.cardType),\n fundingType: convertApiFundingType(c.fundingType),\n cardId: c.cardId,\n lastFourDigits: c.lastFourDigits,\n expiryMonth: c.expiryMonth,\n expiryYear: c.expiryYear,\n cardholderName: c.cardholderName,\n address: c.address,\n city: c.city,\n state: c.state,\n country: c.country,\n zipCode: c.zipCode,\n default: c.default,\n } as PaymentCard;\n}\n", "import { HttpResponse } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport {\n CreatePaymentCardRequest,\n ListPaymentCardsRequest,\n ListPaymentCardsResponse,\n MerchantApiService,\n PaymentCard as ApiPaymentCard,\n SetDefaultPaymentCardRequest,\n UpdatePaymentCardRequest,\n} from '@vendasta/billing';\nimport { convertApiPaymentCardDetails, PaymentCard } from './payment-card';\n\n@Injectable({ providedIn: 'root' })\nexport class PaymentCardService {\n constructor(private apiService: MerchantApiService) {}\n\n setDefaultCard(merchantId: string, cardId: string): Observable> {\n const request = new SetDefaultPaymentCardRequest({\n merchantId,\n cardId,\n });\n return this.apiService.setDefaultPaymentCard(request);\n }\n\n getFirstPaymentCard(merchantId: string): Observable {\n return this.getAll(merchantId).pipe(map((cards: PaymentCard[]) => (cards.length ? cards[0] : null)));\n }\n\n getAll(merchantId: string): Observable {\n const req = new ListPaymentCardsRequest({\n merchantId: merchantId,\n });\n return this.apiService.listPaymentCards(req).pipe(\n map((res: ListPaymentCardsResponse) => (res && res.paymentCard ? res.paymentCard : [])),\n map((paymentCards: ApiPaymentCard[]) => {\n return paymentCards.map((c: ApiPaymentCard) => convertApiPaymentCardDetails(c));\n }),\n );\n }\n\n update(merchantId: string, token: string): Observable> {\n const request = new UpdatePaymentCardRequest({ merchantId: merchantId, stripeToken: token });\n return this.apiService.updatePaymentCard(new UpdatePaymentCardRequest(request));\n }\n\n create(merchantId: string, token: string): Observable> {\n const request = new CreatePaymentCardRequest({ merchantId: merchantId, stripeToken: token });\n return this.apiService.createPaymentCard(new CreatePaymentCardRequest(request));\n }\n}\n", "import {\n CardType,\n PaymentStatus as PaymentStatusApi,\n RetailPayment as RetailPaymentApi,\n RetailPaymentCardDetails as RetailPaymentCardDetailsApi,\n RetailPaymentReferenceType as RetailPaymentReferenceTypeApi,\n RetailRefundReason as ApiRefundReason,\n RetailRefundFailureReason as ApiFailureReason,\n RetailRefundStatus as ApiRefundStatus,\n RetailRefund as RetailRefundApi,\n RetailPayout as RetailPayoutApi,\n PayoutStatus as RetailPayoutStatusApi,\n PayoutType as RetailPayoutTypeApi,\n RetailTransaction as RetailTransactionApi,\n Adjustment as AdjustmentApi,\n} from '@vendasta/billing';\nimport { Dispute, disputeFromApi } from './dispute';\nimport { PaymentCardType } from '../payment-card';\n\nexport enum RetailPaymentStatus {\n Failed = 'Failed',\n Succeeded = 'Succeeded',\n Refunded = 'Refunded',\n PartialyRefunded = 'Partially refunded',\n Disputed = 'Disputed',\n}\n\nexport enum RetailRefundReason {\n Unset = 'Unset',\n Duplicate = 'Duplicate',\n Fraudulent = 'Fraudulent',\n RequestedByCustomer = 'Requested by customer',\n}\n\nexport enum RetailRefundFailureReason {\n Unset = 'Unset',\n LostOrStolenCard = 'Lost or stolen card',\n ExpiredOrCanceledCard = 'Expired or canceled card',\n Unknown = 'Unknown',\n}\n\nexport enum RetailRefundStatus {\n Unset = 'Unset',\n Pending = 'Pending',\n Succeeded = 'Succeeded',\n Failed = 'Failed',\n RequiresAction = 'Requires action',\n Canceled = 'Canceled',\n}\n\nexport enum RetailPayoutStatus {\n Unset = 'Unset',\n Paid = 'Paid',\n Pending = 'Pending',\n InTransit = 'In transit',\n Canceled = 'Canceled',\n Failed = 'Failed',\n}\n\nexport enum RetailPayoutType {\n Unset = 'Unset',\n BankAccount = 'Bank Account',\n Card = 'Card',\n}\n\nexport function isRefundableStatus(status: RetailPaymentStatus): boolean {\n return [RetailPaymentStatus.Succeeded, RetailPaymentStatus.PartialyRefunded].includes(status);\n}\n\nexport function retailRefundReasonFromApi(r: ApiRefundReason): RetailRefundReason | undefined {\n switch (r) {\n case ApiRefundReason.RETAIL_REFUND_REASON_UNSET:\n return RetailRefundReason.Unset;\n case ApiRefundReason.RETAIL_REFUND_REASON_DUPLICATE:\n return RetailRefundReason.Duplicate;\n case ApiRefundReason.RETAIL_REFUND_REASON_FRAUDULENT:\n return RetailRefundReason.Fraudulent;\n case ApiRefundReason.RETAIL_REFUND_REASON_REQUESTED_BY_CUSTOMER:\n return RetailRefundReason.RequestedByCustomer;\n default:\n return undefined;\n }\n}\n\nexport function retailRefundReasonToApi(r: RetailRefundReason): ApiRefundReason {\n switch (r) {\n case RetailRefundReason.Duplicate:\n return ApiRefundReason.RETAIL_REFUND_REASON_DUPLICATE;\n case RetailRefundReason.Fraudulent:\n return ApiRefundReason.RETAIL_REFUND_REASON_FRAUDULENT;\n case RetailRefundReason.RequestedByCustomer:\n return ApiRefundReason.RETAIL_REFUND_REASON_REQUESTED_BY_CUSTOMER;\n default:\n return ApiRefundReason.RETAIL_REFUND_REASON_UNSET;\n }\n}\n\nexport function retailRefundFailureReasonFromApi(r: ApiFailureReason): RetailRefundFailureReason | undefined {\n switch (r) {\n case ApiFailureReason.RETAIL_REFUND_FAILURE_REASON_UNSET:\n return RetailRefundFailureReason.Unset;\n case ApiFailureReason.RETAIL_REFUND_FAILURE_REASON_LOST_OR_STOLEN_CARD:\n return RetailRefundFailureReason.LostOrStolenCard;\n case ApiFailureReason.RETAIL_REFUND_FAILURE_REASON_EXPIRED_OR_CANCELED_CARD:\n return RetailRefundFailureReason.ExpiredOrCanceledCard;\n case ApiFailureReason.RETAIL_REFUND_FAILURE_REASON_UNKNOWN:\n return RetailRefundFailureReason.Unknown;\n default:\n return undefined;\n }\n}\n\nexport function retailRefundStatusFromApi(r: ApiRefundStatus): RetailRefundStatus | undefined {\n switch (r) {\n case ApiRefundStatus.RETAIL_REFUND_STATUS_UNSET:\n return RetailRefundStatus.Unset;\n case ApiRefundStatus.RETAIL_REFUND_STATUS_PENDING:\n return RetailRefundStatus.Pending;\n case ApiRefundStatus.RETAIL_REFUND_STATUS_SUCCEEDED:\n return RetailRefundStatus.Succeeded;\n case ApiRefundStatus.RETAIL_REFUND_STATUS_FAILED:\n return RetailRefundStatus.Failed;\n case ApiRefundStatus.RETAIL_REFUND_STATUS_REQUIRES_ACTION:\n return RetailRefundStatus.RequiresAction;\n case ApiRefundStatus.RETAIL_REFUND_STATUS_CANCELED:\n return RetailRefundStatus.Canceled;\n default:\n return undefined;\n }\n}\n\nexport interface CardDetails {\n cardType: PaymentCardType;\n lastFourDigits: string;\n}\n\nexport interface RetailRefund {\n id: string;\n amount: number;\n currency: string;\n refundReason?: RetailRefundReason;\n status?: RetailRefundStatus;\n failureReason?: RetailRefundFailureReason;\n created?: Date;\n payment?: RetailPayment;\n}\n\nexport interface RetailPayment {\n id: string;\n merchantId: string;\n created: Date;\n currencyCode: string;\n amount: number;\n referenceId: string;\n referenceType: RetailPaymentReferenceTypeApi;\n description: string;\n customerId: string;\n status?: RetailPaymentStatus;\n failureCode: string;\n failureMessage: string;\n applicationFee: number;\n dispute?: Dispute;\n cardDetails: CardDetails;\n refunds: RetailRefund[];\n}\n\nexport interface RetailPayout {\n id: string;\n arrivalDate: Date;\n amount: number;\n currencyCode: string;\n status: RetailPayoutStatus;\n type: RetailPayoutType;\n lastFourDigits: string;\n bankName: string;\n bankId: string;\n failureCode: string;\n failureMessage: string;\n}\n\nexport interface Adjustment {\n id: string;\n amount: number;\n currency: string;\n description: string;\n fee: number;\n net: number;\n refund?: RetailRefund;\n dispute?: Dispute;\n created: Date;\n}\n\nexport enum RetailTransactionType {\n payment = 'payment',\n refund = 'refund',\n}\n\nexport interface RetailTransaction {\n payment?: RetailPayment;\n refund?: RetailRefund;\n payoutFailure?: RetailPayout;\n adjustment?: Adjustment;\n}\n\nexport function retailPaymentFromApi(pApi: RetailPaymentApi): RetailPayment {\n return {\n id: pApi.id || '',\n merchantId: pApi.merchantId || '',\n created: pApi.created || null,\n currencyCode: pApi.currencyCode || '',\n amount: pApi.amount || 0.0,\n referenceId: pApi.referenceId || '',\n referenceType: pApi.referenceType,\n description: pApi.description || '',\n customerId: pApi.customerId || '',\n status: retailPaymentStatusFromApi(pApi.status, pApi.disputed),\n failureCode: pApi.failureCode,\n failureMessage: pApi.failureMessage,\n applicationFee: pApi.applicationFee,\n dispute: disputeFromApi(pApi.dispute),\n cardDetails: cardDetailsFromApi(pApi.cardDetails),\n refunds: retailRefundsfromApi(pApi.refunds),\n };\n}\n\nexport function retailRefundsfromApi(refunds: RetailRefundApi[]): RetailRefund[] {\n return (refunds || []).map((refund: RetailRefundApi) => retailRefundFromApi(refund));\n}\n\nexport function retailRefundFromApi(refund: RetailRefundApi): RetailRefund {\n return {\n id: refund.id || '',\n amount: refund.amount || 0,\n currency: refund.currencyCode || '',\n refundReason: retailRefundReasonFromApi(refund.refundReason),\n status: retailRefundStatusFromApi(refund.status),\n failureReason: retailRefundFailureReasonFromApi(refund.failureReason),\n created: refund.created ? new Date(refund.created) : undefined,\n payment: refund.payment ? retailPaymentFromApi(refund.payment) : undefined,\n };\n}\n\nexport function retailPayoutFromApi(payout: RetailPayoutApi): RetailPayout {\n return {\n id: payout.id,\n arrivalDate: payout.arrivalDate,\n amount: payout.amount,\n currencyCode: payout.currencyCode,\n status: retailPayoutStatusFromApi(payout.status),\n type: retailPayoutTypeFromApi(payout.type),\n lastFourDigits: payout.lastFourDigits,\n bankName: payout.bankName,\n bankId: payout.bankId,\n failureCode: payout.failureCode,\n failureMessage: payout.failureMessage,\n };\n}\n\nexport function retailPayoutStatusFromApi(status: RetailPayoutStatusApi): RetailPayoutStatus {\n switch (status) {\n case RetailPayoutStatusApi.PAYOUT_STATUS_PAID:\n return RetailPayoutStatus.Paid;\n case RetailPayoutStatusApi.PAYOUT_STATUS_PENDING:\n return RetailPayoutStatus.Pending;\n case RetailPayoutStatusApi.PAYOUT_STATUS_IN_TRANSIT:\n return RetailPayoutStatus.InTransit;\n case RetailPayoutStatusApi.PAYOUT_STATUS_CANCELED:\n return RetailPayoutStatus.Canceled;\n case RetailPayoutStatusApi.PAYOUT_STATUS_FAILED:\n return RetailPayoutStatus.Failed;\n default:\n return RetailPayoutStatus.Unset;\n }\n}\n\nexport function retailPayoutTypeFromApi(t: RetailPayoutTypeApi): RetailPayoutType {\n switch (t) {\n case RetailPayoutTypeApi.PAYOUT_TYPE_BANK_ACCOUNT:\n return RetailPayoutType.BankAccount;\n case RetailPayoutTypeApi.PAYOUT_TYPE_CARD:\n return RetailPayoutType.Card;\n default:\n return RetailPayoutType.Unset;\n }\n}\n\nexport function adjustmentFromApi(adjustment: AdjustmentApi): Adjustment {\n return {\n amount: adjustment.amount,\n currency: adjustment.currency,\n description: adjustment.description,\n dispute: disputeFromApi(adjustment.dispute),\n fee: adjustment.fee,\n id: adjustment.id,\n net: adjustment.net,\n refund: adjustment.refund ? retailRefundFromApi(adjustment.refund) : undefined,\n created: adjustment.created,\n };\n}\n\nexport function retailTransactionFromApi(transaction: RetailTransactionApi): RetailTransaction {\n return {\n payment: transaction.payment ? retailPaymentFromApi(transaction.payment) : undefined,\n refund: transaction.refund ? retailRefundFromApi(transaction.refund) : undefined,\n payoutFailure: transaction.payoutFailure ? retailPayoutFromApi(transaction.payoutFailure) : undefined,\n adjustment: transaction.adjustment ? adjustmentFromApi(transaction.adjustment) : undefined,\n };\n}\n\nfunction cardDetailsFromApi(cardDetails: RetailPaymentCardDetailsApi): CardDetails {\n return {\n lastFourDigits: cardDetails.lastFourDigits,\n cardType: cardTypeFromApi(cardDetails.cardType),\n };\n}\n\nfunction cardTypeFromApi(cardType: CardType): PaymentCardType {\n switch (cardType) {\n case CardType.CARD_TYPE_VISA:\n return PaymentCardType.VISA;\n case CardType.CARD_TYPE_MASTERCARD:\n return PaymentCardType.MASTERCARD;\n case CardType.CARD_TYPE_AMEX:\n return PaymentCardType.AMEX;\n case CardType.CARD_TYPE_DISCOVER:\n return PaymentCardType.DISCOVER;\n case CardType.CARD_TYPE_JCB:\n return PaymentCardType.JCB;\n case CardType.CARD_TYPE_DINERS_CLUB:\n return PaymentCardType.DINERS_CLUB;\n default:\n return PaymentCardType.UNKNOWN;\n }\n}\n\nexport function retailPaymentStatusFromApi(\n status: PaymentStatusApi,\n disputed: boolean,\n): RetailPaymentStatus | undefined {\n if (disputed) {\n return RetailPaymentStatus.Disputed;\n }\n switch (status) {\n case PaymentStatusApi.PAYMENT_STATUS_SUCCEEDED:\n return RetailPaymentStatus.Succeeded;\n case PaymentStatusApi.PAYMENT_STATUS_FAILED:\n return RetailPaymentStatus.Failed;\n case PaymentStatusApi.PAYMENT_STATUS_REFUNDED:\n return RetailPaymentStatus.Refunded;\n case PaymentStatusApi.PAYMENT_STATUS_PARTIALLY_REFUNDED:\n return RetailPaymentStatus.PartialyRefunded;\n default:\n return undefined;\n }\n}\n", "import {\n RetailStatusResponseInterface,\n RetailStatusResponseVerificationErrorInterface,\n RetailStatusResponseVerificationRequirementsInterface,\n} from '@vendasta/billing';\n\nexport interface RetailStatus {\n supportedRegion: boolean;\n canAcceptPayment: boolean;\n disabledReason?: string;\n requirements: Requirements;\n futureRequirements: Requirements;\n}\n\nexport type RetailStatusInterface = RetailStatus;\n\nexport interface Requirements {\n due: string[];\n errors: VerificationError[];\n // related to future requirements\n eventuallyDue: string[];\n // related to future requirements\n currentDeadline?: Date;\n}\n\nexport interface VerificationError {\n requirement: string;\n code: string;\n reason: string;\n}\n\nexport function isRejectedDisabledReason(disabledReason: string): boolean {\n return ['rejected.fraud', 'rejected.listed', 'rejected.other', 'rejected.terms_of_service'].includes(disabledReason);\n}\n\nfunction verificationErrorFromAPI(e: RetailStatusResponseVerificationErrorInterface): VerificationError {\n return {\n requirement: e.requirement || '',\n code: e.code || '',\n reason: e.reason || '',\n };\n}\n\nfunction requirementsFromAPI(\n requirements: RetailStatusResponseVerificationRequirementsInterface | undefined,\n): Requirements {\n if (!requirements) {\n return { due: [], errors: [], eventuallyDue: [] };\n }\n return {\n due: requirements.due || [],\n errors: (requirements.error || []).map((e) => verificationErrorFromAPI(e)),\n eventuallyDue: requirements.eventuallyDue || [],\n currentDeadline: new Date(requirements.currentDeadline || 0),\n };\n}\n\nexport function retailResponseFromAPI(proto: RetailStatusResponseInterface): RetailStatus {\n return {\n supportedRegion: proto.supportedRegion || false,\n canAcceptPayment: proto.canAcceptPayment || false,\n disabledReason: proto.disabledReason,\n requirements: requirementsFromAPI(proto.requirements),\n futureRequirements: requirementsFromAPI(proto.futureRequirements),\n };\n}\n", "export class MerchantProviderDeterminant {\n merchantId: string;\n\n constructor(merchantId: string) {\n this.merchantId = merchantId;\n }\n}\n\nexport class CountryProviderDeterminant {\n countryCode: string;\n\n constructor(countryCode: string) {\n this.countryCode = countryCode;\n }\n}\n", "import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map, mapTo } from 'rxjs/operators';\nimport { PagedResponse } from '../core';\nimport {\n GetWholesaleProviderPublicKeyRequest,\n ListPaymentRequest,\n ListRetailDisputesRequest,\n ListRetailDisputesResponse,\n ListRetailPaymentsRequest,\n ListRetailPaymentsRequestListRetailPaymentsFilters,\n ListRetailPaymentsResponse,\n ListRetailTransactionsRequest,\n ListRetailTransactionsRequestListRetailTransactionsFilters,\n ListRetailTransactionsResponse,\n PagedRequestOptions,\n PaymentApiService,\n PrepareRetailPaymentRequest,\n RetailPaymentsEnabledRequest,\n RetailStatusRequest,\n RetailStatusResponse,\n RetailTransactionType,\n} from '@vendasta/billing';\nimport { Dispute, DisputeEvidenceRequest, disputeFromApi } from './dispute';\nimport { Intent, ListPaymentsFilter, Payment, paymentFromApi, RetailProvider } from './payment';\nimport {\n RetailPayment,\n retailPaymentFromApi,\n RetailRefundReason,\n retailRefundReasonToApi,\n RetailTransaction,\n retailTransactionFromApi,\n} from './retail-payment';\nimport { retailResponseFromAPI, RetailStatus } from './retail-status';\nimport { CountryProviderDeterminant, MerchantProviderDeterminant } from './provider-determinant';\n\n@Injectable({ providedIn: 'root' })\nexport class PaymentService {\n constructor(private paymentApi: PaymentApiService) {}\n\n listPayments(filters: ListPaymentsFilter, cursor: string, pageSize: number): Observable> {\n const req = new ListPaymentRequest({\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.paymentApi.list(req).pipe(\n map((response) => {\n const payments = (response.payments || []).map((payment) => paymentFromApi(payment));\n return new PagedResponse(payments, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n prepareRetailPayment(merchantId: string, customerId: string): Observable {\n const req = new PrepareRetailPaymentRequest({\n merchantId: merchantId,\n customerId: customerId,\n });\n return this.paymentApi.prepareRetail(req).pipe(\n map((response) => {\n return {\n stripeClientSecret: response.stripeClientSecret,\n intentId: response.intentId,\n };\n }),\n );\n }\n\n getRetail(merchantId: string, paymentId: string): Observable {\n return this.paymentApi\n .getRetail({\n merchantId: merchantId,\n paymentId: paymentId,\n })\n .pipe(map((resp) => retailPaymentFromApi(resp.payment)));\n }\n\n listRetail(\n merchantId: string,\n cursor = '',\n pageSize = 10,\n payoutId?: string,\n customerId?: string,\n createdDateGte?: Date,\n createdDateLte?: Date,\n ): Observable> {\n const zeroDate = new Date('0001-01-01T00:00:00Z').valueOf();\n const filters: ListRetailPaymentsRequestListRetailPaymentsFilters =\n new ListRetailPaymentsRequestListRetailPaymentsFilters({\n payoutId: payoutId || '',\n });\n if (!!createdDateGte && createdDateGte.valueOf() !== zeroDate) {\n filters.createdDateGte = createdDateGte;\n }\n if (!!createdDateLte && createdDateLte.valueOf() !== zeroDate) {\n filters.createdDateLte = createdDateLte;\n }\n return this.paymentApi\n .listRetail(\n new ListRetailPaymentsRequest({\n merchantId: merchantId,\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n }),\n )\n .pipe(\n map((resp: ListRetailPaymentsResponse) => {\n const retailPayments = (resp.payments || []).map((payment) => retailPaymentFromApi(payment));\n return new PagedResponse(retailPayments, resp.pagingMetadata.nextCursor, resp.pagingMetadata.hasMore);\n }),\n );\n }\n\n listRetailTransactions(\n merchantId: string,\n cursor = '',\n pageSize = 10,\n payoutId?: string,\n createdDateGte?: Date,\n createdDateLte?: Date,\n paymentsOnly?: boolean,\n customerId?: string,\n ): Observable> {\n const zeroDate = new Date('0001-01-01T00:00:00Z').valueOf();\n const filters: ListRetailTransactionsRequestListRetailTransactionsFilters =\n new ListRetailTransactionsRequestListRetailTransactionsFilters({\n payoutId: payoutId || '',\n });\n if (!!createdDateGte && createdDateGte.valueOf() !== zeroDate) {\n filters.createdDateGte = createdDateGte;\n }\n if (!!createdDateLte && createdDateLte.valueOf() !== zeroDate) {\n filters.createdDateLte = createdDateLte;\n }\n if (paymentsOnly === undefined || paymentsOnly) {\n filters.type = RetailTransactionType.RETAIL_TRANSACTION_TYPE_PAYMENT;\n }\n if (customerId) {\n filters.customerId = customerId;\n }\n return this.paymentApi\n .listRetailTransactions(\n new ListRetailTransactionsRequest({\n merchantId: merchantId,\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n }),\n )\n .pipe(\n map((resp: ListRetailTransactionsResponse) => {\n const retailTransactions = (resp.transactions || []).map((transaction) =>\n retailTransactionFromApi(transaction),\n );\n return new PagedResponse(retailTransactions, resp.pagingMetadata.nextCursor, resp.pagingMetadata.hasMore);\n }),\n );\n }\n\n getRetailDispute(merchantId: string, disputeId: string): Observable {\n return this.paymentApi\n .getRetailDispute({\n merchantId: merchantId,\n disputeId: disputeId,\n })\n .pipe(map((resp) => disputeFromApi(resp.dispute)));\n }\n\n listRetailDisputes(merchantId: string, cursor = '', pageSize = 10): Observable> {\n return this.paymentApi\n .listRetailDisputes(\n new ListRetailDisputesRequest({\n merchantId: merchantId,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n }),\n )\n .pipe(\n map((resp: ListRetailDisputesResponse) => {\n const retailPayments = (resp?.disputes || []).map((d) => disputeFromApi(d));\n return new PagedResponse(\n retailPayments,\n resp?.pagingMetadata.nextCursor || '',\n resp?.pagingMetadata.hasMore || false,\n );\n }),\n );\n }\n\n retailStatus(merchantId: string): Observable {\n const req = new RetailStatusRequest({ merchantId });\n return this.paymentApi.retailStatus(req).pipe(map((r: RetailStatusResponse) => retailResponseFromAPI(r)));\n }\n\n retailPaymentsEnabled(merchantId: string): Observable {\n const req = new RetailPaymentsEnabledRequest({ merchantId });\n return this.paymentApi.retailPaymentsEnabled(req).pipe(map((resp) => resp.enabled));\n }\n\n configureRetailProvider(merchantId: string, successUrl: string, failureUrl: string): Observable {\n return this.paymentApi\n .configureRetailProvider({\n merchantId,\n successUrl,\n failureUrl,\n })\n .pipe(map((resp) => resp.stripeUrl));\n }\n\n getRetailProvider(merchantId: string): Observable {\n return this.paymentApi.getRetailProvider({ merchantId }).pipe(\n map((resp) => {\n return {\n statementDescriptor: resp.statementDescriptor,\n stripeConnectId: resp.stripeConnectId,\n };\n }),\n );\n }\n\n updateRetailProvider(merchantId: string, statementDescriptor: string): Observable {\n return this.paymentApi.updateRetailProvider({ merchantId, statementDescriptor }).pipe(mapTo(null));\n }\n\n submitEvidence(\n merchantId: string,\n disputeId: string,\n paymentId: string,\n submit: boolean,\n evidence?: DisputeEvidenceRequest,\n ): Observable {\n return this.paymentApi\n .submitEvidence({\n merchantId: merchantId,\n disputeId: disputeId,\n paymentId: paymentId,\n evidence: {\n billingAddress: evidence?.billingAddress,\n customerEmailAddress: evidence?.customerEmailAddress,\n customerName: evidence?.customerName,\n productDescription: evidence?.productDescription,\n customerSignatureFileId: evidence?.customerSignatureFileId,\n customerCommunicationFileId: evidence?.customerCommunicationFileId,\n receiptFileId: evidence?.receiptFileId,\n shippingDocumentationFileId: evidence?.shippingDocumentationFileId,\n uncategorizedFileId: evidence?.uncategorizedFileId,\n },\n submit: submit,\n })\n .pipe(mapTo(null));\n }\n\n closeDispute(merchantId: string, disputeId: string): Observable {\n return this.paymentApi\n .closeRetailDispute({\n merchantId: merchantId,\n disputeId: disputeId,\n })\n .pipe(mapTo(null));\n }\n\n getWholesaleProviderPublicKey(\n determinant: MerchantProviderDeterminant | CountryProviderDeterminant,\n ): Observable {\n let request: GetWholesaleProviderPublicKeyRequest;\n if (determinant instanceof MerchantProviderDeterminant) {\n request = new GetWholesaleProviderPublicKeyRequest({ merchantId: determinant.merchantId });\n } else {\n request = new GetWholesaleProviderPublicKeyRequest({ countryCode: determinant.countryCode });\n }\n return this.paymentApi.getWholesaleProviderPublicKey(request).pipe(map((resp) => resp.publcApiKey));\n }\n\n refundRetail(\n merchantId: string,\n paymentId: string,\n amount: number,\n reason: RetailRefundReason,\n ): Observable {\n return this.paymentApi\n .refundRetail({ merchantId, paymentId, amount, reason: retailRefundReasonToApi(reason) })\n .pipe(map((resp) => retailPaymentFromApi(resp.payment)));\n }\n}\n", "import { RetailCustomerConfiguration as ApiRetailCustomerConfiguration } from '@vendasta/billing';\n\nexport interface RetailCustomerConfiguration {\n merchantId: string;\n customerId: string;\n contactId: string;\n additionalContactIds?: string[];\n autoGenerateRetailSubscriptions?: boolean;\n autoPost?: boolean;\n autoGenerate?: boolean;\n useTemplateInvoice?: boolean;\n collectionMethod?: CollectionMethod;\n invoiceDay?: number;\n netD?: number;\n memo?: string;\n nextInvoiceDate?: Date;\n}\n\nexport enum CollectionMethod {\n UNSET = '',\n MANUAL_COLLECTION = 'Manual Collection',\n CHARGE_AUTOMATICALLY = 'Charge Automatically',\n SEND_EMAIL = 'Send Email',\n}\n\nexport enum CollectionMethodAPI {\n UNSET = '',\n MANUAL_COLLECTION = 'manual-collection',\n CHARGE_AUTOMATICALLY = 'charge-automatically',\n SEND_EMAIL = 'send-email',\n}\n\nexport function collectionMethodToApi(m: CollectionMethod | undefined | string): string {\n switch (m) {\n case CollectionMethod.MANUAL_COLLECTION:\n return CollectionMethodAPI.MANUAL_COLLECTION;\n case CollectionMethod.CHARGE_AUTOMATICALLY:\n return CollectionMethodAPI.CHARGE_AUTOMATICALLY;\n case CollectionMethod.SEND_EMAIL:\n return CollectionMethodAPI.SEND_EMAIL;\n default:\n return CollectionMethodAPI.UNSET;\n }\n}\n\nexport function collectionMethodFromApi(m: string): CollectionMethod {\n switch (m) {\n case CollectionMethodAPI.MANUAL_COLLECTION:\n return CollectionMethod.MANUAL_COLLECTION;\n case CollectionMethodAPI.CHARGE_AUTOMATICALLY:\n return CollectionMethod.CHARGE_AUTOMATICALLY;\n case CollectionMethodAPI.SEND_EMAIL:\n return CollectionMethod.SEND_EMAIL;\n default:\n return CollectionMethod.UNSET;\n }\n}\n\nexport function retailCustomerConfigurationFromApi(\n config: ApiRetailCustomerConfiguration,\n): RetailCustomerConfiguration {\n return {\n merchantId: config.merchantId || '',\n customerId: config.customerId || '',\n contactId: config.contactId || '',\n additionalContactIds: config.additionalContactIds ?? [],\n autoGenerateRetailSubscriptions: config.autoGenerateRetailSubscriptions || false,\n autoPost: config.autoPost || false,\n autoGenerate: config.autoGenerate || false,\n useTemplateInvoice: config.useTemplateInvoice || false,\n collectionMethod: collectionMethodFromApi(config.collectionMethod),\n invoiceDay: config.invoiceDay || 0,\n netD: config.netD || 7,\n memo: config.memo || '',\n nextInvoiceDate: config.nextInvoiceDate,\n };\n}\n", "import { Injectable } from '@angular/core';\nimport {\n GetRetailCustomerConfigurationRequest,\n GetRetailCustomerConfigurationResponse,\n RetailCustomerConfigurationApiService,\n UpsertRetailCustomerConfigurationRequest,\n UpsertRetailCustomerConfigurationRequestInterface,\n} from '@vendasta/billing';\nimport { Observable } from 'rxjs';\nimport { map, mapTo } from 'rxjs/operators';\nimport {\n RetailCustomerConfiguration,\n collectionMethodToApi,\n retailCustomerConfigurationFromApi,\n} from './retail-customer-configuration';\n\n@Injectable({ providedIn: 'root' })\nexport class RetailCustomerConfigurationService {\n constructor(private configApiService: RetailCustomerConfigurationApiService) {}\n\n get(merchantId: string, customerId: string): Observable {\n const req = new GetRetailCustomerConfigurationRequest({\n merchantId,\n customerId,\n });\n return this.configApiService\n .get(req)\n .pipe(\n map((resp: GetRetailCustomerConfigurationResponse) => retailCustomerConfigurationFromApi(resp.configuration)),\n );\n }\n\n upsert(req: UpsertRetailCustomerConfigurationRequestInterface): Observable {\n return this.configApiService\n .upsert(\n new UpsertRetailCustomerConfigurationRequest({\n ...req,\n collectionMethod: collectionMethodToApi(req.collectionMethod),\n }),\n )\n .pipe(mapTo(null));\n }\n}\n", "import { GetPayoutSummaryResponse } from '@vendasta/billing';\n\nexport enum PayoutInterval {\n Daily = 'daily',\n Weekly = 'weekly',\n Monthly = 'monthly',\n Unknown = 'unknown',\n}\n\nexport interface PayoutSummary {\n nextInTransitPayout?: Date;\n balances: PayoutBalance[];\n payoutInterval?: PayoutInterval;\n payoutDelayDays: number;\n}\n\nexport interface PayoutBalance {\n currencyCode: string;\n futurePayouts: number;\n inTransit: number;\n}\n\nexport function payoutSummaryFromAPI(proto: GetPayoutSummaryResponse): PayoutSummary {\n const zeroDate = new Date('0001-01-01T00:00:00Z').valueOf();\n return {\n nextInTransitPayout:\n proto.nextInTransitPayoutExpectedDate.valueOf() !== zeroDate ? proto.nextInTransitPayoutExpectedDate : undefined,\n payoutInterval: payoutIntervalFromAPI(proto.payoutInterval),\n payoutDelayDays: proto.payoutDelayDays,\n balances: (proto.balances || []).map((balance) => ({\n currencyCode: balance.currencyCode,\n amount: balance.amount || 0,\n futurePayouts: balance.futurePayouts || 0,\n inTransit: balance.inTransit || 0,\n })),\n };\n}\n\nexport function payoutIntervalFromAPI(proto: string): PayoutInterval | undefined {\n switch (proto) {\n case 'daily':\n return PayoutInterval.Daily;\n case 'weekly':\n return PayoutInterval.Weekly;\n case 'monthly':\n return PayoutInterval.Monthly;\n default:\n return undefined;\n }\n}\n", "import {\n DefaultCustomerConfiguration as ApiDefaultCustomerConfiguration,\n DefaultCustomerConfigurationInterface,\n RetailConfiguration as ApiRetailConfiguration,\n} from '@vendasta/billing';\nimport { CollectionMethod, collectionMethodFromApi, collectionMethodToApi } from '../retail-customer-configuration';\n\nexport interface RetailConfiguration {\n merchantId: string;\n retailGroupId: string;\n currencyCode: string;\n currencyConversionRate: number;\n defaultCustomerConfiguration?: DefaultCustomerConfiguration;\n}\n\nexport interface DefaultCustomerConfiguration {\n generateMethod: GenerateMethod;\n collectionMethod: CollectionMethod;\n invoiceDay: number;\n netD: number;\n memo: string;\n autoGenerateRetailSubscriptions: boolean;\n}\n\nexport enum GenerateMethod {\n UNSET = 'Unset',\n SUBSCRIPTION = 'Subscription',\n TEMPLATE = 'Template',\n}\n\nexport function generateMethodToApi(m: GenerateMethod | undefined): string {\n switch (m) {\n case GenerateMethod.SUBSCRIPTION:\n return 'subscription';\n case GenerateMethod.TEMPLATE:\n return 'template';\n default:\n return '';\n }\n}\n\nexport function generateMethodFromApi(m: string): GenerateMethod {\n switch (m) {\n case 'subscription':\n return GenerateMethod.SUBSCRIPTION;\n case 'template':\n return GenerateMethod.TEMPLATE;\n default:\n return GenerateMethod.UNSET;\n }\n}\n\nexport function retailConfigurationFromApi(proto: ApiRetailConfiguration): RetailConfiguration {\n return {\n merchantId: proto.merchantId,\n retailGroupId: proto.retailGroupId,\n currencyCode: proto.currencyCode,\n currencyConversionRate: proto.currencyConversionRate || 0,\n defaultCustomerConfiguration: defaultCustomerConfigurationFromApi(proto.defaultCustomerConfiguration),\n };\n}\n\nexport function defaultCustomerConfigurationFromApi(\n proto: ApiDefaultCustomerConfiguration,\n): DefaultCustomerConfiguration | undefined {\n if (!proto) {\n return undefined;\n }\n const collectionMethod = collectionMethodFromApi(proto.collectionMethod);\n return {\n generateMethod: generateMethodFromApi(proto.generateMethod),\n collectionMethod: collectionMethod,\n invoiceDay: proto.invoiceDay,\n netD: proto.netD,\n memo: proto.memo,\n autoGenerateRetailSubscriptions: proto.autoGenerateRetailSubscriptions ?? false,\n };\n}\n\nexport function defaultCustomerConfigurationToApi(\n c: DefaultCustomerConfiguration | undefined,\n): DefaultCustomerConfigurationInterface | undefined {\n if (!c) {\n return undefined;\n }\n return {\n generateMethod: generateMethodToApi(c.generateMethod),\n collectionMethod: collectionMethodToApi(c.collectionMethod),\n invoiceDay: c.invoiceDay,\n netD: c.netD,\n memo: c.memo,\n autoGenerateRetailSubscriptions: c.autoGenerateRetailSubscriptions ?? false,\n } as ApiDefaultCustomerConfiguration;\n}\n", "import { throwError as observableThrowError, Observable } from 'rxjs';\nimport { HttpErrorResponse } from '@angular/common/http';\n\nexport function handleCsvError(error: HttpErrorResponse): Observable {\n if (error.error instanceof ErrorEvent) {\n console.error(`An error occurred:`, error.error.message);\n } else {\n console.error(`Server returned ${error.message}`);\n }\n\n return observableThrowError(`Unable to download csv`);\n}\n\nexport function handleFileUploadError(error: HttpErrorResponse): Observable {\n if (error.error instanceof ErrorEvent) {\n console.error(`An error occurred:`, error.error.message);\n } else {\n console.error(`Server returned ${error.message}`);\n }\n\n return observableThrowError(`Unable to upload file`);\n}\n", "import { Merchant as ApiMerchant } from '@vendasta/billing';\n\nexport interface Merchant {\n merchantId: string;\n address: string;\n city: string;\n state: string;\n country: string;\n zipCode: string;\n emailAddress: string;\n phoneNumber: string;\n contactName: string;\n companyName: string;\n autoPostInvoices: boolean;\n autoChargeInvoices: boolean;\n includeInFinancialRecords: boolean;\n additionalEmailAddresses: string[];\n stripeConnectId: string;\n}\n\nexport function MerchantFromAPI(proto: ApiMerchant): Merchant {\n return {\n merchantId: proto.merchantId,\n address: proto.address,\n city: proto.city,\n state: proto.state,\n country: proto.country,\n zipCode: proto.zipCode,\n emailAddress: proto.emailAddress,\n phoneNumber: proto.phoneNumber,\n contactName: proto.contactName,\n companyName: proto.companyName,\n autoPostInvoices: proto.autoPostInvoices,\n autoChargeInvoices: proto.autoChargeInvoices,\n includeInFinancialRecords: proto.includeInFinancialRecords,\n additionalEmailAddresses: proto.additionalEmailAddresses || [],\n stripeConnectId: proto.stripeAccountId,\n };\n}\n", "import { HttpClient, HttpResponse } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { catchError, map, share } from 'rxjs/operators';\nimport { PagedResponse, SortDirection } from '../core';\nimport { handleCsvError } from '../http-shared/error-handlers';\nimport { currencyFromApi } from '../pricing';\nimport {\n CreateStripeExternalAccountRequest,\n GetMerchantRequest,\n GetMultiRetailConfigurationsRequest,\n GetMultiRetailConfigurationsResponse,\n GetOutstandingBalanceRequest,\n GetPayoutSummaryRequest,\n GetRetailPayoutRequest,\n GetStatisticsRequest,\n GetStatisticsResponse,\n HostService,\n ListRetailPayoutsRequest,\n ListRetailPayoutsResponse,\n MerchantApiService,\n PagedRequestOptions,\n PagedRequestOptionsInterface,\n SearchMerchantsRequestSortBy,\n SortDirection as SortDirectionApi,\n UpsertDefaultRetailCustomerConfigurationRequest,\n UpsertRetailConfigurationRequest,\n MerchantServicesReportRun,\n MerchantServicesReportRunType,\n AccountBalance,\n} from '@vendasta/billing';\nimport { Balance } from './balance';\nimport { Merchant, MerchantFromAPI } from './merchant';\nimport { DownloadMerchantsCsvRequest } from './merchant.interface';\nimport { PayoutSummary, payoutSummaryFromAPI } from './payout-summary';\nimport {\n DefaultCustomerConfiguration,\n defaultCustomerConfigurationToApi,\n RetailConfiguration,\n retailConfigurationFromApi,\n} from './retail-configuration';\nimport { RetailPayout, retailPayoutFromApi } from '../payment';\n\n/**\n * @enum SortMerchantsBy\n * Names should match corresponding field in Merchant interface.\n * Values should match ../_internal/enums/SortBy\n */\nexport enum SortMerchantsBy {\n merchantId = 0,\n companyName,\n contactName,\n emailAddress,\n country,\n state,\n created,\n updated,\n}\n\n@Injectable({ providedIn: 'root' })\nexport class MerchantService {\n constructor(private merchantApi: MerchantApiService, private hostService: HostService, private http: HttpClient) {}\n\n get(merchantId: string): Observable {\n const req = new GetMerchantRequest({ merchantId });\n return this.merchantApi.get(req).pipe(map((resp) => MerchantFromAPI(resp.merchant)));\n }\n\n create(\n merchantId: string,\n address: string,\n city: string,\n state: string,\n country: string,\n zipCode: string,\n emailAddress: string,\n phoneNumber: string,\n contactName: string,\n companyName: string,\n additionalEmailAddresses?: string[],\n ): Observable {\n return this.merchantApi\n .create({\n merchantId,\n address,\n city,\n state,\n country,\n zipCode,\n emailAddress,\n phoneNumber,\n contactName,\n companyName,\n additionalEmailAddresses,\n })\n .pipe(map(() => true));\n }\n\n update(\n merchantId: string,\n address: string,\n city: string,\n state: string,\n country: string,\n zipCode: string,\n emailAddress: string,\n phoneNumber: string,\n contactName: string,\n companyName: string,\n additionalEmailAddresses?: string[],\n ): Observable {\n return this.merchantApi\n .update({\n merchantId,\n address,\n city,\n state,\n country,\n zipCode,\n emailAddress,\n phoneNumber,\n contactName,\n companyName,\n additionalEmailAddresses,\n })\n .pipe(map(() => true));\n }\n\n getOutstandingBalance(merchantId: string): Observable {\n const req = new GetOutstandingBalanceRequest({ merchantId });\n return this.merchantApi.getOutstandingBalance(req).pipe(\n map((r) => ({\n outstanding: r.outstandingBalance || 0,\n currency: currencyFromApi(r.currency),\n })),\n );\n }\n\n getStatistics(merchantId: string): Observable {\n const req = new GetStatisticsRequest({ merchantId });\n return this.merchantApi.getStatistics(req);\n }\n\n private sortMerchantByToApi(sortBy: SortMerchantsBy): SearchMerchantsRequestSortBy {\n switch (sortBy) {\n case SortMerchantsBy.merchantId:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_MERCHANT_ID;\n case SortMerchantsBy.companyName:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_COMPANY_NAME;\n case SortMerchantsBy.contactName:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_CONTACT_NAME;\n case SortMerchantsBy.emailAddress:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_EMAIL_ADDRESS;\n case SortMerchantsBy.country:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_COUNTRY;\n case SortMerchantsBy.state:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_STATE;\n case SortMerchantsBy.updated:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_UPDATED;\n case SortMerchantsBy.created:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_CREATED;\n default:\n return SearchMerchantsRequestSortBy.SEARCH_MERCHANTS_REQUEST_SORT_BY_MERCHANT_ID;\n }\n }\n\n private sortDirectionToApi(sortDirection: SortDirection): SortDirectionApi {\n switch (sortDirection) {\n case SortDirection.Ascending:\n return SortDirectionApi.SORT_DIRECTION_ASCENDING;\n case SortDirection.Descending:\n return SortDirectionApi.SORT_DIRECTION_DESCENDING;\n default:\n return SortDirectionApi.SORT_DIRECTION_ASCENDING;\n }\n }\n\n search(\n searchTerm: string,\n sortBy: SortMerchantsBy,\n sortDirection: SortDirection,\n pagingOptions: PagedRequestOptionsInterface,\n ): Observable> {\n return this.merchantApi\n .search({\n searchTerm: searchTerm,\n sortBy: this.sortMerchantByToApi(sortBy),\n sortDirection: this.sortDirectionToApi(sortDirection),\n pagingOptions: new PagedRequestOptions(pagingOptions),\n })\n .pipe(\n map(\n (r) =>\n new PagedResponse(\n r.merchants.map((m) => MerchantFromAPI(m)),\n r.pagingMetadata.nextCursor,\n r.pagingMetadata.hasMore,\n ),\n ),\n );\n }\n\n setAutoPostInvoices(merchantId: string, autoPostInvoices: boolean): Observable {\n return this.merchantApi\n .setAutoPostInvoices({\n merchantId: merchantId,\n shouldAutoPostInvoices: autoPostInvoices,\n })\n .pipe(map(() => true));\n }\n\n setAutoChargeInvoices(merchantId: string, autoChargeInvoices: boolean): Observable {\n return this.merchantApi\n .setAutoChargeInvoices({\n merchantId,\n autoChargeInvoices,\n })\n .pipe(map(() => true));\n }\n\n downloadCsv(r: DownloadMerchantsCsvRequest): Observable {\n const queryParams = `?filename=${r.filename}`;\n return this.http\n .get(this.hostService.hostWithScheme + '/merchants-csv' + queryParams, this.apiOptions())\n .pipe(catchError(handleCsvError));\n }\n\n setIncludeInFinancialRecords(merchantId: string, includeInFinancialRecords: boolean): Observable {\n return this.merchantApi\n .setIncludeInFinancialRecords({\n merchantId: merchantId,\n includeInFinancialRecords: includeInFinancialRecords,\n })\n .pipe(map((response) => response.ok));\n }\n\n sendSalesInvoiceEmail(merchantId: string, invoiceId: string): Observable {\n return this.merchantApi\n .sendSalesInvoiceEmail({\n merchantId: merchantId,\n invoiceId: invoiceId,\n })\n .pipe(map(() => true));\n }\n\n chargeSalesInvoice(merchantId: string, invoiceId: string, amount: number): Observable {\n return this.merchantApi\n .chargeSalesInvoice({\n merchantId,\n invoiceId,\n amount,\n })\n .pipe(map(() => true));\n }\n\n sendSalesInvoiceReceiptEmail(merchantId: string, invoiceId: string): Observable {\n return this.merchantApi\n .sendSalesInvoiceReceiptEmail({\n merchantId: merchantId,\n invoiceId: invoiceId,\n })\n .pipe(map(() => true));\n }\n\n private apiOptions(): { responseType: 'blob'; withCredentials: boolean } {\n return {\n responseType: 'blob',\n withCredentials: true,\n };\n }\n\n createExternalAccount(merchantId: string, stripeToken: string): Observable {\n return this.merchantApi\n .createStripeExternalAccount(\n new CreateStripeExternalAccountRequest({\n merchantId,\n stripeToken,\n }),\n )\n .pipe(map(() => true));\n }\n\n generateAccountBalanceReport(merchantId: string): Observable {\n const queryParams = `?merchantID=${merchantId}`;\n return this.http\n .get(this.hostService.hostWithScheme + '/merchant-balance-details-report' + queryParams, this.apiOptions())\n .pipe(share(), catchError(handleCsvError));\n }\n\n getMultiRetailConfigurations(\n merchantId: string,\n retailGroupIds: string[],\n ): Observable> {\n const request = new GetMultiRetailConfigurationsRequest({\n merchantId,\n retailGroupIds,\n });\n return this.merchantApi.getMultiRetailConfigurations(request).pipe(\n map((resp: GetMultiRetailConfigurationsResponse) => {\n const configMap = new Map();\n retailGroupIds.forEach((groupId) => {\n configMap.set(groupId, retailConfigurationFromApi(resp.retailConfigurations[groupId]));\n });\n return configMap;\n }),\n );\n }\n\n upsertRetailConfiguration(\n merchantId: string,\n retailGroupId: string,\n currencyCode: string,\n currencyConversionRate?: number,\n ): Observable {\n const request = new UpsertRetailConfigurationRequest({\n merchantId,\n retailGroupId,\n currencyCode,\n currencyConversionRate,\n });\n return this.merchantApi.upsertRetailConfiguration(request).pipe(map(() => null));\n }\n\n getPayoutSummary(merchantId: string): Observable {\n return this.merchantApi\n .getPayoutSummary(\n new GetPayoutSummaryRequest({\n merchantId,\n }),\n )\n .pipe(map((resp) => payoutSummaryFromAPI(resp)));\n }\n\n getRetailPayout(merchantId: string, payoutId: string): Observable {\n return this.merchantApi\n .getRetailPayout(\n new GetRetailPayoutRequest({\n merchantId,\n payoutId,\n }),\n )\n .pipe(map((resp) => retailPayoutFromApi(resp.payout)));\n }\n\n listRetailPayouts(merchantId: string, cursor = '', pageSize = 10): Observable> {\n return this.merchantApi\n .listRetailPayouts(\n new ListRetailPayoutsRequest({\n merchantId: merchantId,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n }),\n )\n .pipe(\n map((resp: ListRetailPayoutsResponse) => {\n const retailPayouts = (resp.payouts || []).map((payout) => retailPayoutFromApi(payout));\n return new PagedResponse(retailPayouts, resp.pagingMetadata.nextCursor, resp.pagingMetadata.hasMore);\n }),\n );\n }\n\n /**\n * Updates the default retail customer configuration for a given merchant and group ID\n * @param merchantId - the merchant to update for\n * @param retailGroupId - the group ID to update for\n * @param defaultCustomerConfiguration - the default customer configuration to apply. If `null`, the merchant/group will have no defaults\n */\n upsertDefaultRetailCustomerConfiguration(\n merchantId: string,\n retailGroupId: string,\n defaultCustomerConfiguration?: DefaultCustomerConfiguration,\n ): Observable> {\n return this.merchantApi.upsertDefaultRetailCustomerConfiguration(\n new UpsertDefaultRetailCustomerConfigurationRequest({\n merchantId,\n retailGroupId,\n defaultCustomerConfiguration: defaultCustomerConfigurationToApi(defaultCustomerConfiguration),\n }),\n );\n }\n\n /**\n * Creates a new report run for a merchant.\n *\n * @param merchantId is the id of the merchant to create the report for.\n * @param reportType is the type of report to generate\n * @param intervalStart is the starting time for entities in the report.\n * @param intervalEnd is the end range for entities in the report.\n * @param currencyCode fill filter results down to a specific currency. This is optional.\n */\n createReportRun(\n merchantId: string,\n reportType: MerchantServicesReportRunType,\n intervalStart: Date,\n intervalEnd: Date,\n currencyCode?: string,\n ): Observable {\n return this.merchantApi.createReportRun({\n merchantId,\n reportType,\n intervalStart,\n intervalEnd,\n currencyCode,\n });\n }\n\n /**\n * Get a report run by its identifier.\n *\n * @param id is the id of the report run.\n */\n getReportRun(id: string): Observable {\n return this.merchantApi.getReportRun({ id });\n }\n\n /**\n * Gets the data from a report run\n *\n * @param id is the id of the report run.\n */\n getReport(id: string): Observable {\n return this.http\n .get(this.hostService.hostWithScheme + `/merchant-services/reports/${id}`, this.apiOptions())\n .pipe(catchError(handleCsvError));\n }\n\n getRetailAccountBalance(merchantId: string): Observable {\n return this.merchantApi.getRetailAccountBalance({ merchantId }).pipe(map((resp) => resp.balance));\n }\n}\n"], "mappings": "umBAEA,IAAYA,EAAZ,SAAYA,EAAQ,CAClBA,OAAAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA,MACAA,EAAA,IAAA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AU,CACrB,OAAO,KAAKpI,YAAYmI,aAAa,CAAEC,GAAAA,CAAE,CAAE,CAC7C,CAOAC,UAAUD,EAAU,CAClB,OAAO,KAAKlI,KACTC,IAAI,KAAKF,YAAYuE,eAAiB,8BAA8B4D,CAAE,GAAI,KAAK3D,WAAU,CAAE,EAC3FlE,KAAKmE,EAAWC,EAAc,CAAC,CACpC,CAEA2D,wBAAwBlI,EAAkB,CACxC,OAAO,KAAKJ,YAAYsI,wBAAwB,CAAElI,WAAAA,CAAU,CAAE,EAAEG,KAAKC,EAAKC,GAASA,EAAK8H,OAAO,CAAC,CAClG,yCA/WWzI,GAAe0I,EAAAC,CAAA,EAAAD,EAAAE,EAAA,EAAAF,EAAAG,EAAA,CAAA,CAAA,wBAAf7I,EAAe8I,QAAf9I,EAAe+I,UAAAC,WADF,MAAM,CAAA,EAC1B,IAAOhJ,EAAPiJ,SAAOjJ,CAAe,GAAA", "names": ["Currency", "currencyFromApi", "cApi", "CurrencyApi", "USD", "CAD", "EUR", "AUD", "GBP", "NZD", "BRL", "CHF", "CNY", "CZK", "INR", "JPY", "KHR", "KRW", "MXN", "NOK", "RUB", "SEK", "SGD", "TRY", "ZAR", "DZD", "AWG", "FJD", "KYD", "DisputeStatus", "disputeFromApi", "dispute", "id", "paymentId", "status", "disputeStatusFromApi", "amount", "created", "currencyCode", "evidence", "disputeEvidenceFromApi", "evidenceDetails", "disputeEvidenceDetailsFromApi", "isChargeRefundable", "reason", "fee", "feeCurrencyCode", "customerCommunication", "fileFromApi", "customerSignature", "shippingDocumentation", "receipt", "uncategorizedFile", "billingAddress", "customerEmailAddress", "customerName", "productDescription", "file", "filename", "url", "dueBy", "hasEvidence", "pastDue", "submissionCount", "DisputeStatusApi", "DISPUTE_STATUS_WARNING_NEEDS_RESPONSE", "WARNING_NEEDS_RESPONSE", "DISPUTE_STATUS_WARNING_UNDER_REVIEW", "WARNING_UNDER_REVIEW", "DISPUTE_STATUS_WARNING_CLOSED", "WARNING_CLOSED", "DISPUTE_STATUS_NEEDS_RESPONSE", "NEEDS_RESPONSE", "DISPUTE_STATUS_UNDER_REVIEW", "UNDER_REVIEW", "DISPUTE_STATUS_CHARGE_REFUNDED", "CHARGE_REFUNDED", "DISPUTE_STATUS_LOST", "LOST", "DISPUTE_STATUS_WON", "WON", "PaymentSource", "paymentSourceFromApi", "pApi", "PaymentSourceApi", "PAYMENT_SOURCE_STRIPE", "STRIPE", "PAYMENT_SOURCE_VCASH", "VCASH", "UNSET", "PaymentStatus", "paymentStatusFromApi", "psApi", "PaymentStatusApi", "PAYMENT_STATUS_FAILED", "Failed", "PAYMENT_STATUS_SUCCEEDED", "Succeeded", "Unset", "PaymentAllocationType", "paymentAllocationTypeFromApi", "pApi", "PaymentAllocationTypeApi", "PAYMENT_ALLOCATION_TYPE_INVOICE", "INVOICE", "PAYMENT_ALLOCATION_TYPE_PURCHASE", "PURCHASE", "UNSET", "paymentFromApi", "pApi", "merchantId", "created", "Date", "undefined", "currency", "currencyFromApi", "Currency", "USD", "paymentSource", "paymentSourceFromApi", "allocations", "map", "p", "paymentAllocationFromApi", "total", "description", "externalReferenceId", "status", "paymentStatusFromApi", "referenceId", "amount", "type", "paymentAllocationTypeFromApi", "PaymentAllocationType", "UNSET", "DeclineReasons", "Map", "nextSteps", "FundingType", "PaymentCardType", "unknownCardType", "id", "UNKNOWN", "value", "paymentCardTypeLabelMap", "Map", "PaymentCardCARD_TYPE", "AMEX", "VISA", "MASTERCARD", "JCB", "DINERS_CLUB", "DISCOVER", "convertApiPaymentCardType", "t", "get", "unknownFundingType", "fundingTypeLabelMap", "PaymentCardFUNDING_TYPE", "FUNDING_TYPE_DEBIT", "DEBIT", "FUNDING_TYPE_CREDIT", "CREDIT", "FUNDING_TYPE_PREPAID", "PREPAID", "FUNDING_TYPE_UNKNOWN", "convertApiFundingType", "convertApiPaymentCardDetails", "c", "cardType", "fundingType", "cardId", "lastFourDigits", "expiryMonth", "expiryYear", "cardholderName", "address", "city", "state", "country", "zipCode", "default", "PaymentCardService", "constructor", "apiService", "setDefaultCard", "merchantId", "cardId", "request", "SetDefaultPaymentCardRequest", "setDefaultPaymentCard", "getFirstPaymentCard", "getAll", "pipe", "map", "cards", "length", "req", "ListPaymentCardsRequest", "listPaymentCards", "res", "paymentCard", "paymentCards", "c", "convertApiPaymentCardDetails", "update", "token", "UpdatePaymentCardRequest", "stripeToken", "updatePaymentCard", "create", "CreatePaymentCardRequest", "createPaymentCard", "\u0275\u0275inject", "MerchantApiService", "factory", "\u0275fac", "providedIn", "_PaymentCardService", "RetailPaymentStatus", "RetailRefundReason", "RetailRefundFailureReason", "RetailRefundStatus", "RetailPayoutStatus", "RetailPayoutType", "isRefundableStatus", "status", "Succeeded", "PartialyRefunded", "includes", "retailRefundReasonFromApi", "r", "ApiRefundReason", "RETAIL_REFUND_REASON_UNSET", "Unset", "RETAIL_REFUND_REASON_DUPLICATE", "Duplicate", "RETAIL_REFUND_REASON_FRAUDULENT", "Fraudulent", "RETAIL_REFUND_REASON_REQUESTED_BY_CUSTOMER", "RequestedByCustomer", "retailRefundReasonToApi", "retailRefundFailureReasonFromApi", "ApiFailureReason", "RETAIL_REFUND_FAILURE_REASON_UNSET", "RETAIL_REFUND_FAILURE_REASON_LOST_OR_STOLEN_CARD", "LostOrStolenCard", "RETAIL_REFUND_FAILURE_REASON_EXPIRED_OR_CANCELED_CARD", "ExpiredOrCanceledCard", "RETAIL_REFUND_FAILURE_REASON_UNKNOWN", "Unknown", "retailRefundStatusFromApi", "ApiRefundStatus", "RETAIL_REFUND_STATUS_UNSET", "RETAIL_REFUND_STATUS_PENDING", "Pending", "RETAIL_REFUND_STATUS_SUCCEEDED", "RETAIL_REFUND_STATUS_FAILED", "Failed", "RETAIL_REFUND_STATUS_REQUIRES_ACTION", "RequiresAction", "RETAIL_REFUND_STATUS_CANCELED", "Canceled", "retailPaymentFromApi", "pApi", "id", "merchantId", "created", "currencyCode", "amount", "referenceId", "referenceType", "description", "customerId", "status", "retailPaymentStatusFromApi", "disputed", "failureCode", "failureMessage", "applicationFee", "dispute", "disputeFromApi", "cardDetails", "cardDetailsFromApi", "refunds", "retailRefundsfromApi", "map", "refund", "retailRefundFromApi", "currency", "refundReason", "retailRefundReasonFromApi", "retailRefundStatusFromApi", "failureReason", "retailRefundFailureReasonFromApi", "Date", "undefined", "payment", "retailPayoutFromApi", "payout", "arrivalDate", "retailPayoutStatusFromApi", "type", "retailPayoutTypeFromApi", "lastFourDigits", "bankName", "bankId", "RetailPayoutStatusApi", "PAYOUT_STATUS_PAID", "RetailPayoutStatus", "Paid", "PAYOUT_STATUS_PENDING", "Pending", "PAYOUT_STATUS_IN_TRANSIT", "InTransit", "PAYOUT_STATUS_CANCELED", "Canceled", "PAYOUT_STATUS_FAILED", "Failed", "Unset", "t", "RetailPayoutTypeApi", "PAYOUT_TYPE_BANK_ACCOUNT", "RetailPayoutType", "BankAccount", "PAYOUT_TYPE_CARD", "Card", "adjustmentFromApi", "adjustment", "fee", "net", "retailTransactionFromApi", "transaction", "payoutFailure", "cardType", "cardTypeFromApi", "CardType", "CARD_TYPE_VISA", "PaymentCardType", "VISA", "CARD_TYPE_MASTERCARD", "MASTERCARD", "CARD_TYPE_AMEX", "AMEX", "CARD_TYPE_DISCOVER", "DISCOVER", "CARD_TYPE_JCB", "JCB", "CARD_TYPE_DINERS_CLUB", "DINERS_CLUB", "UNKNOWN", "RetailPaymentStatus", "Disputed", "PaymentStatusApi", "PAYMENT_STATUS_SUCCEEDED", "Succeeded", "PAYMENT_STATUS_FAILED", "PAYMENT_STATUS_REFUNDED", "Refunded", "PAYMENT_STATUS_PARTIALLY_REFUNDED", "PartialyRefunded", "isRejectedDisabledReason", "disabledReason", "includes", "verificationErrorFromAPI", "e", "requirement", "code", "reason", "requirementsFromAPI", "requirements", "due", "errors", "error", "map", "eventuallyDue", "currentDeadline", "Date", "retailResponseFromAPI", "proto", "supportedRegion", "canAcceptPayment", "futureRequirements", "MerchantProviderDeterminant", "constructor", "merchantId", "CountryProviderDeterminant", "countryCode", "PaymentService", "constructor", "paymentApi", "listPayments", "filters", "cursor", "pageSize", "req", "ListPaymentRequest", "pagingOptions", "PagedRequestOptions", "list", "pipe", "map", "response", "payments", "payment", "paymentFromApi", "PagedResponse", "pagingMetadata", "nextCursor", "hasMore", "prepareRetailPayment", "merchantId", "customerId", "PrepareRetailPaymentRequest", "prepareRetail", "stripeClientSecret", "intentId", "getRetail", "paymentId", "resp", "retailPaymentFromApi", "listRetail", "payoutId", "createdDateGte", "createdDateLte", "zeroDate", "Date", "valueOf", "ListRetailPaymentsRequestListRetailPaymentsFilters", "ListRetailPaymentsRequest", "retailPayments", "listRetailTransactions", "paymentsOnly", "ListRetailTransactionsRequestListRetailTransactionsFilters", "undefined", "type", "RetailTransactionType", "RETAIL_TRANSACTION_TYPE_PAYMENT", "ListRetailTransactionsRequest", "retailTransactions", "transactions", "transaction", "retailTransactionFromApi", "getRetailDispute", "disputeId", "disputeFromApi", "dispute", "listRetailDisputes", "ListRetailDisputesRequest", "disputes", "d", "retailStatus", "RetailStatusRequest", "r", "retailResponseFromAPI", "retailPaymentsEnabled", "RetailPaymentsEnabledRequest", "enabled", "configureRetailProvider", "successUrl", "failureUrl", "stripeUrl", "getRetailProvider", "statementDescriptor", "stripeConnectId", "updateRetailProvider", "mapTo", "submitEvidence", "submit", "evidence", "billingAddress", "customerEmailAddress", "customerName", "productDescription", "customerSignatureFileId", "customerCommunicationFileId", "receiptFileId", "shippingDocumentationFileId", "uncategorizedFileId", "closeDispute", "closeRetailDispute", "getWholesaleProviderPublicKey", "determinant", "request", "MerchantProviderDeterminant", "GetWholesaleProviderPublicKeyRequest", "countryCode", "publcApiKey", "refundRetail", "amount", "reason", "retailRefundReasonToApi", "\u0275\u0275inject", "PaymentApiService", "factory", "\u0275fac", "providedIn", "_PaymentService", "CollectionMethod", "CollectionMethodAPI", "collectionMethodToApi", "m", "MANUAL_COLLECTION", "CHARGE_AUTOMATICALLY", "SEND_EMAIL", "UNSET", "collectionMethodFromApi", "retailCustomerConfigurationFromApi", "config", "merchantId", "customerId", "contactId", "additionalContactIds", "autoGenerateRetailSubscriptions", "autoPost", "autoGenerate", "useTemplateInvoice", "collectionMethod", "invoiceDay", "netD", "memo", "nextInvoiceDate", "RetailCustomerConfigurationService", "constructor", "configApiService", "get", "merchantId", "customerId", "req", "GetRetailCustomerConfigurationRequest", "pipe", "map", "resp", "retailCustomerConfigurationFromApi", "configuration", "upsert", "UpsertRetailCustomerConfigurationRequest", "__spreadProps", "__spreadValues", "collectionMethod", "collectionMethodToApi", "mapTo", "\u0275\u0275inject", "RetailCustomerConfigurationApiService", "factory", "\u0275fac", "providedIn", "_RetailCustomerConfigurationService", "PayoutInterval", "payoutSummaryFromAPI", "proto", "zeroDate", "Date", "valueOf", "nextInTransitPayout", "nextInTransitPayoutExpectedDate", "undefined", "payoutInterval", "payoutIntervalFromAPI", "payoutDelayDays", "balances", "map", "balance", "currencyCode", "amount", "futurePayouts", "inTransit", "Daily", "Weekly", "Monthly", "GenerateMethod", "generateMethodToApi", "m", "SUBSCRIPTION", "TEMPLATE", "generateMethodFromApi", "UNSET", "retailConfigurationFromApi", "proto", "merchantId", "retailGroupId", "currencyCode", "currencyConversionRate", "defaultCustomerConfiguration", "defaultCustomerConfigurationFromApi", "collectionMethod", "collectionMethodFromApi", "generateMethod", "invoiceDay", "netD", "memo", "autoGenerateRetailSubscriptions", "defaultCustomerConfigurationToApi", "c", "collectionMethodToApi", "handleCsvError", "error", "ErrorEvent", "console", "message", "observableThrowError", "handleFileUploadError", "MerchantFromAPI", "proto", "merchantId", "address", "city", "state", "country", "zipCode", "emailAddress", "phoneNumber", "contactName", "companyName", "autoPostInvoices", "autoChargeInvoices", "includeInFinancialRecords", "additionalEmailAddresses", "stripeConnectId", "stripeAccountId", "SortMerchantsBy", "MerchantService", "constructor", "merchantApi", "hostService", "http", "get", "merchantId", "req", "GetMerchantRequest", "pipe", "map", "resp", "MerchantFromAPI", "merchant", "create", "address", "city", "state", "country", "zipCode", "emailAddress", "phoneNumber", "contactName", "companyName", "additionalEmailAddresses", "update", "getOutstandingBalance", "GetOutstandingBalanceRequest", "r", "outstanding", "outstandingBalance", "currency", "currencyFromApi", "getStatistics", "GetStatisticsRequest", "sortMerchantByToApi", "sortBy", "SearchMerchantsRequestSortBy", "SEARCH_MERCHANTS_REQUEST_SORT_BY_MERCHANT_ID", "SEARCH_MERCHANTS_REQUEST_SORT_BY_COMPANY_NAME", "SEARCH_MERCHANTS_REQUEST_SORT_BY_CONTACT_NAME", "SEARCH_MERCHANTS_REQUEST_SORT_BY_EMAIL_ADDRESS", "SEARCH_MERCHANTS_REQUEST_SORT_BY_COUNTRY", "SEARCH_MERCHANTS_REQUEST_SORT_BY_STATE", "updated", "SEARCH_MERCHANTS_REQUEST_SORT_BY_UPDATED", "created", "SEARCH_MERCHANTS_REQUEST_SORT_BY_CREATED", "sortDirectionToApi", "sortDirection", "SortDirection", "Ascending", "SortDirectionApi", "SORT_DIRECTION_ASCENDING", "Descending", "SORT_DIRECTION_DESCENDING", "search", "searchTerm", "pagingOptions", "PagedRequestOptions", "PagedResponse", "merchants", "m", "pagingMetadata", "nextCursor", "hasMore", "setAutoPostInvoices", "autoPostInvoices", "shouldAutoPostInvoices", "setAutoChargeInvoices", "autoChargeInvoices", "downloadCsv", "queryParams", "filename", "hostWithScheme", "apiOptions", "catchError", "handleCsvError", "setIncludeInFinancialRecords", "includeInFinancialRecords", "response", "ok", "sendSalesInvoiceEmail", "invoiceId", "chargeSalesInvoice", "amount", "sendSalesInvoiceReceiptEmail", "responseType", "withCredentials", "createExternalAccount", "stripeToken", "createStripeExternalAccount", "CreateStripeExternalAccountRequest", "generateAccountBalanceReport", "share", "getMultiRetailConfigurations", "retailGroupIds", "request", "GetMultiRetailConfigurationsRequest", "configMap", "Map", "forEach", "groupId", "set", "retailConfigurationFromApi", "retailConfigurations", "upsertRetailConfiguration", "retailGroupId", "currencyCode", "currencyConversionRate", "UpsertRetailConfigurationRequest", "getPayoutSummary", "GetPayoutSummaryRequest", "payoutSummaryFromAPI", "getRetailPayout", "payoutId", "GetRetailPayoutRequest", "retailPayoutFromApi", "payout", "listRetailPayouts", "cursor", "pageSize", "ListRetailPayoutsRequest", "retailPayouts", "payouts", "upsertDefaultRetailCustomerConfiguration", "defaultCustomerConfiguration", "UpsertDefaultRetailCustomerConfigurationRequest", "defaultCustomerConfigurationToApi", "createReportRun", "reportType", "intervalStart", "intervalEnd", "getReportRun", "id", "getReport", "getRetailAccountBalance", "balance", "\u0275\u0275inject", "MerchantApiService", "HostService", "HttpClient", "factory", "\u0275fac", "providedIn", "_MerchantService"] }