import { HttpClient } from "@angular/common/http"; import { Observable } from "rxjs"; import { Stripe, StripeFactory } from "./types"; import { PayIntentModel } from "./payIntend.model"; import * as i0 from "@angular/core"; export declare class StripeService { private http; apiUrl: string; storeId: string; tenantId: string; accountRef: string; locale: string; currency: string; httpOptions: {}; publishableKey: string; STRIPE_API_URL: string; private stripeFactory; private stripePromise; private ready; constructor(http: HttpClient); /** * Will initialize needed attribute for the service * @param url api url * @param storeId the storeId * @param tenantId the tenant id * @param idExtAccount the id of the external account * @param key api key * @param currency * @param locale langage for stripe. Default is auto (detect navigator langage) */ init(url: string, storeId: string, tenantId: string, idExtAccount: string, key: string, currency: string, locale?: string): any; /** * Returns the `head` element. * @throws Error('Application does not have a head element'); */ private getHeadElement; getStripe(): any; get stripe(): StripeFactory; set stripe(s: StripeFactory); private setPublishableKey; get useStripe(): Stripe; private inject; /** * Will setup stripe */ setup(): Observable; /** * Will create the subscription checkout session * @param priceId the priceId of the product to subscribe * @param offerTitle offer.title to display in the subscription email * @param subscriptionId the subscriptionId * @param tenantId the tenantId * @param user user.firstname, user.lastname, user.email * @param successUrl the success url for the redirection. Https mandatory (e.g https://misite.com) * @param cancelUrl the cancel Url * @param networkId the nerwork id */ createSessionForSubscription(priceId: string, offerTitle: string, subscriptionId: string, tenantId: string, user: any, successUrl: string, cancelUrl: string, networkId?: string): Observable; /** * Will create the one time payment checkout session * @param orderId the orderId * @param storeId the storeId of the store where the checkout is taking place * @param userId the userId of the user making the checkout * @param successUrl the success url for the redirection. Https mandatory (e.g https://misite.com) * @param cancelUrl the cancel Url */ createSessionForOneTimePayment(orderId: string, storeId: string, userId: string, successUrl: string, cancelUrl: string, networkId?: string): Observable; /** * Will create the user Stripe connect account link * @param storeId the storeId linked to the extAccount * @param refreshUrl the refresh url * @param returnUrl the return url for the redirection. */ createUserAccountLink(storeId: string, refreshUrl: string, returnUrl: string): Observable; /** * Will create the user Stripe billing portal link * @param storeId the storeId of the subscription * @param subscriptionId the subscription id * @param returnUrl the return url for the redirection */ createUserBillingPortalLink(storeId: string, subscriptionId: string, returnUrl: string): Observable; /** * Create the payment intent for the given data * @param payIntendModel the payIntend Model data * @returns Observable */ createPayIntent(payIntendModel: PayIntentModel): Observable; /** * Create the checkout session for subcription * @param priceId * @param offerTitle * @param subscriptionId * @param tenantId * @param networkId * @param user * @param successUrl * @param cancelUrl * @returns */ private createCheckoutSessionForSubscription; /** * Create the checkout session for one time Payment * @param orderId * @param storeId * @param userId * @param successUrl * @param cancelUrl * @returns */ private createCheckoutSessionForOneTimePayment; /** * Will create the Stripe connect account link for the user token * @param storeId the storeId linked to the extAccount * @param refreshUrl * @param returnUrl * @returns */ private createConnectAccountLink; /** * Will create the Stripe billing portal link for the user token * @param storeId the storeId linked to the extAccount * @param subscriptionId * @param returnUrl * @returns */ private createBillingPortalLink; /** * Will onboard the tenant to Stripe */ private onboardUser; private payIntent; handleResult(result: any): string; /** * Get the publishableKey * @param storeId */ private getPublishableKey; private handleError; /** Log a HeroService message with the MessageService */ private log; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }