@stateset/acp-client 1.0.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.
@@ -0,0 +1,232 @@
1
+ syntax = "proto3";
2
+
3
+ package acp_handler.v1;
4
+
5
+ service AcpHandler {
6
+ rpc CreateCheckoutSession(CreateCheckoutSessionRequest) returns (CheckoutSession);
7
+ rpc GetCheckoutSession(GetCheckoutSessionRequest) returns (CheckoutSession);
8
+ rpc UpdateCheckoutSession(UpdateCheckoutSessionRequest) returns (CheckoutSession);
9
+ rpc CompleteCheckoutSession(CompleteCheckoutSessionRequest) returns (CheckoutSessionWithOrder);
10
+ rpc CancelCheckoutSession(CancelCheckoutSessionRequest) returns (CheckoutSession);
11
+ rpc DelegatePayment(DelegatePaymentRequest) returns (DelegatePaymentResponse);
12
+ }
13
+
14
+ message GetCheckoutSessionRequest {
15
+ string session_id = 1;
16
+ }
17
+
18
+ message CancelCheckoutSessionRequest {
19
+ string session_id = 1;
20
+ }
21
+
22
+ message CreateCheckoutSessionRequest {
23
+ repeated RequestItem items = 1;
24
+ Customer customer = 2;
25
+ FulfillmentState fulfillment = 3;
26
+ }
27
+
28
+ message UpdateCheckoutSessionRequest {
29
+ string session_id = 1;
30
+ RequestItemList items = 2;
31
+ Customer customer = 3;
32
+ FulfillmentState fulfillment = 4;
33
+ }
34
+
35
+ message CompleteCheckoutSessionRequest {
36
+ string session_id = 1;
37
+ PaymentRequest payment = 2;
38
+ Customer customer = 3;
39
+ FulfillmentState fulfillment = 4;
40
+ }
41
+
42
+ message RequestItemList {
43
+ repeated RequestItem items = 1;
44
+ }
45
+
46
+ message RequestItem {
47
+ string id = 1;
48
+ int32 quantity = 2;
49
+ }
50
+
51
+ message PaymentRequest {
52
+ // If empty, delegated token is not provided.
53
+ string delegated_token = 1;
54
+ // If empty, payment method is not provided.
55
+ string method = 2;
56
+ }
57
+
58
+ enum CheckoutSessionStatus {
59
+ CHECKOUT_SESSION_STATUS_UNSPECIFIED = 0;
60
+ NOT_READY_FOR_PAYMENT = 1;
61
+ READY_FOR_PAYMENT = 2;
62
+ COMPLETED = 3;
63
+ CANCELED = 4;
64
+ }
65
+
66
+ message CheckoutSession {
67
+ string id = 1;
68
+ CheckoutSessionStatus status = 2;
69
+ repeated LineItem items = 3;
70
+ Totals totals = 4;
71
+ FulfillmentState fulfillment = 5;
72
+ Customer customer = 6;
73
+ Links links = 7;
74
+ repeated Message messages = 8;
75
+ string created_at = 9;
76
+ string updated_at = 10;
77
+ }
78
+
79
+ message CheckoutSessionWithOrder {
80
+ CheckoutSession session = 1;
81
+ Order order = 2;
82
+ }
83
+
84
+ message LineItem {
85
+ string id = 1;
86
+ string title = 2;
87
+ int32 quantity = 3;
88
+ Money unit_price = 4;
89
+ string variant_id = 5;
90
+ string sku = 6;
91
+ string image_url = 7;
92
+ }
93
+
94
+ message Money {
95
+ int64 amount = 1;
96
+ string currency = 2;
97
+ }
98
+
99
+ message Totals {
100
+ Money subtotal = 1;
101
+ Money tax = 2;
102
+ Money shipping = 3;
103
+ Money discount = 4;
104
+ Money grand_total = 5;
105
+ }
106
+
107
+ message FulfillmentState {
108
+ string selected_id = 1;
109
+ repeated FulfillmentChoice options = 2;
110
+ }
111
+
112
+ message FulfillmentChoice {
113
+ string id = 1;
114
+ string label = 2;
115
+ Money price = 3;
116
+ EstimatedDelivery est_delivery = 4;
117
+ }
118
+
119
+ message EstimatedDelivery {
120
+ string earliest = 1;
121
+ string latest = 2;
122
+ }
123
+
124
+ message Customer {
125
+ Address billing_address = 1;
126
+ Address shipping_address = 2;
127
+ }
128
+
129
+ message Address {
130
+ string name = 1;
131
+ string line1 = 2;
132
+ string line2 = 3;
133
+ string city = 4;
134
+ string region = 5;
135
+ string postal_code = 6;
136
+ string country = 7;
137
+ string phone = 8;
138
+ string email = 9;
139
+ }
140
+
141
+ message Links {
142
+ string terms = 1;
143
+ string privacy = 2;
144
+ string order_permalink = 3;
145
+ }
146
+
147
+ enum MessageType {
148
+ MESSAGE_TYPE_UNSPECIFIED = 0;
149
+ INFO = 1;
150
+ WARNING = 2;
151
+ ERROR = 3;
152
+ }
153
+
154
+ message Message {
155
+ MessageType type = 1;
156
+ string code = 2;
157
+ string message = 3;
158
+ string param = 4;
159
+ }
160
+
161
+ enum OrderStatus {
162
+ ORDER_STATUS_UNSPECIFIED = 0;
163
+ PLACED = 1;
164
+ FAILED = 2;
165
+ REFUNDED = 3;
166
+ }
167
+
168
+ message Order {
169
+ string id = 1;
170
+ string checkout_session_id = 2;
171
+ OrderStatus status = 3;
172
+ string permalink_url = 4;
173
+ }
174
+
175
+ message DelegatePaymentRequest {
176
+ PaymentMethod payment_method = 1;
177
+ Allowance allowance = 2;
178
+ BillingAddress billing_address = 3;
179
+ repeated RiskSignal risk_signals = 4;
180
+ string metadata_json = 5;
181
+ }
182
+
183
+ message DelegatePaymentResponse {
184
+ string id = 1;
185
+ string created = 2;
186
+ string metadata_json = 3;
187
+ }
188
+
189
+ message PaymentMethod {
190
+ string type = 1;
191
+ string card_number_type = 2;
192
+ string number = 3;
193
+ string exp_month = 4;
194
+ string exp_year = 5;
195
+ string name = 6;
196
+ string cvc = 7;
197
+ string cryptogram = 8;
198
+ string eci_value = 9;
199
+ repeated string checks_performed = 10;
200
+ string iin = 11;
201
+ string display_card_funding_type = 12;
202
+ string display_wallet_type = 13;
203
+ string display_brand = 14;
204
+ string display_last4 = 15;
205
+ string metadata_json = 16;
206
+ }
207
+
208
+ message BillingAddress {
209
+ string name = 1;
210
+ string line_one = 2;
211
+ string line_two = 3;
212
+ string city = 4;
213
+ string state = 5;
214
+ string country = 6;
215
+ string postal_code = 7;
216
+ }
217
+
218
+ message Allowance {
219
+ string reason = 1;
220
+ int64 max_amount = 2;
221
+ string currency = 3;
222
+ string checkout_session_id = 4;
223
+ string merchant_id = 5;
224
+ string expires_at = 6;
225
+ }
226
+
227
+ message RiskSignal {
228
+ string type = 1;
229
+ int32 score = 2;
230
+ string action = 3;
231
+ }
232
+