@aepstore-dev/contracts 1.46.0 → 1.47.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.
- package/gen/payments.d.ts +31 -0
- package/gen/payments.js +1 -0
- package/gen/payments.ts +40 -0
- package/package.json +1 -1
- package/proto/payments.proto +21 -0
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;
|
|
@@ -62,6 +81,8 @@ export interface CheckoutResponse {
|
|
|
62
81
|
confirmationUrl: string;
|
|
63
82
|
/** PENDING (redirect) | COMPLETED (balance) */
|
|
64
83
|
status: string;
|
|
84
|
+
/** poll via GetPaymentIntent for TOPUP / bind-card flows */
|
|
85
|
+
intentId: string;
|
|
65
86
|
}
|
|
66
87
|
export interface GetMyPurchasesRequest {
|
|
67
88
|
userId: string;
|
|
@@ -562,6 +583,11 @@ export interface PaymentsServiceClient {
|
|
|
562
583
|
* persisted and the 1₽ credits USER_SPENDING so the user keeps it.
|
|
563
584
|
*/
|
|
564
585
|
bindCard(request: BindCardRequest): Observable<CheckoutResponse>;
|
|
586
|
+
/**
|
|
587
|
+
* Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
|
|
588
|
+
* completion. Ownership-checked by user_id.
|
|
589
|
+
*/
|
|
590
|
+
getPaymentIntent(request: GetPaymentIntentRequest): Observable<PaymentIntentStatus>;
|
|
565
591
|
/** ----- payout details ----- */
|
|
566
592
|
updatePayoutDetails(request: UpdatePayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
|
|
567
593
|
getPayoutDetails(request: GetPayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
|
|
@@ -619,6 +645,11 @@ export interface PaymentsServiceController {
|
|
|
619
645
|
* persisted and the 1₽ credits USER_SPENDING so the user keeps it.
|
|
620
646
|
*/
|
|
621
647
|
bindCard(request: BindCardRequest): Promise<CheckoutResponse> | Observable<CheckoutResponse> | CheckoutResponse;
|
|
648
|
+
/**
|
|
649
|
+
* Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
|
|
650
|
+
* completion. Ownership-checked by user_id.
|
|
651
|
+
*/
|
|
652
|
+
getPaymentIntent(request: GetPaymentIntentRequest): Promise<PaymentIntentStatus> | Observable<PaymentIntentStatus> | PaymentIntentStatus;
|
|
622
653
|
/** ----- payout details ----- */
|
|
623
654
|
updatePayoutDetails(request: UpdatePayoutDetailsRequest): Promise<UpdatePayoutDetailsResponse> | Observable<UpdatePayoutDetailsResponse> | UpdatePayoutDetailsResponse;
|
|
624
655
|
getPayoutDetails(request: GetPayoutDetailsRequest): Promise<UpdatePayoutDetailsResponse> | Observable<UpdatePayoutDetailsResponse> | UpdatePayoutDetailsResponse;
|
package/gen/payments.js
CHANGED
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;
|
|
@@ -77,6 +98,8 @@ export interface CheckoutResponse {
|
|
|
77
98
|
confirmationUrl: string;
|
|
78
99
|
/** PENDING (redirect) | COMPLETED (balance) */
|
|
79
100
|
status: string;
|
|
101
|
+
/** poll via GetPaymentIntent for TOPUP / bind-card flows */
|
|
102
|
+
intentId: string;
|
|
80
103
|
}
|
|
81
104
|
|
|
82
105
|
export interface GetMyPurchasesRequest {
|
|
@@ -665,6 +688,13 @@ export interface PaymentsServiceClient {
|
|
|
665
688
|
|
|
666
689
|
bindCard(request: BindCardRequest): Observable<CheckoutResponse>;
|
|
667
690
|
|
|
691
|
+
/**
|
|
692
|
+
* Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
|
|
693
|
+
* completion. Ownership-checked by user_id.
|
|
694
|
+
*/
|
|
695
|
+
|
|
696
|
+
getPaymentIntent(request: GetPaymentIntentRequest): Observable<PaymentIntentStatus>;
|
|
697
|
+
|
|
668
698
|
/** ----- payout details ----- */
|
|
669
699
|
|
|
670
700
|
updatePayoutDetails(request: UpdatePayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
|
|
@@ -785,6 +815,15 @@ export interface PaymentsServiceController {
|
|
|
785
815
|
|
|
786
816
|
bindCard(request: BindCardRequest): Promise<CheckoutResponse> | Observable<CheckoutResponse> | CheckoutResponse;
|
|
787
817
|
|
|
818
|
+
/**
|
|
819
|
+
* Poll an intent after returnUrl redirect: TOPUP/PREMIUM completion, bind-card
|
|
820
|
+
* completion. Ownership-checked by user_id.
|
|
821
|
+
*/
|
|
822
|
+
|
|
823
|
+
getPaymentIntent(
|
|
824
|
+
request: GetPaymentIntentRequest,
|
|
825
|
+
): Promise<PaymentIntentStatus> | Observable<PaymentIntentStatus> | PaymentIntentStatus;
|
|
826
|
+
|
|
788
827
|
/** ----- payout details ----- */
|
|
789
828
|
|
|
790
829
|
updatePayoutDetails(
|
|
@@ -841,6 +880,7 @@ export function PaymentsServiceControllerMethods() {
|
|
|
841
880
|
"setDefaultSavedCard",
|
|
842
881
|
"updateSavedCard",
|
|
843
882
|
"bindCard",
|
|
883
|
+
"getPaymentIntent",
|
|
844
884
|
"updatePayoutDetails",
|
|
845
885
|
"getPayoutDetails",
|
|
846
886
|
"getAdminOverview",
|
package/package.json
CHANGED
package/proto/payments.proto
CHANGED
|
@@ -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,11 +108,29 @@ 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;
|
|
111
131
|
string confirmation_url = 3; // empty when paid from balance (instant)
|
|
112
132
|
string status = 4; // PENDING (redirect) | COMPLETED (balance)
|
|
133
|
+
string intent_id = 5; // poll via GetPaymentIntent for TOPUP / bind-card flows
|
|
113
134
|
}
|
|
114
135
|
|
|
115
136
|
message GetMyPurchasesRequest { string user_id = 1; int32 page = 2; int32 limit = 3; }
|