UNPKG

@paddle/paddle-node-sdk

Version:

A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.

17 lines (16 loc) 1.08 kB
import { AddressPreview } from '../transaction/index.js'; import { PricingPreviewDetails } from './pricing-preview-details.js'; export class PricingPreview { constructor(pricePreview) { var _a, _b, _c, _d, _e, _f; this.customerId = (_a = pricePreview.customer_id) !== null && _a !== void 0 ? _a : null; this.addressId = (_b = pricePreview.address_id) !== null && _b !== void 0 ? _b : null; this.businessId = (_c = pricePreview.business_id) !== null && _c !== void 0 ? _c : null; this.currencyCode = pricePreview.currency_code; this.discountId = (_d = pricePreview.discount_id) !== null && _d !== void 0 ? _d : null; this.address = pricePreview.address ? new AddressPreview(pricePreview.address) : null; this.customerIpAddress = (_e = pricePreview.customer_ip_address) !== null && _e !== void 0 ? _e : null; this.details = new PricingPreviewDetails(pricePreview.details); this.availablePaymentMethods = (_f = pricePreview.available_payment_methods) !== null && _f !== void 0 ? _f : []; } }