File

projects/congarevenuecloud/ecommerce/src/lib/modules/pricing/services/conversion.service.ts

Description

This service is a work in progress.

The conversion service is responsible for pulling conversion rates from your Salesforce instance.

Usage

Example :
import { ConversionService, AObjectService} from '@congarevenuecloud/ecommerce';

export class MyComponent implements OnInit{
constructor( private conversionService: ConversionService)
}
// or
export class MyService extends AObjectService {
private conversionService: ConversionService = this.injector.get(ConversionService);
}

Extends

AObjectService

Index

Properties
Methods

Methods

getConversionRates
getConversionRates()

primary method for pulling conversion rates.

Example:

Example :
import { ConversionService, CurrencyType } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
conversionRate: Array<CurrencyType>;
conversionRate$: Observable<Array<CurrencyType>>;

constructor(private conversionervice: ConversionService){}

getConversion(){
this.conversionervice.getConversionRates().subscribe(a => this.conversionRate = a);
// or
this.conversionRate$ = this.conversionService.getConversionRates();
}
}

/** primary method for pulling conversion rates from Salesforce.

a cold observable containing the array of currency type instances

getCurrencyTypeForPricelist
getCurrencyTypeForPricelist()

Used for getting a single instance of currencytype based on the price List

a hot observable containing the currency type of the price List

getMyCurrencyType
getMyCurrencyType()

Used for getting a single instance of currencytype for the current user

Example:

Example :
import { ConversionService, CurrencyType } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
conversionRate: CurrencyType;
conversionRate$: Observable<CurrencyType>;

constructor(private conversionervice: ConversionService){}

getMyCurrencyType(){
this.conversionervice.getMyCurrencyType().subscribe(a => this.conversionRate = a);
// or
this.conversionRate$ = this.conversionService.getMyCurrencyType();
}
}

a hot observable containing the currency type of the current user

Properties

type
Default value : CurrencyType

results matching ""

    No results matching ""