Paypal integration error

Export class PaypalpagoPage implements OnInit {
totalfare: number;

paymentAmount = ‘totalFare’;
currency: string = ‘EUR’;

ngOnInit () {

This TotalFare = Mathematics. round (this. serviceProvider. tripDistance * this. serviceProvider. farePerKm + this. serviceProvider. rateBase);

Pay with PayPal () {
this paypal. in that ({
PayPalEnvironmentProduction: ‘’,
PayPalEnvironmentSandbox: ‘ASdoJu_T3ORqC2AI-Hx2UYTa8afcSOmyVZMr_KDdaXvufeX6-S7CuTjgyhEYy1_uaSSsjkgtD4qbQS3o’
}). then (() => {
// Environments: PayPalEnvironmentNoNetwork, PayPalEnvironmentSandbox, PayPalEnvironmentProduction
this paypal. prepareToRender (‘PayPalEnvironmentSandbox’, new configuration of PayPal ({
acceptCreditCards: true,
})). then (() => {
console log (this. totalFare);
leave payment = new PayPalPayment (this.paymentAmount, ‘EUR’, ‘Description’, ‘exit’);
this paypal. renderSinglePaymentUI (payment). then (() => {
this route navigate ([’/ reservation confirmation’]);
Totalfare calculates an operation that is the distance * km. This has to give a number that is the price that the user has to pay.
I have put paymentAmount = ‘totalfare’. The problem is that I do not open PayPal when I click on the button