@aepstore-dev/contracts 1.46.0 → 1.47.0

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.
package/gen/payments.d.ts CHANGED
@@ -55,6 +55,25 @@ export interface BindCardRequest {
55
55
  userId: string;
56
56
  returnUrl: string;
57
57
  }
58
+ export interface GetPaymentIntentRequest {
59
+ intentId: string;
60
+ /** ownership check */
61
+ userId: string;
62
+ }
63
+ export interface PaymentIntentStatus {
64
+ id: string;
65
+ userId: string;
66
+ /** TOPUP | PREMIUM */
67
+ purpose: string;
68
+ /** PENDING | COMPLETED | FAILED | CANCELED */
69
+ status: string;
70
+ amount: string;
71
+ currency: string;
72
+ /** set when purpose=PREMIUM (else empty) */
73
+ purchaseId: string;
74
+ createdAt: string;
75
+ updatedAt: string;
76
+ }
58
77
  export interface CheckoutResponse {
59
78
  purchaseId: string;
60
79
  paymentId: string;
@@ -562,6 +581,11 @@ export interface PaymentsServiceClient {
562
581
  * persisted and the 1₽ credits USER_SPENDING so the user keeps it.
563
582
  */
564
583
  bindCard(request: BindCardRequest): Observable<CheckoutResponse>;
584
+ /**
585
+ * Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
586
+ * completion. Ownership-checked by user_id.
587
+ */
588
+ getPaymentIntent(request: GetPaymentIntentRequest): Observable<PaymentIntentStatus>;
565
589
  /** ----- payout details ----- */
566
590
  updatePayoutDetails(request: UpdatePayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
567
591
  getPayoutDetails(request: GetPayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
@@ -619,6 +643,11 @@ export interface PaymentsServiceController {
619
643
  * persisted and the 1₽ credits USER_SPENDING so the user keeps it.
620
644
  */
621
645
  bindCard(request: BindCardRequest): Promise<CheckoutResponse> | Observable<CheckoutResponse> | CheckoutResponse;
646
+ /**
647
+ * Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
648
+ * completion. Ownership-checked by user_id.
649
+ */
650
+ getPaymentIntent(request: GetPaymentIntentRequest): Promise<PaymentIntentStatus> | Observable<PaymentIntentStatus> | PaymentIntentStatus;
622
651
  /** ----- payout details ----- */
623
652
  updatePayoutDetails(request: UpdatePayoutDetailsRequest): Promise<UpdatePayoutDetailsResponse> | Observable<UpdatePayoutDetailsResponse> | UpdatePayoutDetailsResponse;
624
653
  getPayoutDetails(request: GetPayoutDetailsRequest): Promise<UpdatePayoutDetailsResponse> | Observable<UpdatePayoutDetailsResponse> | UpdatePayoutDetailsResponse;
package/gen/payments.js CHANGED
@@ -36,6 +36,7 @@ function PaymentsServiceControllerMethods() {
36
36
  "setDefaultSavedCard",
37
37
  "updateSavedCard",
38
38
  "bindCard",
39
+ "getPaymentIntent",
39
40
  "updatePayoutDetails",
40
41
  "getPayoutDetails",
41
42
  "getAdminOverview",
package/gen/payments.ts CHANGED
@@ -70,6 +70,27 @@ export interface BindCardRequest {
70
70
  returnUrl: string;
71
71
  }
72
72
 
73
+ export interface GetPaymentIntentRequest {
74
+ intentId: string;
75
+ /** ownership check */
76
+ userId: string;
77
+ }
78
+
79
+ export interface PaymentIntentStatus {
80
+ id: string;
81
+ userId: string;
82
+ /** TOPUP | PREMIUM */
83
+ purpose: string;
84
+ /** PENDING | COMPLETED | FAILED | CANCELED */
85
+ status: string;
86
+ amount: string;
87
+ currency: string;
88
+ /** set when purpose=PREMIUM (else empty) */
89
+ purchaseId: string;
90
+ createdAt: string;
91
+ updatedAt: string;
92
+ }
93
+
73
94
  export interface CheckoutResponse {
74
95
  purchaseId: string;
75
96
  paymentId: string;
@@ -665,6 +686,13 @@ export interface PaymentsServiceClient {
665
686
 
666
687
  bindCard(request: BindCardRequest): Observable<CheckoutResponse>;
667
688
 
689
+ /**
690
+ * Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
691
+ * completion. Ownership-checked by user_id.
692
+ */
693
+
694
+ getPaymentIntent(request: GetPaymentIntentRequest): Observable<PaymentIntentStatus>;
695
+
668
696
  /** ----- payout details ----- */
669
697
 
670
698
  updatePayoutDetails(request: UpdatePayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
@@ -785,6 +813,15 @@ export interface PaymentsServiceController {
785
813
 
786
814
  bindCard(request: BindCardRequest): Promise<CheckoutResponse> | Observable<CheckoutResponse> | CheckoutResponse;
787
815
 
816
+ /**
817
+ * Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
818
+ * completion. Ownership-checked by user_id.
819
+ */
820
+
821
+ getPaymentIntent(
822
+ request: GetPaymentIntentRequest,
823
+ ): Promise<PaymentIntentStatus> | Observable<PaymentIntentStatus> | PaymentIntentStatus;
824
+
788
825
  /** ----- payout details ----- */
789
826
 
790
827
  updatePayoutDetails(
@@ -841,6 +878,7 @@ export function PaymentsServiceControllerMethods() {
841
878
  "setDefaultSavedCard",
842
879
  "updateSavedCard",
843
880
  "bindCard",
881
+ "getPaymentIntent",
844
882
  "updatePayoutDetails",
845
883
  "getPayoutDetails",
846
884
  "getAdminOverview",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.46.0",
3
+ "version": "1.47.0",
4
4
  "description": "Protobuf definitions for aepstore microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -46,6 +46,9 @@ service PaymentsService {
46
46
  // save_payment_method=true; after the webhook the SavedCard row is
47
47
  // persisted and the 1₽ credits USER_SPENDING so the user keeps it.
48
48
  rpc BindCard(BindCardRequest) returns (CheckoutResponse);
49
+ // Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
50
+ // completion. Ownership-checked by user_id.
51
+ rpc GetPaymentIntent(GetPaymentIntentRequest) returns (PaymentIntentStatus);
49
52
 
50
53
  // ----- payout details -----
51
54
  rpc UpdatePayoutDetails(UpdatePayoutDetailsRequest) returns (UpdatePayoutDetailsResponse);
@@ -105,6 +108,23 @@ message BindCardRequest {
105
108
  string return_url = 2;
106
109
  }
107
110
 
111
+ message GetPaymentIntentRequest {
112
+ string intent_id = 1;
113
+ string user_id = 2; // ownership check
114
+ }
115
+
116
+ message PaymentIntentStatus {
117
+ string id = 1;
118
+ string user_id = 2;
119
+ string purpose = 3; // TOPUP | PREMIUM
120
+ string status = 4; // PENDING | COMPLETED | FAILED | CANCELED
121
+ string amount = 5;
122
+ string currency = 6;
123
+ string purchase_id = 7; // set when purpose=PREMIUM (else empty)
124
+ string created_at = 8;
125
+ string updated_at = 9;
126
+ }
127
+
108
128
  message CheckoutResponse {
109
129
  string purchase_id = 1;
110
130
  string payment_id = 2;