You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bill_pay/README.md
+87-7Lines changed: 87 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,13 @@ This service is a core component of the **Relibank** FinServ application. Its pr
8
8
9
9
***RESTful API**: Exposes a RESTful API for handling one-time, recurring, and cancellation requests.
10
10
11
+
***Stripe Integration**: Processes card payments via Stripe API (test mode only for development).
12
+
13
+
***Payment Method Storage**: Stores and manages customer payment methods (cards) in Stripe.
14
+
11
15
***Pydantic Validation**: Validates all incoming API requests to ensure data integrity.
12
16
13
-
***Kafka Producer**: Publishes payment-related events to dedicated Kafka topics: `bill_payments`, `recurring_payments`, and `payment_cancellations`.
17
+
***Kafka Producer**: Publishes payment-related events to dedicated Kafka topics: `bill_payments`, `recurring_payments`, `payment_cancellations`, and `card_payments`.
14
18
15
19
***Service-to-Service Communication**: Makes a synchronous API call to the `transaction-service` to check for the existence of a `billId` before processing a payment or cancellation. This ensures data consistency and prevents duplicate transactions.
16
20
@@ -22,28 +26,104 @@ This service is a core component of the **Relibank** FinServ application. Its pr
22
26
23
27
The service exposes the following API endpoints, which are designed to be consumed by the customer portal or other upstream services.
24
28
29
+
#### Account Transfer Payments
25
30
| Endpoint | Method | Description | Request Body |
26
31
| :--- | :--- | :--- | :--- |
27
32
|`/pay`|`POST`| Initiates a one-time bill payment. |`fromAccountId`, `toAccountId`, `amount`, `currency`, `billId`|
28
33
|`/recurring`|`POST`| Schedules a recurring bill payment. |`fromAccountId`, `toAccountId`, `amount`, `currency`, `billId`, `frequency`, `startDate`|
29
34
|`/cancel/{bill_id}`|`POST`| Cancels a pending or recurring payment after verifying it exists. |`user_id`|
35
+
36
+
#### Card Payments (Stripe)
37
+
| Endpoint | Method | Description | Request Body |
38
+
| :--- | :--- | :--- | :--- |
39
+
|`/card-payment`|`POST`| Process a card payment via Stripe. |`billId`, `amount`, `currency`, `cardNumber`, `expMonth`, `expYear`, `cvc`, `saveCard`, `customerId`|
40
+
|`/payment-method`|`POST`| Save a payment method (card) for future use. |`cardNumber`, `expMonth`, `expYear`, `cvc`, `customerId`, `customerEmail`|
41
+
|`/payment-methods/{customer_id}`|`GET`| List all saved payment methods for a customer. | None |
42
+
43
+
#### Health Check
44
+
| Endpoint | Method | Description | Request Body |
45
+
| :--- | :--- | :--- | :--- |
30
46
|`/health`|`GET`| A health check endpoint that returns a status of `healthy`. | None |
31
47
32
48
---
33
49
50
+
### 🔧 Stripe Configuration
51
+
52
+
To enable card payment functionality, you need to configure Stripe API keys.
53
+
54
+
1.**Get Stripe Test Keys**:
55
+
- Sign up at https://stripe.com
56
+
- Get test API keys from https://dashboard.stripe.com/test/apikeys
57
+
- Copy your `sk_test_*` (secret key) and `pk_test_*` (publishable key)
2.**Navigate to the Root Directory**: Open a terminal and navigate to the root directory of the `relibank` repository, where the `docker-compose.yml` file is located.
120
+
2.**Navigate to Root Directory**: Open a terminal and navigate to the root directory of the `relibank` repository.
41
121
42
-
3.**Start the Stack**: Run the following command to build the service images and start all containers. The `--build` flag is crucial for applying any code or dependency changes.
122
+
3.**Start the Stack**: Run the following command to build and deploy all services:
43
123
44
124
```bash
45
-
docker compose up --build
125
+
skaffold dev
46
126
```
47
127
48
-
This command will start the `mssql` and `kafka` containers first, waitfor them to become healthy, and thenstart the `bill-pay` service.
128
+
This command will build all services, deploy to Kubernetes, and start port forwarding.
0 commit comments