Commit 857eacde authored by Alish's avatar Alish
Browse files

fix: pay with Stripe and load Stripe card

parent 15d81fd9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -222,8 +222,10 @@ export class UsersService extends DBService<User>

		if (user != null) {
			if (user.stripeCustomerId != null) {
				return (await stripe.customers.listCards(user.stripeCustomerId))
					.data;
				return (await stripe.customers.listSources(
					user.stripeCustomerId,
					{ object: 'card' }
				)).data;
			} else {
				return [];
			}
+2 −2
Original line number Diff line number Diff line
@@ -61,9 +61,9 @@ export class OrderRouter implements IOrderRouter {

	async payWithStripe(orderId: string, cardId: string): Promise<Order> {
		const order = await this.router.run<IOrder>(
			'updateWarehouseStatus',
			'payWithStripe',
			orderId,
			status
			cardId
		);
		return this._orderFactory(order);
	}
+1 −1
Original line number Diff line number Diff line
<span class="all {{ smallButtons ? 'small-buttons' : '' }}">
	<span class="actions">
		<button
			*ngIf="!order?.isPaid"
			*ngIf="!order?.isPaid && !userCard"
			class="button button-assertive border-color-brand col-100"
			(click)="toPaymentStage()"
		>