/** * NymOS API 1.9.21 * * The contents of this file are subject to the NymOS License, version 1.0. * It is forbidden the use of the codes included on this file, even partially, * for third parties, such as its copy, without express authorization of the * intelectual property and commercial rights owners. A copy of the license * may be obtained at http://nymos.io/source-license. The intelectual * property and comercial rights of this file and codes belong to NymOS S.A. * * Copyright (c) 2017. All rights reserved. * */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; import { CustomHttpUrlEncodingCodec } from '../internal/encoder'; @Injectable() export class PaymentsService { constructor(protected httpClient: HttpClient) { } /** * Continue the payment by providing the code (COV) * * @param paymentId The payment id * @param code The code * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public continueWithCode(paymentId: string, code: string): Observable { if (paymentId === null || paymentId === undefined) { throw new Error('Required parameter paymentId was null or undefined when calling continueWithCode.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling continueWithCode.'); } let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (code !== undefined) { queryParameters = queryParameters.set('code', code); } let headers = new HttpHeaders(); return this.httpClient.put(`https://payments-dot-nymos-dev.appspot.com/v1/payments/${encodeURIComponent(String(paymentId))}:continueWithCode`, { params: queryParameters, headers: headers, } ); } }