feat(1.0):除微信支付外,第一版功能完成

developing
张帅 3 weeks ago
parent 0a2e118872
commit 73190da18a

@ -13,24 +13,23 @@ declare const WeixinJSBridge: any;
providedIn: 'root'
})
export class PaymentService {
private apiUrl = `${environment.apiUrl}/payments`;
constructor(private http: HttpClient) {}
createPayment(request: PaymentRequest): Observable<Payment> {
return this.http.post<Payment>(this.apiUrl, request);
return this.http.post<Payment>('', request);
}
getPayment(orderNo: string): Observable<Payment> {
return this.http.get<Payment>(`${this.apiUrl}/${orderNo}`);
return this.http.get<Payment>(`${orderNo}`);
}
getPaymentStatus(orderNo: string): Observable<{ status: string }> {
return this.http.get<{ status: string }>(`${this.apiUrl}/${orderNo}/status`);
return this.http.get<{ status: string }>(`/${orderNo}/status`);
}
getWechatPayParams(orderNo: string): Observable<WechatPayParams> {
return this.http.get<WechatPayParams>(`${this.apiUrl}/${orderNo}/wechat-pay`);
return this.http.get<WechatPayParams>(`/${orderNo}/wechat-pay`);
}
// 唤起微信支付

Loading…
Cancel
Save