@just-education-org/rpc-contracts 1.18.0 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,12 +8,16 @@ export interface CreatePaymentRequest {
8
8
  savePaymentMethod: boolean;
9
9
  /** ISO 4217, lowercase (e.g. "usd or uah"), as required by Stripe */
10
10
  currency: string;
11
+ bookingId: string;
11
12
  }
12
13
  export interface CreatePaymentResponse {
13
14
  url: string;
14
15
  }
15
16
  export interface ProcessPaymentEventRequest {
16
- /** Payment Success | Cancelled | Waiting for Captured? */
17
+ /**
18
+ * Our own normalized event type (PAYMENT_SUCCEEDED | PAYMENT_FAILED),
19
+ * not the provider's raw event type — keeps payment-service provider-agnostic
20
+ */
17
21
  event: string;
18
22
  paymentId: string;
19
23
  bookingId: string;
@@ -25,6 +29,11 @@ export interface ProcessPaymentEventRequest {
25
29
  cardLast4?: string | undefined;
26
30
  bank?: string | undefined;
27
31
  brand?: string | undefined;
32
+ /**
33
+ * Final payment id at the provider (e.g. Stripe PaymentIntent) —
34
+ * written to Payment.providerId, replacing the intermediate id (e.g. Checkout Session)
35
+ */
36
+ providerIntentId?: string | undefined;
28
37
  }
29
38
  export interface ProcessPaymentEventResponse {
30
39
  ok: boolean;
@@ -14,11 +14,13 @@ export interface CreatePaymentMethodResponse {
14
14
  url: string;
15
15
  }
16
16
  /**
17
- * - Що таке verify?
18
- * - youkassa не присилає вебхук, коли в нас прив"язаний paymeth method.
19
- * / і нам треба це самим в ручну перевіряти, і тому коли в нас буде відбуватесь стврення, ми буде створювать paymetnMethod в насшій БД(без даних карти) та привязка до юзера
20
- * / і коли юзер це все прив"язує його на фронті перекидує на сторінку де в квері параметрі прикинутий ід пеймент метода в нашій системі і там ми як раз викликаємо verify payment method
21
- * Відбувається пошук платіжного способу, в нашій системі і далі вже його прив"язка
17
+ * - What is verify for?
18
+ * - The provider doesn't send a webhook when a payment method gets linked.
19
+ * We have to check this ourselves: on creation we make a PaymentMethod row
20
+ * in our DB (no card data yet) linked to the user, and once the user
21
+ * finishes linking it on the provider's page, the frontend redirects back
22
+ * with our internal payment method id as a query param — that's when we
23
+ * call VerifyPaymentMethod to look it up and confirm the link.
22
24
  */
23
25
  export interface VerifyPaymentMethodRequest {
24
26
  userId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@just-education-org/rpc-contracts",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "description": "Protobuf definitions and generated TS types",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -14,6 +14,7 @@ message CreatePaymentRequest {
14
14
  optional string payment_method_id = 4;
15
15
  bool save_payment_method = 5;
16
16
  string currency = 6; // ISO 4217, lowercase (e.g. "usd or uah"), as required by Stripe
17
+ string booking_id = 7;
17
18
  }
18
19
 
19
20
  message CreatePaymentResponse {
@@ -21,7 +22,9 @@ message CreatePaymentResponse {
21
22
  }
22
23
 
23
24
  message ProcessPaymentEventRequest {
24
- string event = 1; // Payment Success | Cancelled | Waiting for Captured?
25
+ // Our own normalized event type (PAYMENT_SUCCEEDED | PAYMENT_FAILED),
26
+ // not the provider's raw event type — keeps payment-service provider-agnostic
27
+ string event = 1;
25
28
  string payment_id = 2;
26
29
  string booking_id = 3;
27
30
  string user_id = 4;
@@ -33,6 +36,10 @@ message ProcessPaymentEventRequest {
33
36
 
34
37
  optional string bank = 9;
35
38
  optional string brand = 10;
39
+
40
+ // Final payment id at the provider (e.g. Stripe PaymentIntent) —
41
+ // written to Payment.providerId, replacing the intermediate id (e.g. Checkout Session)
42
+ optional string provider_intent_id = 11;
36
43
  }
37
44
 
38
45
  message ProcessPaymentEventResponse {
@@ -26,11 +26,13 @@ message CreatePaymentMethodResponse {
26
26
  }
27
27
 
28
28
  message VerifyPaymentMethodRequest {
29
- // - Що таке verify?
30
- // - youkassa не присилає вебхук, коли в нас прив"язаний paymeth method.
31
- /// і нам треба це самим в ручну перевіряти, і тому коли в нас буде відбуватесь стврення, ми буде створювать paymetnMethod в насшій БД(без даних карти) та привязка до юзера
32
- /// і коли юзер це все прив"язує його на фронті перекидує на сторінку де в квері параметрі прикинутий ід пеймент метода в нашій системі і там ми як раз викликаємо verify payment method
33
- // Відбувається пошук платіжного способу, в нашій системі і далі вже його прив"язка
29
+ // - What is verify for?
30
+ // - The provider doesn't send a webhook when a payment method gets linked.
31
+ // We have to check this ourselves: on creation we make a PaymentMethod row
32
+ // in our DB (no card data yet) linked to the user, and once the user
33
+ // finishes linking it on the provider's page, the frontend redirects back
34
+ // with our internal payment method id as a query param — that's when we
35
+ // call VerifyPaymentMethod to look it up and confirm the link.
34
36
 
35
37
  string user_id = 1;
36
38
  string method_id = 2;