AW-1805 Update mollie service (client)
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
cc421742df
commit
a08eed7c67
16
projects/common/src/fm/models/mollie.payment.request.ts
Normal file
16
projects/common/src/fm/models/mollie.payment.request.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { IItem } from "./item";
|
||||
|
||||
export interface IMolliePaymentRequest {
|
||||
templatePackageItem?: IItem,
|
||||
redirectUrl?: string,
|
||||
locale?: string,
|
||||
}
|
||||
|
||||
export class MolliePaymentRequest implements IMolliePaymentRequest {
|
||||
public templatePackageItem?: IItem;
|
||||
public redirectUrl?: string;
|
||||
public locale?: string;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
}
|
@ -2,12 +2,16 @@
|
||||
export interface IMolliePaymentResponse {
|
||||
createdAt?: Date,
|
||||
expiresAt?: Date,
|
||||
currency?: string,
|
||||
amount?: string,
|
||||
checkoutUrl?: string,
|
||||
}
|
||||
|
||||
export class MolliePaymentResponse implements IMolliePaymentResponse {
|
||||
public createdAt?: Date;
|
||||
public expiresAt?: Date;
|
||||
public currency?: string;
|
||||
public amount?: string;
|
||||
public checkoutUrl?: string;
|
||||
|
||||
constructor() {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { IItem } from '../models/item';
|
||||
import { IItemTask } from '../models/itemTask';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
import { Observable } from 'rxjs';
|
||||
import { IMolliePaymentResponse } from '../models/mollie.payment.response';
|
||||
import { IMolliePaymentRequest } from '../models/mollie.payment.request';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@ -20,15 +19,9 @@ export class MollieService {
|
||||
return this.appConfig.getConfig("apiEndPoint");
|
||||
}
|
||||
|
||||
createMolliePayment(templatePackage: IItem, redirectUrl: string): Observable<IMolliePaymentResponse> {
|
||||
let payload = {
|
||||
"currency": "EUR",
|
||||
"amount": "100.00",
|
||||
"redirectUrl": redirectUrl,
|
||||
"itemCode": templatePackage.code,
|
||||
"locale": "nl_NL",
|
||||
"validity": templatePackage.data?.validity
|
||||
};
|
||||
return this.httpClient.post<IMolliePaymentResponse>(`${this.ApiEndpoint()}/api/v1/payments/create`, payload);
|
||||
createMolliePayment(paymentRequest: IMolliePaymentRequest): Observable<IMolliePaymentResponse> {
|
||||
return this.httpClient.post<IMolliePaymentResponse>(
|
||||
`${this.ApiEndpoint()}/api/v1/payments/create`,
|
||||
paymentRequest);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user