import { Injectable } from '@angular/core'; import { HttpWrapperService } from './http-wrapper.service'; import { ApiResult } from '../resources/utility_models/api_result'; import { TournamentOwedAmount, PaidTourneeFee } from 'tournee.businesslogic'; @Injectable() export class TournamentPaymentsService { constructor(private http: HttpWrapperService) {} begin_paying_for_tournament(tournament_id: string) { return this.http.securePost>('/tournaments/' + tournament_id + '/payments/paypal', null); } confirm_paypal_payment(tournament_id, payment_id, token, payer_id) { return this.http.securePut>('/tournaments/' + tournament_id + '/payments/paypal/confirm', { payment_id : payment_id, token: token, payer_id : payer_id }); } cancel_paypal_payment(tournament_id, token) { return this.http.secureDelete>('/tournaments/' + tournament_id + '/payments/paypal/cancel/' + token); } get_owed_amount(tournament_id: string) { return this.http.secureGet>('/tournaments/' + tournament_id + '/payments'); } }