diff --git a/docs/docs.json b/docs/docs.json index 66be1c2d..09e571da 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -2689,6 +2689,29 @@ "hasMessages": true, "hasServices": true, "enums": [ + { + "name": "ProductTier", + "longName": "ProductTier", + "fullName": "api.v1.ProductTier", + "description": "ProductTier is an explicit indicator for the state in which the customer is using the products.", + "values": [ + { + "name": "PRODUCT_TIER_UNSPECIFIED", + "number": "0", + "description": "PRODUCT_TIER_UNSPECIFIED is unspecified" + }, + { + "name": "PRODUCT_TIER_TRIAL", + "number": "1", + "description": "PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information." + }, + { + "name": "PRODUCT_TIER_PAID", + "number": "2", + "description": "PRODUCT_TIER_PAID indicates a customer that has provided payment information." + } + ] + }, { "name": "ProductType", "longName": "ProductType", @@ -3261,62 +3284,14 @@ "isoneof": true, "oneofdecl": "_balance", "defaultValue": "" - } - ] - }, - { - "name": "PaymentServiceCheckIfCustomerExistsRequest", - "longName": "PaymentServiceCheckIfCustomerExistsRequest", - "fullName": "api.v1.PaymentServiceCheckIfCustomerExistsRequest", - "description": "PaymentServiceCheckIfCustomerExistsRequest is the request payload for a payment check if customer exists request", - "hasExtensions": false, - "hasFields": true, - "hasOneofs": false, - "extensions": [], - "fields": [ - { - "name": "login", - "description": "Login of the customer", - "label": "", - "type": "string", - "longType": "string", - "fullType": "string", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" - } - ] - }, - { - "name": "PaymentServiceCheckIfCustomerExistsResponse", - "longName": "PaymentServiceCheckIfCustomerExistsResponse", - "fullName": "api.v1.PaymentServiceCheckIfCustomerExistsResponse", - "description": "PaymentServiceCheckIfCustomerExistsResponse is the response payload for a payment check if customer exists request", - "hasExtensions": false, - "hasFields": true, - "hasOneofs": false, - "extensions": [], - "fields": [ - { - "name": "customer", - "description": "Customer is the customer", - "label": "", - "type": "PaymentCustomer", - "longType": "PaymentCustomer", - "fullType": "api.v1.PaymentCustomer", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" }, { - "name": "exists", - "description": "Exists indicates if this customer exists", + "name": "tier", + "description": "Tier describes the state in which the customer is using the products.", "label": "", - "type": "bool", - "longType": "bool", - "fullType": "bool", + "type": "ProductTier", + "longType": "ProductTier", + "fullType": "api.v1.ProductTier", "ismap": false, "isoneof": false, "oneofdecl": "", @@ -3325,10 +3300,10 @@ ] }, { - "name": "PaymentServiceCreateOrUpdateCustomerRequest", - "longName": "PaymentServiceCreateOrUpdateCustomerRequest", - "fullName": "api.v1.PaymentServiceCreateOrUpdateCustomerRequest", - "description": "PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request", + "name": "PaymentServiceCreateRequest", + "longName": "PaymentServiceCreateRequest", + "fullName": "api.v1.PaymentServiceCreateRequest", + "description": "PaymentServiceCreateRequest is the request payload for providing payment data", "hasExtensions": false, "hasFields": true, "hasOneofs": true, @@ -3336,7 +3311,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -3349,49 +3324,37 @@ { "name": "name", "description": "Name of the customer to be billed", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_name", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { "name": "payment_method_id", "description": "PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_payment_method_id", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { "name": "email", "description": "Email of the customer to be billed", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_email", - "defaultValue": "" - }, - { - "name": "card", - "description": "Card the customer to be billed", - "label": "optional", - "type": "Card", - "longType": "Card", - "fullType": "api.v1.Card", - "ismap": false, - "isoneof": true, - "oneofdecl": "_card", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { @@ -3409,13 +3372,13 @@ { "name": "vat", "description": "Vat which applies to the customer to be billed", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_vat", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { @@ -3433,10 +3396,10 @@ ] }, { - "name": "PaymentServiceCreateOrUpdateCustomerResponse", - "longName": "PaymentServiceCreateOrUpdateCustomerResponse", - "fullName": "api.v1.PaymentServiceCreateOrUpdateCustomerResponse", - "description": "PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request", + "name": "PaymentServiceCreateResponse", + "longName": "PaymentServiceCreateResponse", + "fullName": "api.v1.PaymentServiceCreateResponse", + "description": "PaymentServiceCreateResponse is the response payload for a payment create request", "hasExtensions": false, "hasFields": true, "hasOneofs": false, @@ -3444,7 +3407,7 @@ "fields": [ { "name": "customer", - "description": "Customer is the customer", + "description": "Customer is the created customer", "label": "", "type": "PaymentCustomer", "longType": "PaymentCustomer", @@ -3457,10 +3420,10 @@ ] }, { - "name": "PaymentServiceDeletePaymentMethodRequest", - "longName": "PaymentServiceDeletePaymentMethodRequest", - "fullName": "api.v1.PaymentServiceDeletePaymentMethodRequest", - "description": "PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request", + "name": "PaymentServiceDeleteRequest", + "longName": "PaymentServiceDeleteRequest", + "fullName": "api.v1.PaymentServiceDeleteRequest", + "description": "PaymentServiceDeleteRequest is the request payload for a delete payment request", "hasExtensions": false, "hasFields": true, "hasOneofs": false, @@ -3468,7 +3431,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -3481,76 +3444,16 @@ ] }, { - "name": "PaymentServiceDeletePaymentMethodResponse", - "longName": "PaymentServiceDeletePaymentMethodResponse", - "fullName": "api.v1.PaymentServiceDeletePaymentMethodResponse", - "description": "PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request", + "name": "PaymentServiceDeleteResponse", + "longName": "PaymentServiceDeleteResponse", + "fullName": "api.v1.PaymentServiceDeleteResponse", + "description": "PaymentServiceDeleteResponse is the response payload for a delete payment request", "hasExtensions": false, "hasFields": false, "hasOneofs": false, "extensions": [], "fields": [] }, - { - "name": "PaymentServiceGetCustomerRequest", - "longName": "PaymentServiceGetCustomerRequest", - "fullName": "api.v1.PaymentServiceGetCustomerRequest", - "description": "PaymentServiceGetCustomerRequest is the request payload for a payment get customer request", - "hasExtensions": false, - "hasFields": true, - "hasOneofs": false, - "extensions": [], - "fields": [ - { - "name": "login", - "description": "Login of the customer", - "label": "", - "type": "string", - "longType": "string", - "fullType": "string", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" - }, - { - "name": "customer_id", - "description": "CustomerId of the customer", - "label": "", - "type": "string", - "longType": "string", - "fullType": "string", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" - } - ] - }, - { - "name": "PaymentServiceGetCustomerResponse", - "longName": "PaymentServiceGetCustomerResponse", - "fullName": "api.v1.PaymentServiceGetCustomerResponse", - "description": "PaymentServiceGetCustomerResponse is the response payload for a payment get customer request", - "hasExtensions": false, - "hasFields": true, - "hasOneofs": false, - "extensions": [], - "fields": [ - { - "name": "customer", - "description": "Customer is the customer", - "label": "", - "type": "PaymentCustomer", - "longType": "PaymentCustomer", - "fullType": "api.v1.PaymentCustomer", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" - } - ] - }, { "name": "PaymentServiceGetDefaultPricesRequest", "longName": "PaymentServiceGetDefaultPricesRequest", @@ -3598,7 +3501,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -3646,6 +3549,54 @@ } ] }, + { + "name": "PaymentServiceGetRequest", + "longName": "PaymentServiceGetRequest", + "fullName": "api.v1.PaymentServiceGetRequest", + "description": "PaymentServiceGetRequest is the request payload for getting the payment data", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "login", + "description": "Login of the tenant", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, + { + "name": "PaymentServiceGetResponse", + "longName": "PaymentServiceGetResponse", + "fullName": "api.v1.PaymentServiceGetResponse", + "description": "PaymentServiceGetResponse is the response payload for a payment get request", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "customer", + "description": "Customer is the payment customer", + "label": "", + "type": "PaymentCustomer", + "longType": "PaymentCustomer", + "fullType": "api.v1.PaymentCustomer", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, { "name": "PaymentServiceGetSubscriptionUsageRequest", "longName": "PaymentServiceGetSubscriptionUsageRequest", @@ -3658,7 +3609,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -3706,7 +3657,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -3754,7 +3705,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -3814,6 +3765,126 @@ } ] }, + { + "name": "PaymentServiceUpdateRequest", + "longName": "PaymentServiceUpdateRequest", + "fullName": "api.v1.PaymentServiceUpdateRequest", + "description": "PaymentServiceUpdateRequest is the request payload for updating payment data", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": true, + "extensions": [], + "fields": [ + { + "name": "login", + "description": "Login of the tenant", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "name", + "description": "Name of the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_name", + "defaultValue": "" + }, + { + "name": "payment_method_id", + "description": "PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_payment_method_id", + "defaultValue": "" + }, + { + "name": "email", + "description": "Email of the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_email", + "defaultValue": "" + }, + { + "name": "address", + "description": "Address is the postal address of the customer to be billed", + "label": "", + "type": "Address", + "longType": "Address", + "fullType": "api.v1.Address", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "vat", + "description": "Vat which applies to the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_vat", + "defaultValue": "" + }, + { + "name": "phone_number", + "description": "PhoneNumber of the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_phone_number", + "defaultValue": "" + } + ] + }, + { + "name": "PaymentServiceUpdateResponse", + "longName": "PaymentServiceUpdateResponse", + "fullName": "api.v1.PaymentServiceUpdateResponse", + "description": "PaymentServiceUpdateResponse is the response payload for a payment update request", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "customer", + "description": "Customer is the updated customer", + "label": "", + "type": "PaymentCustomer", + "longType": "PaymentCustomer", + "fullType": "api.v1.PaymentCustomer", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, { "name": "Price", "longName": "Price", @@ -3991,39 +4062,51 @@ "description": "PaymentService serves payment related functions", "methods": [ { - "name": "CreateOrUpdateCustomer", - "description": "CreateOrUpdateCustomer the payment data on the payment processor", - "requestType": "PaymentServiceCreateOrUpdateCustomerRequest", - "requestLongType": "PaymentServiceCreateOrUpdateCustomerRequest", - "requestFullType": "api.v1.PaymentServiceCreateOrUpdateCustomerRequest", + "name": "Create", + "description": "Create the payment data used for billing api resources", + "requestType": "PaymentServiceCreateRequest", + "requestLongType": "PaymentServiceCreateRequest", + "requestFullType": "api.v1.PaymentServiceCreateRequest", "requestStreaming": false, - "responseType": "PaymentServiceCreateOrUpdateCustomerResponse", - "responseLongType": "PaymentServiceCreateOrUpdateCustomerResponse", - "responseFullType": "api.v1.PaymentServiceCreateOrUpdateCustomerResponse", + "responseType": "PaymentServiceCreateResponse", + "responseLongType": "PaymentServiceCreateResponse", + "responseFullType": "api.v1.PaymentServiceCreateResponse", "responseStreaming": false }, { - "name": "GetCustomer", - "description": "GetCustomer from the payment processor", - "requestType": "PaymentServiceGetCustomerRequest", - "requestLongType": "PaymentServiceGetCustomerRequest", - "requestFullType": "api.v1.PaymentServiceGetCustomerRequest", + "name": "Update", + "description": "Update the payment data", + "requestType": "PaymentServiceUpdateRequest", + "requestLongType": "PaymentServiceUpdateRequest", + "requestFullType": "api.v1.PaymentServiceUpdateRequest", "requestStreaming": false, - "responseType": "PaymentServiceGetCustomerResponse", - "responseLongType": "PaymentServiceGetCustomerResponse", - "responseFullType": "api.v1.PaymentServiceGetCustomerResponse", + "responseType": "PaymentServiceUpdateResponse", + "responseLongType": "PaymentServiceUpdateResponse", + "responseFullType": "api.v1.PaymentServiceUpdateResponse", "responseStreaming": false }, { - "name": "CheckIfCustomerExists", - "description": "CheckIfCustomerExists at the payment processor", - "requestType": "PaymentServiceCheckIfCustomerExistsRequest", - "requestLongType": "PaymentServiceCheckIfCustomerExistsRequest", - "requestFullType": "api.v1.PaymentServiceCheckIfCustomerExistsRequest", + "name": "Delete", + "description": "Delete the payment data", + "requestType": "PaymentServiceDeleteRequest", + "requestLongType": "PaymentServiceDeleteRequest", + "requestFullType": "api.v1.PaymentServiceDeleteRequest", "requestStreaming": false, - "responseType": "PaymentServiceCheckIfCustomerExistsResponse", - "responseLongType": "PaymentServiceCheckIfCustomerExistsResponse", - "responseFullType": "api.v1.PaymentServiceCheckIfCustomerExistsResponse", + "responseType": "PaymentServiceDeleteResponse", + "responseLongType": "PaymentServiceDeleteResponse", + "responseFullType": "api.v1.PaymentServiceDeleteResponse", + "responseStreaming": false + }, + { + "name": "Get", + "description": "Get the payment data", + "requestType": "PaymentServiceGetRequest", + "requestLongType": "PaymentServiceGetRequest", + "requestFullType": "api.v1.PaymentServiceGetRequest", + "requestStreaming": false, + "responseType": "PaymentServiceGetResponse", + "responseLongType": "PaymentServiceGetResponse", + "responseFullType": "api.v1.PaymentServiceGetResponse", "responseStreaming": false }, { @@ -4038,18 +4121,6 @@ "responseFullType": "api.v1.PaymentServiceHasPaymentMethodResponse", "responseStreaming": false }, - { - "name": "DeletePaymentMethod", - "description": "DeletePaymentMethod of the customer", - "requestType": "PaymentServiceDeletePaymentMethodRequest", - "requestLongType": "PaymentServiceDeletePaymentMethodRequest", - "requestFullType": "api.v1.PaymentServiceDeletePaymentMethodRequest", - "requestStreaming": false, - "responseType": "PaymentServiceDeletePaymentMethodResponse", - "responseLongType": "PaymentServiceDeletePaymentMethodResponse", - "responseFullType": "api.v1.PaymentServiceDeletePaymentMethodResponse", - "responseStreaming": false - }, { "name": "GetSubscriptionUsage", "description": "GetSubscriptionUsage of the customer", diff --git a/go/api/v1/apiv1connect/payment.connect.go b/go/api/v1/apiv1connect/payment.connect.go index 53c6ff64..3baebc63 100644 --- a/go/api/v1/apiv1connect/payment.connect.go +++ b/go/api/v1/apiv1connect/payment.connect.go @@ -33,21 +33,17 @@ const ( // reflection-formatted method names, remove the leading slash and convert the remaining slash to a // period. const ( - // PaymentServiceCreateOrUpdateCustomerProcedure is the fully-qualified name of the PaymentService's - // CreateOrUpdateCustomer RPC. - PaymentServiceCreateOrUpdateCustomerProcedure = "/api.v1.PaymentService/CreateOrUpdateCustomer" - // PaymentServiceGetCustomerProcedure is the fully-qualified name of the PaymentService's - // GetCustomer RPC. - PaymentServiceGetCustomerProcedure = "/api.v1.PaymentService/GetCustomer" - // PaymentServiceCheckIfCustomerExistsProcedure is the fully-qualified name of the PaymentService's - // CheckIfCustomerExists RPC. - PaymentServiceCheckIfCustomerExistsProcedure = "/api.v1.PaymentService/CheckIfCustomerExists" + // PaymentServiceCreateProcedure is the fully-qualified name of the PaymentService's Create RPC. + PaymentServiceCreateProcedure = "/api.v1.PaymentService/Create" + // PaymentServiceUpdateProcedure is the fully-qualified name of the PaymentService's Update RPC. + PaymentServiceUpdateProcedure = "/api.v1.PaymentService/Update" + // PaymentServiceDeleteProcedure is the fully-qualified name of the PaymentService's Delete RPC. + PaymentServiceDeleteProcedure = "/api.v1.PaymentService/Delete" + // PaymentServiceGetProcedure is the fully-qualified name of the PaymentService's Get RPC. + PaymentServiceGetProcedure = "/api.v1.PaymentService/Get" // PaymentServiceHasPaymentMethodProcedure is the fully-qualified name of the PaymentService's // HasPaymentMethod RPC. PaymentServiceHasPaymentMethodProcedure = "/api.v1.PaymentService/HasPaymentMethod" - // PaymentServiceDeletePaymentMethodProcedure is the fully-qualified name of the PaymentService's - // DeletePaymentMethod RPC. - PaymentServiceDeletePaymentMethodProcedure = "/api.v1.PaymentService/DeletePaymentMethod" // PaymentServiceGetSubscriptionUsageProcedure is the fully-qualified name of the PaymentService's // GetSubscriptionUsage RPC. PaymentServiceGetSubscriptionUsageProcedure = "/api.v1.PaymentService/GetSubscriptionUsage" @@ -64,16 +60,16 @@ const ( // PaymentServiceClient is a client for the api.v1.PaymentService service. type PaymentServiceClient interface { - // CreateOrUpdateCustomer the payment data on the payment processor - CreateOrUpdateCustomer(context.Context, *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) - // GetCustomer from the payment processor - GetCustomer(context.Context, *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) - // CheckIfCustomerExists at the payment processor - CheckIfCustomerExists(context.Context, *connect.Request[v1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[v1.PaymentServiceCheckIfCustomerExistsResponse], error) + // Create the payment data used for billing api resources + Create(context.Context, *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) + // Update the payment data + Update(context.Context, *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) + // Delete the payment data + Delete(context.Context, *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) + // Get the payment data + Get(context.Context, *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) // HasPaymentMethod check if the customer has a payment method provided HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) - // DeletePaymentMethod of the customer - DeletePaymentMethod(context.Context, *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) // GetSubscriptionUsage of the customer GetSubscriptionUsage(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) // GetInvoices of the customer @@ -95,34 +91,34 @@ func NewPaymentServiceClient(httpClient connect.HTTPClient, baseURL string, opts baseURL = strings.TrimRight(baseURL, "/") paymentServiceMethods := v1.File_api_v1_payment_proto.Services().ByName("PaymentService").Methods() return &paymentServiceClient{ - createOrUpdateCustomer: connect.NewClient[v1.PaymentServiceCreateOrUpdateCustomerRequest, v1.PaymentServiceCreateOrUpdateCustomerResponse]( + create: connect.NewClient[v1.PaymentServiceCreateRequest, v1.PaymentServiceCreateResponse]( httpClient, - baseURL+PaymentServiceCreateOrUpdateCustomerProcedure, - connect.WithSchema(paymentServiceMethods.ByName("CreateOrUpdateCustomer")), + baseURL+PaymentServiceCreateProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Create")), connect.WithClientOptions(opts...), ), - getCustomer: connect.NewClient[v1.PaymentServiceGetCustomerRequest, v1.PaymentServiceGetCustomerResponse]( + update: connect.NewClient[v1.PaymentServiceUpdateRequest, v1.PaymentServiceUpdateResponse]( httpClient, - baseURL+PaymentServiceGetCustomerProcedure, - connect.WithSchema(paymentServiceMethods.ByName("GetCustomer")), + baseURL+PaymentServiceUpdateProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Update")), connect.WithClientOptions(opts...), ), - checkIfCustomerExists: connect.NewClient[v1.PaymentServiceCheckIfCustomerExistsRequest, v1.PaymentServiceCheckIfCustomerExistsResponse]( + delete: connect.NewClient[v1.PaymentServiceDeleteRequest, v1.PaymentServiceDeleteResponse]( httpClient, - baseURL+PaymentServiceCheckIfCustomerExistsProcedure, - connect.WithSchema(paymentServiceMethods.ByName("CheckIfCustomerExists")), + baseURL+PaymentServiceDeleteProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Delete")), connect.WithClientOptions(opts...), ), - hasPaymentMethod: connect.NewClient[v1.PaymentServiceHasPaymentMethodRequest, v1.PaymentServiceHasPaymentMethodResponse]( + get: connect.NewClient[v1.PaymentServiceGetRequest, v1.PaymentServiceGetResponse]( httpClient, - baseURL+PaymentServiceHasPaymentMethodProcedure, - connect.WithSchema(paymentServiceMethods.ByName("HasPaymentMethod")), + baseURL+PaymentServiceGetProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Get")), connect.WithClientOptions(opts...), ), - deletePaymentMethod: connect.NewClient[v1.PaymentServiceDeletePaymentMethodRequest, v1.PaymentServiceDeletePaymentMethodResponse]( + hasPaymentMethod: connect.NewClient[v1.PaymentServiceHasPaymentMethodRequest, v1.PaymentServiceHasPaymentMethodResponse]( httpClient, - baseURL+PaymentServiceDeletePaymentMethodProcedure, - connect.WithSchema(paymentServiceMethods.ByName("DeletePaymentMethod")), + baseURL+PaymentServiceHasPaymentMethodProcedure, + connect.WithSchema(paymentServiceMethods.ByName("HasPaymentMethod")), connect.WithClientOptions(opts...), ), getSubscriptionUsage: connect.NewClient[v1.PaymentServiceGetSubscriptionUsageRequest, v1.PaymentServiceGetSubscriptionUsageResponse]( @@ -154,30 +150,35 @@ func NewPaymentServiceClient(httpClient connect.HTTPClient, baseURL string, opts // paymentServiceClient implements PaymentServiceClient. type paymentServiceClient struct { - createOrUpdateCustomer *connect.Client[v1.PaymentServiceCreateOrUpdateCustomerRequest, v1.PaymentServiceCreateOrUpdateCustomerResponse] - getCustomer *connect.Client[v1.PaymentServiceGetCustomerRequest, v1.PaymentServiceGetCustomerResponse] - checkIfCustomerExists *connect.Client[v1.PaymentServiceCheckIfCustomerExistsRequest, v1.PaymentServiceCheckIfCustomerExistsResponse] + create *connect.Client[v1.PaymentServiceCreateRequest, v1.PaymentServiceCreateResponse] + update *connect.Client[v1.PaymentServiceUpdateRequest, v1.PaymentServiceUpdateResponse] + delete *connect.Client[v1.PaymentServiceDeleteRequest, v1.PaymentServiceDeleteResponse] + get *connect.Client[v1.PaymentServiceGetRequest, v1.PaymentServiceGetResponse] hasPaymentMethod *connect.Client[v1.PaymentServiceHasPaymentMethodRequest, v1.PaymentServiceHasPaymentMethodResponse] - deletePaymentMethod *connect.Client[v1.PaymentServiceDeletePaymentMethodRequest, v1.PaymentServiceDeletePaymentMethodResponse] getSubscriptionUsage *connect.Client[v1.PaymentServiceGetSubscriptionUsageRequest, v1.PaymentServiceGetSubscriptionUsageResponse] getInvoices *connect.Client[v1.PaymentServiceGetInvoicesRequest, v1.PaymentServiceGetInvoicesResponse] getDefaultPrices *connect.Client[v1.PaymentServiceGetDefaultPricesRequest, v1.PaymentServiceGetDefaultPricesResponse] hasChargeableResources *connect.Client[v1.PaymentServiceHasChargeableResourcesRequest, v1.PaymentServiceHasChargeableResourcesResponse] } -// CreateOrUpdateCustomer calls api.v1.PaymentService.CreateOrUpdateCustomer. -func (c *paymentServiceClient) CreateOrUpdateCustomer(ctx context.Context, req *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) { - return c.createOrUpdateCustomer.CallUnary(ctx, req) +// Create calls api.v1.PaymentService.Create. +func (c *paymentServiceClient) Create(ctx context.Context, req *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) { + return c.create.CallUnary(ctx, req) +} + +// Update calls api.v1.PaymentService.Update. +func (c *paymentServiceClient) Update(ctx context.Context, req *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) { + return c.update.CallUnary(ctx, req) } -// GetCustomer calls api.v1.PaymentService.GetCustomer. -func (c *paymentServiceClient) GetCustomer(ctx context.Context, req *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) { - return c.getCustomer.CallUnary(ctx, req) +// Delete calls api.v1.PaymentService.Delete. +func (c *paymentServiceClient) Delete(ctx context.Context, req *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) { + return c.delete.CallUnary(ctx, req) } -// CheckIfCustomerExists calls api.v1.PaymentService.CheckIfCustomerExists. -func (c *paymentServiceClient) CheckIfCustomerExists(ctx context.Context, req *connect.Request[v1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[v1.PaymentServiceCheckIfCustomerExistsResponse], error) { - return c.checkIfCustomerExists.CallUnary(ctx, req) +// Get calls api.v1.PaymentService.Get. +func (c *paymentServiceClient) Get(ctx context.Context, req *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) { + return c.get.CallUnary(ctx, req) } // HasPaymentMethod calls api.v1.PaymentService.HasPaymentMethod. @@ -185,11 +186,6 @@ func (c *paymentServiceClient) HasPaymentMethod(ctx context.Context, req *connec return c.hasPaymentMethod.CallUnary(ctx, req) } -// DeletePaymentMethod calls api.v1.PaymentService.DeletePaymentMethod. -func (c *paymentServiceClient) DeletePaymentMethod(ctx context.Context, req *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) { - return c.deletePaymentMethod.CallUnary(ctx, req) -} - // GetSubscriptionUsage calls api.v1.PaymentService.GetSubscriptionUsage. func (c *paymentServiceClient) GetSubscriptionUsage(ctx context.Context, req *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) { return c.getSubscriptionUsage.CallUnary(ctx, req) @@ -212,16 +208,16 @@ func (c *paymentServiceClient) HasChargeableResources(ctx context.Context, req * // PaymentServiceHandler is an implementation of the api.v1.PaymentService service. type PaymentServiceHandler interface { - // CreateOrUpdateCustomer the payment data on the payment processor - CreateOrUpdateCustomer(context.Context, *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) - // GetCustomer from the payment processor - GetCustomer(context.Context, *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) - // CheckIfCustomerExists at the payment processor - CheckIfCustomerExists(context.Context, *connect.Request[v1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[v1.PaymentServiceCheckIfCustomerExistsResponse], error) + // Create the payment data used for billing api resources + Create(context.Context, *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) + // Update the payment data + Update(context.Context, *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) + // Delete the payment data + Delete(context.Context, *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) + // Get the payment data + Get(context.Context, *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) // HasPaymentMethod check if the customer has a payment method provided HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) - // DeletePaymentMethod of the customer - DeletePaymentMethod(context.Context, *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) // GetSubscriptionUsage of the customer GetSubscriptionUsage(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) // GetInvoices of the customer @@ -239,22 +235,28 @@ type PaymentServiceHandler interface { // and JSON codecs. They also support gzip compression. func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { paymentServiceMethods := v1.File_api_v1_payment_proto.Services().ByName("PaymentService").Methods() - paymentServiceCreateOrUpdateCustomerHandler := connect.NewUnaryHandler( - PaymentServiceCreateOrUpdateCustomerProcedure, - svc.CreateOrUpdateCustomer, - connect.WithSchema(paymentServiceMethods.ByName("CreateOrUpdateCustomer")), + paymentServiceCreateHandler := connect.NewUnaryHandler( + PaymentServiceCreateProcedure, + svc.Create, + connect.WithSchema(paymentServiceMethods.ByName("Create")), + connect.WithHandlerOptions(opts...), + ) + paymentServiceUpdateHandler := connect.NewUnaryHandler( + PaymentServiceUpdateProcedure, + svc.Update, + connect.WithSchema(paymentServiceMethods.ByName("Update")), connect.WithHandlerOptions(opts...), ) - paymentServiceGetCustomerHandler := connect.NewUnaryHandler( - PaymentServiceGetCustomerProcedure, - svc.GetCustomer, - connect.WithSchema(paymentServiceMethods.ByName("GetCustomer")), + paymentServiceDeleteHandler := connect.NewUnaryHandler( + PaymentServiceDeleteProcedure, + svc.Delete, + connect.WithSchema(paymentServiceMethods.ByName("Delete")), connect.WithHandlerOptions(opts...), ) - paymentServiceCheckIfCustomerExistsHandler := connect.NewUnaryHandler( - PaymentServiceCheckIfCustomerExistsProcedure, - svc.CheckIfCustomerExists, - connect.WithSchema(paymentServiceMethods.ByName("CheckIfCustomerExists")), + paymentServiceGetHandler := connect.NewUnaryHandler( + PaymentServiceGetProcedure, + svc.Get, + connect.WithSchema(paymentServiceMethods.ByName("Get")), connect.WithHandlerOptions(opts...), ) paymentServiceHasPaymentMethodHandler := connect.NewUnaryHandler( @@ -263,12 +265,6 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler connect.WithSchema(paymentServiceMethods.ByName("HasPaymentMethod")), connect.WithHandlerOptions(opts...), ) - paymentServiceDeletePaymentMethodHandler := connect.NewUnaryHandler( - PaymentServiceDeletePaymentMethodProcedure, - svc.DeletePaymentMethod, - connect.WithSchema(paymentServiceMethods.ByName("DeletePaymentMethod")), - connect.WithHandlerOptions(opts...), - ) paymentServiceGetSubscriptionUsageHandler := connect.NewUnaryHandler( PaymentServiceGetSubscriptionUsageProcedure, svc.GetSubscriptionUsage, @@ -295,16 +291,16 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler ) return "/api.v1.PaymentService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { - case PaymentServiceCreateOrUpdateCustomerProcedure: - paymentServiceCreateOrUpdateCustomerHandler.ServeHTTP(w, r) - case PaymentServiceGetCustomerProcedure: - paymentServiceGetCustomerHandler.ServeHTTP(w, r) - case PaymentServiceCheckIfCustomerExistsProcedure: - paymentServiceCheckIfCustomerExistsHandler.ServeHTTP(w, r) + case PaymentServiceCreateProcedure: + paymentServiceCreateHandler.ServeHTTP(w, r) + case PaymentServiceUpdateProcedure: + paymentServiceUpdateHandler.ServeHTTP(w, r) + case PaymentServiceDeleteProcedure: + paymentServiceDeleteHandler.ServeHTTP(w, r) + case PaymentServiceGetProcedure: + paymentServiceGetHandler.ServeHTTP(w, r) case PaymentServiceHasPaymentMethodProcedure: paymentServiceHasPaymentMethodHandler.ServeHTTP(w, r) - case PaymentServiceDeletePaymentMethodProcedure: - paymentServiceDeletePaymentMethodHandler.ServeHTTP(w, r) case PaymentServiceGetSubscriptionUsageProcedure: paymentServiceGetSubscriptionUsageHandler.ServeHTTP(w, r) case PaymentServiceGetInvoicesProcedure: @@ -322,24 +318,24 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler // UnimplementedPaymentServiceHandler returns CodeUnimplemented from all methods. type UnimplementedPaymentServiceHandler struct{} -func (UnimplementedPaymentServiceHandler) CreateOrUpdateCustomer(context.Context, *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.CreateOrUpdateCustomer is not implemented")) +func (UnimplementedPaymentServiceHandler) Create(context.Context, *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Create is not implemented")) } -func (UnimplementedPaymentServiceHandler) GetCustomer(context.Context, *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.GetCustomer is not implemented")) +func (UnimplementedPaymentServiceHandler) Update(context.Context, *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Update is not implemented")) } -func (UnimplementedPaymentServiceHandler) CheckIfCustomerExists(context.Context, *connect.Request[v1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[v1.PaymentServiceCheckIfCustomerExistsResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.CheckIfCustomerExists is not implemented")) +func (UnimplementedPaymentServiceHandler) Delete(context.Context, *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Delete is not implemented")) } -func (UnimplementedPaymentServiceHandler) HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.HasPaymentMethod is not implemented")) +func (UnimplementedPaymentServiceHandler) Get(context.Context, *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Get is not implemented")) } -func (UnimplementedPaymentServiceHandler) DeletePaymentMethod(context.Context, *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.DeletePaymentMethod is not implemented")) +func (UnimplementedPaymentServiceHandler) HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.HasPaymentMethod is not implemented")) } func (UnimplementedPaymentServiceHandler) GetSubscriptionUsage(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) { diff --git a/go/api/v1/payment.pb.go b/go/api/v1/payment.pb.go index 5964913a..8b494367 100644 --- a/go/api/v1/payment.pb.go +++ b/go/api/v1/payment.pb.go @@ -137,6 +137,59 @@ func (UsageType) EnumDescriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{1} } +// ProductTier is an explicit indicator for the state in which the customer is using the products. +type ProductTier int32 + +const ( + // PRODUCT_TIER_UNSPECIFIED is unspecified + ProductTier_PRODUCT_TIER_UNSPECIFIED ProductTier = 0 + // PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + ProductTier_PRODUCT_TIER_TRIAL ProductTier = 1 + // PRODUCT_TIER_PAID indicates a customer that has provided payment information. + ProductTier_PRODUCT_TIER_PAID ProductTier = 2 +) + +// Enum value maps for ProductTier. +var ( + ProductTier_name = map[int32]string{ + 0: "PRODUCT_TIER_UNSPECIFIED", + 1: "PRODUCT_TIER_TRIAL", + 2: "PRODUCT_TIER_PAID", + } + ProductTier_value = map[string]int32{ + "PRODUCT_TIER_UNSPECIFIED": 0, + "PRODUCT_TIER_TRIAL": 1, + "PRODUCT_TIER_PAID": 2, + } +) + +func (x ProductTier) Enum() *ProductTier { + p := new(ProductTier) + *p = x + return p +} + +func (x ProductTier) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProductTier) Descriptor() protoreflect.EnumDescriptor { + return file_api_v1_payment_proto_enumTypes[2].Descriptor() +} + +func (ProductTier) Type() protoreflect.EnumType { + return &file_api_v1_payment_proto_enumTypes[2] +} + +func (x ProductTier) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProductTier.Descriptor instead. +func (ProductTier) EnumDescriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{2} +} + // PaymentCustomer is a customer at the payment processor type PaymentCustomer struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -165,7 +218,9 @@ type PaymentCustomer struct { // PhoneNumber of the customer PhoneNumber *string `protobuf:"bytes,12,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` // Balance actual balance of the customer - Balance *int64 `protobuf:"varint,13,opt,name=balance,proto3,oneof" json:"balance,omitempty"` + Balance *int64 `protobuf:"varint,13,opt,name=balance,proto3,oneof" json:"balance,omitempty"` + // Tier describes the state in which the customer is using the products. + Tier ProductTier `protobuf:"varint,14,opt,name=tier,proto3,enum=api.v1.ProductTier" json:"tier,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -291,6 +346,13 @@ func (x *PaymentCustomer) GetBalance() int64 { return 0 } +func (x *PaymentCustomer) GetTier() ProductTier { + if x != nil { + return x.Tier + } + return ProductTier_PRODUCT_TIER_UNSPECIFIED +} + // Card is the payment card the customer pays with type Card struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -846,43 +908,41 @@ func (x *Coupon) GetAmountLeft() int64 { return 0 } -// PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request -type PaymentServiceCreateOrUpdateCustomerRequest struct { +// PaymentServiceCreateRequest is the request payload for providing payment data +type PaymentServiceCreateRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` // Name of the customer to be billed - Name *string `protobuf:"bytes,4,opt,name=name,proto3,oneof" json:"name,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api - PaymentMethodId *string `protobuf:"bytes,5,opt,name=payment_method_id,json=paymentMethodId,proto3,oneof" json:"payment_method_id,omitempty"` + PaymentMethodId string `protobuf:"bytes,3,opt,name=payment_method_id,json=paymentMethodId,proto3" json:"payment_method_id,omitempty"` // Email of the customer to be billed - Email *string `protobuf:"bytes,6,opt,name=email,proto3,oneof" json:"email,omitempty"` - // Card the customer to be billed - Card *Card `protobuf:"bytes,7,opt,name=card,proto3,oneof" json:"card,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Address is the postal address of the customer to be billed - Address *Address `protobuf:"bytes,8,opt,name=address,proto3" json:"address,omitempty"` + Address *Address `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` // Vat which applies to the customer to be billed - Vat *string `protobuf:"bytes,9,opt,name=vat,proto3,oneof" json:"vat,omitempty"` + Vat string `protobuf:"bytes,6,opt,name=vat,proto3" json:"vat,omitempty"` // PhoneNumber of the customer to be billed - PhoneNumber *string `protobuf:"bytes,10,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` + PhoneNumber *string `protobuf:"bytes,7,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) Reset() { - *x = PaymentServiceCreateOrUpdateCustomerRequest{} +func (x *PaymentServiceCreateRequest) Reset() { + *x = PaymentServiceCreateRequest{} mi := &file_api_v1_payment_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) String() string { +func (x *PaymentServiceCreateRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceCreateOrUpdateCustomerRequest) ProtoMessage() {} +func (*PaymentServiceCreateRequest) ProtoMessage() {} -func (x *PaymentServiceCreateOrUpdateCustomerRequest) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceCreateRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -894,90 +954,83 @@ func (x *PaymentServiceCreateOrUpdateCustomerRequest) ProtoReflect() protoreflec return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceCreateOrUpdateCustomerRequest.ProtoReflect.Descriptor instead. -func (*PaymentServiceCreateOrUpdateCustomerRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceCreateRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceCreateRequest) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{7} } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetLogin() string { +func (x *PaymentServiceCreateRequest) GetLogin() string { if x != nil { return x.Login } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetPaymentMethodId() string { - if x != nil && x.PaymentMethodId != nil { - return *x.PaymentMethodId +func (x *PaymentServiceCreateRequest) GetName() string { + if x != nil { + return x.Name } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email +func (x *PaymentServiceCreateRequest) GetPaymentMethodId() string { + if x != nil { + return x.PaymentMethodId } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetCard() *Card { +func (x *PaymentServiceCreateRequest) GetEmail() string { if x != nil { - return x.Card + return x.Email } - return nil + return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetAddress() *Address { +func (x *PaymentServiceCreateRequest) GetAddress() *Address { if x != nil { return x.Address } return nil } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetVat() string { - if x != nil && x.Vat != nil { - return *x.Vat +func (x *PaymentServiceCreateRequest) GetVat() string { + if x != nil { + return x.Vat } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetPhoneNumber() string { +func (x *PaymentServiceCreateRequest) GetPhoneNumber() string { if x != nil && x.PhoneNumber != nil { return *x.PhoneNumber } return "" } -// PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request -type PaymentServiceCreateOrUpdateCustomerResponse struct { +// PaymentServiceCreateResponse is the response payload for a payment create request +type PaymentServiceCreateResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - // Customer is the customer + // Customer is the created customer Customer *PaymentCustomer `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceCreateOrUpdateCustomerResponse) Reset() { - *x = PaymentServiceCreateOrUpdateCustomerResponse{} +func (x *PaymentServiceCreateResponse) Reset() { + *x = PaymentServiceCreateResponse{} mi := &file_api_v1_payment_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceCreateOrUpdateCustomerResponse) String() string { +func (x *PaymentServiceCreateResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceCreateOrUpdateCustomerResponse) ProtoMessage() {} +func (*PaymentServiceCreateResponse) ProtoMessage() {} -func (x *PaymentServiceCreateOrUpdateCustomerResponse) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceCreateResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -989,43 +1042,53 @@ func (x *PaymentServiceCreateOrUpdateCustomerResponse) ProtoReflect() protorefle return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceCreateOrUpdateCustomerResponse.ProtoReflect.Descriptor instead. -func (*PaymentServiceCreateOrUpdateCustomerResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceCreateResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceCreateResponse) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{8} } -func (x *PaymentServiceCreateOrUpdateCustomerResponse) GetCustomer() *PaymentCustomer { +func (x *PaymentServiceCreateResponse) GetCustomer() *PaymentCustomer { if x != nil { return x.Customer } return nil } -// PaymentServiceGetCustomerRequest is the request payload for a payment get customer request -type PaymentServiceGetCustomerRequest struct { +// PaymentServiceUpdateRequest is the request payload for updating payment data +type PaymentServiceUpdateRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` - // CustomerId of the customer - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + // Name of the customer to be billed + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + PaymentMethodId *string `protobuf:"bytes,3,opt,name=payment_method_id,json=paymentMethodId,proto3,oneof" json:"payment_method_id,omitempty"` + // Email of the customer to be billed + Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty"` + // Address is the postal address of the customer to be billed + Address *Address `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` + // Vat which applies to the customer to be billed + Vat *string `protobuf:"bytes,6,opt,name=vat,proto3,oneof" json:"vat,omitempty"` + // PhoneNumber of the customer to be billed + PhoneNumber *string `protobuf:"bytes,7,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceGetCustomerRequest) Reset() { - *x = PaymentServiceGetCustomerRequest{} +func (x *PaymentServiceUpdateRequest) Reset() { + *x = PaymentServiceUpdateRequest{} mi := &file_api_v1_payment_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceGetCustomerRequest) String() string { +func (x *PaymentServiceUpdateRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceGetCustomerRequest) ProtoMessage() {} +func (*PaymentServiceUpdateRequest) ProtoMessage() {} -func (x *PaymentServiceGetCustomerRequest) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceUpdateRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1037,48 +1100,83 @@ func (x *PaymentServiceGetCustomerRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceGetCustomerRequest.ProtoReflect.Descriptor instead. -func (*PaymentServiceGetCustomerRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceUpdateRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceUpdateRequest) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{9} } -func (x *PaymentServiceGetCustomerRequest) GetLogin() string { +func (x *PaymentServiceUpdateRequest) GetLogin() string { if x != nil { return x.Login } return "" } -func (x *PaymentServiceGetCustomerRequest) GetCustomerId() string { +func (x *PaymentServiceUpdateRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *PaymentServiceUpdateRequest) GetPaymentMethodId() string { + if x != nil && x.PaymentMethodId != nil { + return *x.PaymentMethodId + } + return "" +} + +func (x *PaymentServiceUpdateRequest) GetEmail() string { + if x != nil && x.Email != nil { + return *x.Email + } + return "" +} + +func (x *PaymentServiceUpdateRequest) GetAddress() *Address { if x != nil { - return x.CustomerId + return x.Address + } + return nil +} + +func (x *PaymentServiceUpdateRequest) GetVat() string { + if x != nil && x.Vat != nil { + return *x.Vat + } + return "" +} + +func (x *PaymentServiceUpdateRequest) GetPhoneNumber() string { + if x != nil && x.PhoneNumber != nil { + return *x.PhoneNumber } return "" } -// PaymentServiceGetCustomerResponse is the response payload for a payment get customer request -type PaymentServiceGetCustomerResponse struct { +// PaymentServiceUpdateResponse is the response payload for a payment update request +type PaymentServiceUpdateResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - // Customer is the customer + // Customer is the updated customer Customer *PaymentCustomer `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceGetCustomerResponse) Reset() { - *x = PaymentServiceGetCustomerResponse{} +func (x *PaymentServiceUpdateResponse) Reset() { + *x = PaymentServiceUpdateResponse{} mi := &file_api_v1_payment_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceGetCustomerResponse) String() string { +func (x *PaymentServiceUpdateResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceGetCustomerResponse) ProtoMessage() {} +func (*PaymentServiceUpdateResponse) ProtoMessage() {} -func (x *PaymentServiceGetCustomerResponse) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceUpdateResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1090,41 +1188,41 @@ func (x *PaymentServiceGetCustomerResponse) ProtoReflect() protoreflect.Message return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceGetCustomerResponse.ProtoReflect.Descriptor instead. -func (*PaymentServiceGetCustomerResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceUpdateResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceUpdateResponse) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{10} } -func (x *PaymentServiceGetCustomerResponse) GetCustomer() *PaymentCustomer { +func (x *PaymentServiceUpdateResponse) GetCustomer() *PaymentCustomer { if x != nil { return x.Customer } return nil } -// PaymentServiceCheckIfCustomerExistsRequest is the request payload for a payment check if customer exists request -type PaymentServiceCheckIfCustomerExistsRequest struct { +// PaymentServiceGetRequest is the request payload for getting the payment data +type PaymentServiceGetRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceCheckIfCustomerExistsRequest) Reset() { - *x = PaymentServiceCheckIfCustomerExistsRequest{} +func (x *PaymentServiceGetRequest) Reset() { + *x = PaymentServiceGetRequest{} mi := &file_api_v1_payment_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceCheckIfCustomerExistsRequest) String() string { +func (x *PaymentServiceGetRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceCheckIfCustomerExistsRequest) ProtoMessage() {} +func (*PaymentServiceGetRequest) ProtoMessage() {} -func (x *PaymentServiceCheckIfCustomerExistsRequest) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceGetRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1136,43 +1234,41 @@ func (x *PaymentServiceCheckIfCustomerExistsRequest) ProtoReflect() protoreflect return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceCheckIfCustomerExistsRequest.ProtoReflect.Descriptor instead. -func (*PaymentServiceCheckIfCustomerExistsRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceGetRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceGetRequest) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{11} } -func (x *PaymentServiceCheckIfCustomerExistsRequest) GetLogin() string { +func (x *PaymentServiceGetRequest) GetLogin() string { if x != nil { return x.Login } return "" } -// PaymentServiceCheckIfCustomerExistsResponse is the response payload for a payment check if customer exists request -type PaymentServiceCheckIfCustomerExistsResponse struct { +// PaymentServiceGetResponse is the response payload for a payment get request +type PaymentServiceGetResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - // Customer is the customer - Customer *PaymentCustomer `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"` - // Exists indicates if this customer exists - Exists bool `protobuf:"varint,2,opt,name=exists,proto3" json:"exists,omitempty"` + // Customer is the payment customer + Customer *PaymentCustomer `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceCheckIfCustomerExistsResponse) Reset() { - *x = PaymentServiceCheckIfCustomerExistsResponse{} +func (x *PaymentServiceGetResponse) Reset() { + *x = PaymentServiceGetResponse{} mi := &file_api_v1_payment_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceCheckIfCustomerExistsResponse) String() string { +func (x *PaymentServiceGetResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceCheckIfCustomerExistsResponse) ProtoMessage() {} +func (*PaymentServiceGetResponse) ProtoMessage() {} -func (x *PaymentServiceCheckIfCustomerExistsResponse) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceGetResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1184,29 +1280,22 @@ func (x *PaymentServiceCheckIfCustomerExistsResponse) ProtoReflect() protoreflec return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceCheckIfCustomerExistsResponse.ProtoReflect.Descriptor instead. -func (*PaymentServiceCheckIfCustomerExistsResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceGetResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceGetResponse) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{12} } -func (x *PaymentServiceCheckIfCustomerExistsResponse) GetCustomer() *PaymentCustomer { +func (x *PaymentServiceGetResponse) GetCustomer() *PaymentCustomer { if x != nil { return x.Customer } return nil } -func (x *PaymentServiceCheckIfCustomerExistsResponse) GetExists() bool { - if x != nil { - return x.Exists - } - return false -} - // PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request type PaymentServiceHasPaymentMethodRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1313,29 +1402,29 @@ func (x *PaymentServiceHasPaymentMethodResponse) GetPositiveBalance() bool { return false } -// PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request -type PaymentServiceDeletePaymentMethodRequest struct { +// PaymentServiceDeleteRequest is the request payload for a delete payment request +type PaymentServiceDeleteRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceDeletePaymentMethodRequest) Reset() { - *x = PaymentServiceDeletePaymentMethodRequest{} +func (x *PaymentServiceDeleteRequest) Reset() { + *x = PaymentServiceDeleteRequest{} mi := &file_api_v1_payment_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceDeletePaymentMethodRequest) String() string { +func (x *PaymentServiceDeleteRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceDeletePaymentMethodRequest) ProtoMessage() {} +func (*PaymentServiceDeleteRequest) ProtoMessage() {} -func (x *PaymentServiceDeletePaymentMethodRequest) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceDeleteRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1347,39 +1436,39 @@ func (x *PaymentServiceDeletePaymentMethodRequest) ProtoReflect() protoreflect.M return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceDeletePaymentMethodRequest.ProtoReflect.Descriptor instead. -func (*PaymentServiceDeletePaymentMethodRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceDeleteRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceDeleteRequest) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{15} } -func (x *PaymentServiceDeletePaymentMethodRequest) GetLogin() string { +func (x *PaymentServiceDeleteRequest) GetLogin() string { if x != nil { return x.Login } return "" } -// PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request -type PaymentServiceDeletePaymentMethodResponse struct { +// PaymentServiceDeleteResponse is the response payload for a delete payment request +type PaymentServiceDeleteResponse struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceDeletePaymentMethodResponse) Reset() { - *x = PaymentServiceDeletePaymentMethodResponse{} +func (x *PaymentServiceDeleteResponse) Reset() { + *x = PaymentServiceDeleteResponse{} mi := &file_api_v1_payment_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceDeletePaymentMethodResponse) String() string { +func (x *PaymentServiceDeleteResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceDeletePaymentMethodResponse) ProtoMessage() {} +func (*PaymentServiceDeleteResponse) ProtoMessage() {} -func (x *PaymentServiceDeletePaymentMethodResponse) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceDeleteResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1391,15 +1480,15 @@ func (x *PaymentServiceDeletePaymentMethodResponse) ProtoReflect() protoreflect. return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceDeletePaymentMethodResponse.ProtoReflect.Descriptor instead. -func (*PaymentServiceDeletePaymentMethodResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceDeleteResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceDeleteResponse) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{16} } // PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request type PaymentServiceGetSubscriptionUsageRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1491,7 +1580,7 @@ func (x *PaymentServiceGetSubscriptionUsageResponse) GetSubscriptionUsageItems() // PaymentServiceHasPaymentMethodRequest is the request payload for a get invoices request type PaymentServiceGetInvoicesRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` // CustomerId is the id of the customer CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` @@ -1675,7 +1764,7 @@ func (x *PaymentServiceGetDefaultPricesResponse) GetPrices() []*Price { // PaymentServiceHasChargeableResourcesRequest is the request payload for a has chargeable request type PaymentServiceHasChargeableResourcesRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1768,7 +1857,7 @@ var File_api_v1_payment_proto protoreflect.FileDescriptor const file_api_v1_payment_proto_rawDesc = "" + "\n" + - "\x14api/v1/payment.proto\x12\x06api.v1\x1a\x13api/v1/common.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xda\x04\n" + + "\x14api/v1/payment.proto\x12\x06api.v1\x1a\x13api/v1/common.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x05\n" + "\x0fPaymentCustomer\x12\x14\n" + "\x05login\x18\x01 \x01(\tR\x05login\x12\x17\n" + "\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12$\n" + @@ -1784,7 +1873,8 @@ const file_api_v1_payment_proto_rawDesc = "" + " \x01(\v2\x0e.api.v1.CouponH\x05R\x06coupon\x88\x01\x01\x12\x15\n" + "\x03vat\x18\v \x01(\tH\x06R\x03vat\x88\x01\x01\x12&\n" + "\fphone_number\x18\f \x01(\tH\aR\vphoneNumber\x88\x01\x01\x12\x1d\n" + - "\abalance\x18\r \x01(\x03H\bR\abalance\x88\x01\x01B\a\n" + + "\abalance\x18\r \x01(\x03H\bR\abalance\x88\x01\x01\x12'\n" + + "\x04tier\x18\x0e \x01(\x0e2\x13.api.v1.ProductTierR\x04tierB\a\n" + "\x05_nameB\x0e\n" + "\f_customer_idB\x14\n" + "\x12_payment_method_idB\b\n" + @@ -1849,39 +1939,40 @@ const file_api_v1_payment_proto_rawDesc = "" + "\x0fmax_redemptions\x18\t \x01(\x03R\x0emaxRedemptions\x12\x1f\n" + "\vamount_left\x18\n" + " \x01(\x03R\n" + - "amountLeft\"\xce\x03\n" + - "+PaymentServiceCreateOrUpdateCustomerRequest\x12 \n" + + "amountLeft\"\xc8\x02\n" + + "\x1bPaymentServiceCreateRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12\x17\n" + - "\x04name\x18\x04 \x01(\tH\x00R\x04name\x88\x01\x01\x12/\n" + - "\x11payment_method_id\x18\x05 \x01(\tH\x01R\x0fpaymentMethodId\x88\x01\x01\x12\"\n" + - "\x05email\x18\x06 \x01(\tB\a\xbaH\x04r\x02`\x01H\x02R\x05email\x88\x01\x01\x12%\n" + - "\x04card\x18\a \x01(\v2\f.api.v1.CardH\x03R\x04card\x88\x01\x01\x12)\n" + - "\aaddress\x18\b \x01(\v2\x0f.api.v1.AddressR\aaddress\x12\x15\n" + - "\x03vat\x18\t \x01(\tH\x04R\x03vat\x88\x01\x01\x12&\n" + - "\fphone_number\x18\n" + - " \x01(\tH\x05R\vphoneNumber\x88\x01\x01B\a\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12\x1a\n" + + "\x04name\x18\x02 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x04name\x12E\n" + + "\x11payment_method_id\x18\x03 \x01(\tB\x19\xbaH\x16r\x14\x10\x032\x10pm_[a-zA-Z0-9]*$R\x0fpaymentMethodId\x12\x1d\n" + + "\x05email\x18\x04 \x01(\tB\a\xbaH\x04r\x02`\x01R\x05email\x12)\n" + + "\aaddress\x18\x05 \x01(\v2\x0f.api.v1.AddressR\aaddress\x12\x18\n" + + "\x03vat\x18\x06 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x03vat\x12/\n" + + "\fphone_number\x18\a \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\vphoneNumber\x88\x01\x01B\x0f\n" + + "\r_phone_number\"S\n" + + "\x1cPaymentServiceCreateResponse\x123\n" + + "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"\x8f\x03\n" + + "\x1bPaymentServiceUpdateRequest\x12 \n" + + "\x05login\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12 \n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\x04name\x88\x01\x01\x12J\n" + + "\x11payment_method_id\x18\x03 \x01(\tB\x19\xbaH\x16r\x14\x10\x032\x10pm_[a-zA-Z0-9]*$H\x01R\x0fpaymentMethodId\x88\x01\x01\x12\"\n" + + "\x05email\x18\x04 \x01(\tB\a\xbaH\x04r\x02`\x01H\x02R\x05email\x88\x01\x01\x12)\n" + + "\aaddress\x18\x05 \x01(\v2\x0f.api.v1.AddressR\aaddress\x12\x1e\n" + + "\x03vat\x18\x06 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x03R\x03vat\x88\x01\x01\x12/\n" + + "\fphone_number\x18\a \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x04R\vphoneNumber\x88\x01\x01B\a\n" + "\x05_nameB\x14\n" + "\x12_payment_method_idB\b\n" + - "\x06_emailB\a\n" + - "\x05_cardB\x06\n" + + "\x06_emailB\x06\n" + "\x04_vatB\x0f\n" + - "\r_phone_numberJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04R\bcustomerR\x1daccepted_terms_and_conditions\"c\n" + - ",PaymentServiceCreateOrUpdateCustomerResponse\x123\n" + - "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"e\n" + - " PaymentServiceGetCustomerRequest\x12 \n" + - "\x05login\x18\x01 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12\x1f\n" + - "\vcustomer_id\x18\x02 \x01(\tR\n" + - "customerId\"X\n" + - "!PaymentServiceGetCustomerResponse\x123\n" + - "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"N\n" + - "*PaymentServiceCheckIfCustomerExistsRequest\x12 \n" + + "\r_phone_number\"S\n" + + "\x1cPaymentServiceUpdateResponse\x123\n" + + "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"<\n" + + "\x18PaymentServiceGetRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"z\n" + - "+PaymentServiceCheckIfCustomerExistsResponse\x123\n" + - "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\x12\x16\n" + - "\x06exists\x18\x02 \x01(\bR\x06exists\"I\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"P\n" + + "\x19PaymentServiceGetResponse\x123\n" + + "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"I\n" + "%PaymentServiceHasPaymentMethodRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"\x8c\x01\n" + @@ -1889,11 +1980,11 @@ const file_api_v1_payment_proto_rawDesc = "" + "\x06exists\x18\x01 \x01(\bR\x06exists\x12\x1f\n" + "\vcoupon_left\x18\x02 \x01(\bR\n" + "couponLeft\x12)\n" + - "\x10positive_balance\x18\x03 \x01(\bR\x0fpositiveBalance\"L\n" + - "(PaymentServiceDeletePaymentMethodRequest\x12 \n" + + "\x10positive_balance\x18\x03 \x01(\bR\x0fpositiveBalance\"?\n" + + "\x1bPaymentServiceDeleteRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"+\n" + - ")PaymentServiceDeletePaymentMethodResponse\"M\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"\x1e\n" + + "\x1cPaymentServiceDeleteResponse\"M\n" + ")PaymentServiceGetSubscriptionUsageRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"\x85\x01\n" + @@ -1922,13 +2013,17 @@ const file_api_v1_payment_proto_rawDesc = "" + "\tUsageType\x12\x1a\n" + "\x16USAGE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n" + "\x12USAGE_TYPE_METERED\x10\x01\x12\x17\n" + - "\x13USAGE_TYPE_LICENSED\x10\x022\xaa\t\n" + - "\x0ePaymentService\x12\x8a\x01\n" + - "\x16CreateOrUpdateCustomer\x123.api.v1.PaymentServiceCreateOrUpdateCustomerRequest\x1a4.api.v1.PaymentServiceCreateOrUpdateCustomerResponse\"\x05\xc2\xf3\x18\x01\x01\x12m\n" + - "\vGetCustomer\x12(.api.v1.PaymentServiceGetCustomerRequest\x1a).api.v1.PaymentServiceGetCustomerResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12\x8b\x01\n" + - "\x15CheckIfCustomerExists\x122.api.v1.PaymentServiceCheckIfCustomerExistsRequest\x1a3.api.v1.PaymentServiceCheckIfCustomerExistsResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12\x7f\n" + - "\x10HasPaymentMethod\x12-.api.v1.PaymentServiceHasPaymentMethodRequest\x1a..api.v1.PaymentServiceHasPaymentMethodResponse\"\f\xc2\xf3\x18\x04\x01\x02\x03\x04\xe8\xf3\x18\x02\x12\x81\x01\n" + - "\x13DeletePaymentMethod\x120.api.v1.PaymentServiceDeletePaymentMethodRequest\x1a1.api.v1.PaymentServiceDeletePaymentMethodResponse\"\x05\xc2\xf3\x18\x01\x01\x12\x88\x01\n" + + "\x13USAGE_TYPE_LICENSED\x10\x02*Z\n" + + "\vProductTier\x12\x1c\n" + + "\x18PRODUCT_TIER_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12PRODUCT_TIER_TRIAL\x10\x01\x12\x15\n" + + "\x11PRODUCT_TIER_PAID\x10\x022\x87\b\n" + + "\x0ePaymentService\x12Z\n" + + "\x06Create\x12#.api.v1.PaymentServiceCreateRequest\x1a$.api.v1.PaymentServiceCreateResponse\"\x05\xc2\xf3\x18\x01\x01\x12Z\n" + + "\x06Update\x12#.api.v1.PaymentServiceUpdateRequest\x1a$.api.v1.PaymentServiceUpdateResponse\"\x05\xc2\xf3\x18\x01\x01\x12Z\n" + + "\x06Delete\x12#.api.v1.PaymentServiceDeleteRequest\x1a$.api.v1.PaymentServiceDeleteResponse\"\x05\xc2\xf3\x18\x01\x01\x12U\n" + + "\x03Get\x12 .api.v1.PaymentServiceGetRequest\x1a!.api.v1.PaymentServiceGetResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12\x7f\n" + + "\x10HasPaymentMethod\x12-.api.v1.PaymentServiceHasPaymentMethodRequest\x1a..api.v1.PaymentServiceHasPaymentMethodResponse\"\f\xc2\xf3\x18\x04\x01\x02\x03\x04\xe8\xf3\x18\x02\x12\x88\x01\n" + "\x14GetSubscriptionUsage\x121.api.v1.PaymentServiceGetSubscriptionUsageRequest\x1a2.api.v1.PaymentServiceGetSubscriptionUsageResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12m\n" + "\vGetInvoices\x12(.api.v1.PaymentServiceGetInvoicesRequest\x1a).api.v1.PaymentServiceGetInvoicesResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12{\n" + "\x10GetDefaultPrices\x12-.api.v1.PaymentServiceGetDefaultPricesRequest\x1a..api.v1.PaymentServiceGetDefaultPricesResponse\"\b\xd8\xf3\x18\x01\xe8\xf3\x18\x02\x12\x91\x01\n" + @@ -1948,82 +2043,84 @@ func file_api_v1_payment_proto_rawDescGZIP() []byte { return file_api_v1_payment_proto_rawDescData } -var file_api_v1_payment_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_v1_payment_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_api_v1_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_api_v1_payment_proto_goTypes = []any{ - (ProductType)(0), // 0: api.v1.ProductType - (UsageType)(0), // 1: api.v1.UsageType - (*PaymentCustomer)(nil), // 2: api.v1.PaymentCustomer - (*Card)(nil), // 3: api.v1.Card - (*Price)(nil), // 4: api.v1.Price - (*Address)(nil), // 5: api.v1.Address - (*SubscriptionUsageItem)(nil), // 6: api.v1.SubscriptionUsageItem - (*Invoice)(nil), // 7: api.v1.Invoice - (*Coupon)(nil), // 8: api.v1.Coupon - (*PaymentServiceCreateOrUpdateCustomerRequest)(nil), // 9: api.v1.PaymentServiceCreateOrUpdateCustomerRequest - (*PaymentServiceCreateOrUpdateCustomerResponse)(nil), // 10: api.v1.PaymentServiceCreateOrUpdateCustomerResponse - (*PaymentServiceGetCustomerRequest)(nil), // 11: api.v1.PaymentServiceGetCustomerRequest - (*PaymentServiceGetCustomerResponse)(nil), // 12: api.v1.PaymentServiceGetCustomerResponse - (*PaymentServiceCheckIfCustomerExistsRequest)(nil), // 13: api.v1.PaymentServiceCheckIfCustomerExistsRequest - (*PaymentServiceCheckIfCustomerExistsResponse)(nil), // 14: api.v1.PaymentServiceCheckIfCustomerExistsResponse - (*PaymentServiceHasPaymentMethodRequest)(nil), // 15: api.v1.PaymentServiceHasPaymentMethodRequest - (*PaymentServiceHasPaymentMethodResponse)(nil), // 16: api.v1.PaymentServiceHasPaymentMethodResponse - (*PaymentServiceDeletePaymentMethodRequest)(nil), // 17: api.v1.PaymentServiceDeletePaymentMethodRequest - (*PaymentServiceDeletePaymentMethodResponse)(nil), // 18: api.v1.PaymentServiceDeletePaymentMethodResponse - (*PaymentServiceGetSubscriptionUsageRequest)(nil), // 19: api.v1.PaymentServiceGetSubscriptionUsageRequest - (*PaymentServiceGetSubscriptionUsageResponse)(nil), // 20: api.v1.PaymentServiceGetSubscriptionUsageResponse - (*PaymentServiceGetInvoicesRequest)(nil), // 21: api.v1.PaymentServiceGetInvoicesRequest - (*PaymentServiceGetInvoicesResponse)(nil), // 22: api.v1.PaymentServiceGetInvoicesResponse - (*PaymentServiceGetDefaultPricesRequest)(nil), // 23: api.v1.PaymentServiceGetDefaultPricesRequest - (*PaymentServiceGetDefaultPricesResponse)(nil), // 24: api.v1.PaymentServiceGetDefaultPricesResponse - (*PaymentServiceHasChargeableResourcesRequest)(nil), // 25: api.v1.PaymentServiceHasChargeableResourcesRequest - (*PaymentServiceHasChargeableResourcesResponse)(nil), // 26: api.v1.PaymentServiceHasChargeableResourcesResponse - (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (ProductType)(0), // 0: api.v1.ProductType + (UsageType)(0), // 1: api.v1.UsageType + (ProductTier)(0), // 2: api.v1.ProductTier + (*PaymentCustomer)(nil), // 3: api.v1.PaymentCustomer + (*Card)(nil), // 4: api.v1.Card + (*Price)(nil), // 5: api.v1.Price + (*Address)(nil), // 6: api.v1.Address + (*SubscriptionUsageItem)(nil), // 7: api.v1.SubscriptionUsageItem + (*Invoice)(nil), // 8: api.v1.Invoice + (*Coupon)(nil), // 9: api.v1.Coupon + (*PaymentServiceCreateRequest)(nil), // 10: api.v1.PaymentServiceCreateRequest + (*PaymentServiceCreateResponse)(nil), // 11: api.v1.PaymentServiceCreateResponse + (*PaymentServiceUpdateRequest)(nil), // 12: api.v1.PaymentServiceUpdateRequest + (*PaymentServiceUpdateResponse)(nil), // 13: api.v1.PaymentServiceUpdateResponse + (*PaymentServiceGetRequest)(nil), // 14: api.v1.PaymentServiceGetRequest + (*PaymentServiceGetResponse)(nil), // 15: api.v1.PaymentServiceGetResponse + (*PaymentServiceHasPaymentMethodRequest)(nil), // 16: api.v1.PaymentServiceHasPaymentMethodRequest + (*PaymentServiceHasPaymentMethodResponse)(nil), // 17: api.v1.PaymentServiceHasPaymentMethodResponse + (*PaymentServiceDeleteRequest)(nil), // 18: api.v1.PaymentServiceDeleteRequest + (*PaymentServiceDeleteResponse)(nil), // 19: api.v1.PaymentServiceDeleteResponse + (*PaymentServiceGetSubscriptionUsageRequest)(nil), // 20: api.v1.PaymentServiceGetSubscriptionUsageRequest + (*PaymentServiceGetSubscriptionUsageResponse)(nil), // 21: api.v1.PaymentServiceGetSubscriptionUsageResponse + (*PaymentServiceGetInvoicesRequest)(nil), // 22: api.v1.PaymentServiceGetInvoicesRequest + (*PaymentServiceGetInvoicesResponse)(nil), // 23: api.v1.PaymentServiceGetInvoicesResponse + (*PaymentServiceGetDefaultPricesRequest)(nil), // 24: api.v1.PaymentServiceGetDefaultPricesRequest + (*PaymentServiceGetDefaultPricesResponse)(nil), // 25: api.v1.PaymentServiceGetDefaultPricesResponse + (*PaymentServiceHasChargeableResourcesRequest)(nil), // 26: api.v1.PaymentServiceHasChargeableResourcesRequest + (*PaymentServiceHasChargeableResourcesResponse)(nil), // 27: api.v1.PaymentServiceHasChargeableResourcesResponse + (*timestamppb.Timestamp)(nil), // 28: google.protobuf.Timestamp } var file_api_v1_payment_proto_depIdxs = []int32{ - 3, // 0: api.v1.PaymentCustomer.card:type_name -> api.v1.Card - 4, // 1: api.v1.PaymentCustomer.prices:type_name -> api.v1.Price - 5, // 2: api.v1.PaymentCustomer.address:type_name -> api.v1.Address - 8, // 3: api.v1.PaymentCustomer.coupon:type_name -> api.v1.Coupon - 0, // 4: api.v1.Price.product_type:type_name -> api.v1.ProductType - 1, // 5: api.v1.Price.usage_type:type_name -> api.v1.UsageType - 27, // 6: api.v1.SubscriptionUsageItem.period_start:type_name -> google.protobuf.Timestamp - 27, // 7: api.v1.SubscriptionUsageItem.period_end:type_name -> google.protobuf.Timestamp - 27, // 8: api.v1.Invoice.period_start:type_name -> google.protobuf.Timestamp - 27, // 9: api.v1.Invoice.period_end:type_name -> google.protobuf.Timestamp - 27, // 10: api.v1.Coupon.created_at:type_name -> google.protobuf.Timestamp - 27, // 11: api.v1.Coupon.redeem_by:type_name -> google.protobuf.Timestamp - 3, // 12: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.card:type_name -> api.v1.Card - 5, // 13: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.address:type_name -> api.v1.Address - 2, // 14: api.v1.PaymentServiceCreateOrUpdateCustomerResponse.customer:type_name -> api.v1.PaymentCustomer - 2, // 15: api.v1.PaymentServiceGetCustomerResponse.customer:type_name -> api.v1.PaymentCustomer - 2, // 16: api.v1.PaymentServiceCheckIfCustomerExistsResponse.customer:type_name -> api.v1.PaymentCustomer - 6, // 17: api.v1.PaymentServiceGetSubscriptionUsageResponse.subscription_usage_items:type_name -> api.v1.SubscriptionUsageItem - 7, // 18: api.v1.PaymentServiceGetInvoicesResponse.invoices:type_name -> api.v1.Invoice - 4, // 19: api.v1.PaymentServiceGetDefaultPricesResponse.prices:type_name -> api.v1.Price - 9, // 20: api.v1.PaymentService.CreateOrUpdateCustomer:input_type -> api.v1.PaymentServiceCreateOrUpdateCustomerRequest - 11, // 21: api.v1.PaymentService.GetCustomer:input_type -> api.v1.PaymentServiceGetCustomerRequest - 13, // 22: api.v1.PaymentService.CheckIfCustomerExists:input_type -> api.v1.PaymentServiceCheckIfCustomerExistsRequest - 15, // 23: api.v1.PaymentService.HasPaymentMethod:input_type -> api.v1.PaymentServiceHasPaymentMethodRequest - 17, // 24: api.v1.PaymentService.DeletePaymentMethod:input_type -> api.v1.PaymentServiceDeletePaymentMethodRequest - 19, // 25: api.v1.PaymentService.GetSubscriptionUsage:input_type -> api.v1.PaymentServiceGetSubscriptionUsageRequest - 21, // 26: api.v1.PaymentService.GetInvoices:input_type -> api.v1.PaymentServiceGetInvoicesRequest - 23, // 27: api.v1.PaymentService.GetDefaultPrices:input_type -> api.v1.PaymentServiceGetDefaultPricesRequest - 25, // 28: api.v1.PaymentService.HasChargeableResources:input_type -> api.v1.PaymentServiceHasChargeableResourcesRequest - 10, // 29: api.v1.PaymentService.CreateOrUpdateCustomer:output_type -> api.v1.PaymentServiceCreateOrUpdateCustomerResponse - 12, // 30: api.v1.PaymentService.GetCustomer:output_type -> api.v1.PaymentServiceGetCustomerResponse - 14, // 31: api.v1.PaymentService.CheckIfCustomerExists:output_type -> api.v1.PaymentServiceCheckIfCustomerExistsResponse - 16, // 32: api.v1.PaymentService.HasPaymentMethod:output_type -> api.v1.PaymentServiceHasPaymentMethodResponse - 18, // 33: api.v1.PaymentService.DeletePaymentMethod:output_type -> api.v1.PaymentServiceDeletePaymentMethodResponse - 20, // 34: api.v1.PaymentService.GetSubscriptionUsage:output_type -> api.v1.PaymentServiceGetSubscriptionUsageResponse - 22, // 35: api.v1.PaymentService.GetInvoices:output_type -> api.v1.PaymentServiceGetInvoicesResponse - 24, // 36: api.v1.PaymentService.GetDefaultPrices:output_type -> api.v1.PaymentServiceGetDefaultPricesResponse - 26, // 37: api.v1.PaymentService.HasChargeableResources:output_type -> api.v1.PaymentServiceHasChargeableResourcesResponse - 29, // [29:38] is the sub-list for method output_type - 20, // [20:29] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 4, // 0: api.v1.PaymentCustomer.card:type_name -> api.v1.Card + 5, // 1: api.v1.PaymentCustomer.prices:type_name -> api.v1.Price + 6, // 2: api.v1.PaymentCustomer.address:type_name -> api.v1.Address + 9, // 3: api.v1.PaymentCustomer.coupon:type_name -> api.v1.Coupon + 2, // 4: api.v1.PaymentCustomer.tier:type_name -> api.v1.ProductTier + 0, // 5: api.v1.Price.product_type:type_name -> api.v1.ProductType + 1, // 6: api.v1.Price.usage_type:type_name -> api.v1.UsageType + 28, // 7: api.v1.SubscriptionUsageItem.period_start:type_name -> google.protobuf.Timestamp + 28, // 8: api.v1.SubscriptionUsageItem.period_end:type_name -> google.protobuf.Timestamp + 28, // 9: api.v1.Invoice.period_start:type_name -> google.protobuf.Timestamp + 28, // 10: api.v1.Invoice.period_end:type_name -> google.protobuf.Timestamp + 28, // 11: api.v1.Coupon.created_at:type_name -> google.protobuf.Timestamp + 28, // 12: api.v1.Coupon.redeem_by:type_name -> google.protobuf.Timestamp + 6, // 13: api.v1.PaymentServiceCreateRequest.address:type_name -> api.v1.Address + 3, // 14: api.v1.PaymentServiceCreateResponse.customer:type_name -> api.v1.PaymentCustomer + 6, // 15: api.v1.PaymentServiceUpdateRequest.address:type_name -> api.v1.Address + 3, // 16: api.v1.PaymentServiceUpdateResponse.customer:type_name -> api.v1.PaymentCustomer + 3, // 17: api.v1.PaymentServiceGetResponse.customer:type_name -> api.v1.PaymentCustomer + 7, // 18: api.v1.PaymentServiceGetSubscriptionUsageResponse.subscription_usage_items:type_name -> api.v1.SubscriptionUsageItem + 8, // 19: api.v1.PaymentServiceGetInvoicesResponse.invoices:type_name -> api.v1.Invoice + 5, // 20: api.v1.PaymentServiceGetDefaultPricesResponse.prices:type_name -> api.v1.Price + 10, // 21: api.v1.PaymentService.Create:input_type -> api.v1.PaymentServiceCreateRequest + 12, // 22: api.v1.PaymentService.Update:input_type -> api.v1.PaymentServiceUpdateRequest + 18, // 23: api.v1.PaymentService.Delete:input_type -> api.v1.PaymentServiceDeleteRequest + 14, // 24: api.v1.PaymentService.Get:input_type -> api.v1.PaymentServiceGetRequest + 16, // 25: api.v1.PaymentService.HasPaymentMethod:input_type -> api.v1.PaymentServiceHasPaymentMethodRequest + 20, // 26: api.v1.PaymentService.GetSubscriptionUsage:input_type -> api.v1.PaymentServiceGetSubscriptionUsageRequest + 22, // 27: api.v1.PaymentService.GetInvoices:input_type -> api.v1.PaymentServiceGetInvoicesRequest + 24, // 28: api.v1.PaymentService.GetDefaultPrices:input_type -> api.v1.PaymentServiceGetDefaultPricesRequest + 26, // 29: api.v1.PaymentService.HasChargeableResources:input_type -> api.v1.PaymentServiceHasChargeableResourcesRequest + 11, // 30: api.v1.PaymentService.Create:output_type -> api.v1.PaymentServiceCreateResponse + 13, // 31: api.v1.PaymentService.Update:output_type -> api.v1.PaymentServiceUpdateResponse + 19, // 32: api.v1.PaymentService.Delete:output_type -> api.v1.PaymentServiceDeleteResponse + 15, // 33: api.v1.PaymentService.Get:output_type -> api.v1.PaymentServiceGetResponse + 17, // 34: api.v1.PaymentService.HasPaymentMethod:output_type -> api.v1.PaymentServiceHasPaymentMethodResponse + 21, // 35: api.v1.PaymentService.GetSubscriptionUsage:output_type -> api.v1.PaymentServiceGetSubscriptionUsageResponse + 23, // 36: api.v1.PaymentService.GetInvoices:output_type -> api.v1.PaymentServiceGetInvoicesResponse + 25, // 37: api.v1.PaymentService.GetDefaultPrices:output_type -> api.v1.PaymentServiceGetDefaultPricesResponse + 27, // 38: api.v1.PaymentService.HasChargeableResources:output_type -> api.v1.PaymentServiceHasChargeableResourcesResponse + 30, // [30:39] is the sub-list for method output_type + 21, // [21:30] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_api_v1_payment_proto_init() } @@ -2035,12 +2132,13 @@ func file_api_v1_payment_proto_init() { file_api_v1_payment_proto_msgTypes[0].OneofWrappers = []any{} file_api_v1_payment_proto_msgTypes[2].OneofWrappers = []any{} file_api_v1_payment_proto_msgTypes[7].OneofWrappers = []any{} + file_api_v1_payment_proto_msgTypes[9].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_payment_proto_rawDesc), len(file_api_v1_payment_proto_rawDesc)), - NumEnums: 2, + NumEnums: 3, NumMessages: 25, NumExtensions: 0, NumServices: 1, diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 9b1a5904..6b5b9a84 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -83,11 +83,11 @@ func GetServicePermissions() *ServicePermissions { "TENANT_ROLE_OWNER": []string{ "/api.v1.AuditService/Get", "/api.v1.AuditService/List", - "/api.v1.PaymentService/CreateOrUpdateCustomer", - "/api.v1.PaymentService/GetCustomer", - "/api.v1.PaymentService/CheckIfCustomerExists", + "/api.v1.PaymentService/Create", + "/api.v1.PaymentService/Update", + "/api.v1.PaymentService/Delete", + "/api.v1.PaymentService/Get", "/api.v1.PaymentService/HasPaymentMethod", - "/api.v1.PaymentService/DeletePaymentMethod", "/api.v1.PaymentService/GetSubscriptionUsage", "/api.v1.PaymentService/GetInvoices", "/api.v1.PaymentService/HasChargeableResources", @@ -212,15 +212,15 @@ func GetServicePermissions() *ServicePermissions { "/api.v1.IPService/Update": true, "/api.v1.MethodService/List": true, "/api.v1.MethodService/TokenScopedList": true, - "/api.v1.PaymentService/CheckIfCustomerExists": true, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": true, + "/api.v1.PaymentService/Create": true, + "/api.v1.PaymentService/Delete": true, + "/api.v1.PaymentService/Get": true, "/api.v1.PaymentService/GetDefaultPrices": true, "/api.v1.PaymentService/GetInvoices": true, "/api.v1.PaymentService/GetSubscriptionUsage": true, "/api.v1.PaymentService/HasChargeableResources": true, "/api.v1.PaymentService/HasPaymentMethod": true, + "/api.v1.PaymentService/Update": true, "/api.v1.ProjectService/Create": true, "/api.v1.ProjectService/Delete": true, "/api.v1.ProjectService/Get": true, @@ -311,14 +311,14 @@ func GetServicePermissions() *ServicePermissions { Tenant: map[string]bool{ "/api.v1.AuditService/Get": true, "/api.v1.AuditService/List": true, - "/api.v1.PaymentService/CheckIfCustomerExists": true, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": true, + "/api.v1.PaymentService/Create": true, + "/api.v1.PaymentService/Delete": true, + "/api.v1.PaymentService/Get": true, "/api.v1.PaymentService/GetInvoices": true, "/api.v1.PaymentService/GetSubscriptionUsage": true, "/api.v1.PaymentService/HasChargeableResources": true, "/api.v1.PaymentService/HasPaymentMethod": true, + "/api.v1.PaymentService/Update": true, "/api.v1.ProjectService/Create": true, "/api.v1.TenantService/Delete": true, "/api.v1.TenantService/Get": true, @@ -402,15 +402,15 @@ func GetServicePermissions() *ServicePermissions { "/api.v1.IPService/Update": true, "/api.v1.MethodService/List": true, "/api.v1.MethodService/TokenScopedList": true, - "/api.v1.PaymentService/CheckIfCustomerExists": false, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": false, + "/api.v1.PaymentService/Create": true, + "/api.v1.PaymentService/Delete": true, + "/api.v1.PaymentService/Get": false, "/api.v1.PaymentService/GetDefaultPrices": false, "/api.v1.PaymentService/GetInvoices": false, "/api.v1.PaymentService/GetSubscriptionUsage": false, "/api.v1.PaymentService/HasChargeableResources": false, "/api.v1.PaymentService/HasPaymentMethod": false, + "/api.v1.PaymentService/Update": true, "/api.v1.ProjectService/Create": true, "/api.v1.ProjectService/Delete": true, "/api.v1.ProjectService/Get": false, diff --git a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go index f962dc2f..1eb241fc 100644 --- a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go +++ b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go @@ -16,28 +16,28 @@ type PaymentServiceClient struct { mock.Mock } -// CheckIfCustomerExists provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceClient) CheckIfCustomerExists(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse], error) { +// Create provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceClient) Create(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("no return value specified for CheckIfCustomerExists") + panic("no return value specified for Create") } - var r0 *connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse] + var r0 *connect.Response[apiv1.PaymentServiceCreateResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) *connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) *connect.Response[apiv1.PaymentServiceCreateResponse]); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateResponse]) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -46,28 +46,28 @@ func (_m *PaymentServiceClient) CheckIfCustomerExists(_a0 context.Context, _a1 * return r0, r1 } -// CreateOrUpdateCustomer provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceClient) CreateOrUpdateCustomer(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error) { +// Delete provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceClient) Delete(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("no return value specified for CreateOrUpdateCustomer") + panic("no return value specified for Delete") } - var r0 *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse] + var r0 *connect.Response[apiv1.PaymentServiceDeleteResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) *connect.Response[apiv1.PaymentServiceDeleteResponse]); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeleteResponse]) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -76,58 +76,28 @@ func (_m *PaymentServiceClient) CreateOrUpdateCustomer(_a0 context.Context, _a1 return r0, r1 } -// DeletePaymentMethod provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceClient) DeletePaymentMethod(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error) { +// Get provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceClient) Get(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("no return value specified for DeletePaymentMethod") + panic("no return value specified for Get") } - var r0 *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse] + var r0 *connect.Response[apiv1.PaymentServiceGetResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) *connect.Response[apiv1.PaymentServiceGetResponse]); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetResponse]) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetCustomer provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceClient) GetCustomer(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetCustomer") - } - - var r0 *connect.Response[apiv1.PaymentServiceGetCustomerResponse] - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) *connect.Response[apiv1.PaymentServiceGetCustomerResponse]); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetCustomerResponse]) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -286,6 +256,36 @@ func (_m *PaymentServiceClient) HasPaymentMethod(_a0 context.Context, _a1 *conne return r0, r1 } +// Update provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceClient) Update(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *connect.Response[apiv1.PaymentServiceUpdateResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) *connect.Response[apiv1.PaymentServiceUpdateResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceUpdateResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewPaymentServiceClient creates a new instance of PaymentServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPaymentServiceClient(t interface { diff --git a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go index e17bd586..1704c5bc 100644 --- a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go +++ b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go @@ -16,28 +16,28 @@ type PaymentServiceHandler struct { mock.Mock } -// CheckIfCustomerExists provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceHandler) CheckIfCustomerExists(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse], error) { +// Create provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceHandler) Create(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("no return value specified for CheckIfCustomerExists") + panic("no return value specified for Create") } - var r0 *connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse] + var r0 *connect.Response[apiv1.PaymentServiceCreateResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) (*connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) *connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) *connect.Response[apiv1.PaymentServiceCreateResponse]); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCheckIfCustomerExistsResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateResponse]) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCheckIfCustomerExistsRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -46,28 +46,28 @@ func (_m *PaymentServiceHandler) CheckIfCustomerExists(_a0 context.Context, _a1 return r0, r1 } -// CreateOrUpdateCustomer provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceHandler) CreateOrUpdateCustomer(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error) { +// Delete provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceHandler) Delete(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("no return value specified for CreateOrUpdateCustomer") + panic("no return value specified for Delete") } - var r0 *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse] + var r0 *connect.Response[apiv1.PaymentServiceDeleteResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) *connect.Response[apiv1.PaymentServiceDeleteResponse]); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeleteResponse]) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -76,58 +76,28 @@ func (_m *PaymentServiceHandler) CreateOrUpdateCustomer(_a0 context.Context, _a1 return r0, r1 } -// DeletePaymentMethod provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceHandler) DeletePaymentMethod(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error) { +// Get provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceHandler) Get(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("no return value specified for DeletePaymentMethod") + panic("no return value specified for Get") } - var r0 *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse] + var r0 *connect.Response[apiv1.PaymentServiceGetResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) *connect.Response[apiv1.PaymentServiceGetResponse]); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetResponse]) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetCustomer provides a mock function with given fields: _a0, _a1 -func (_m *PaymentServiceHandler) GetCustomer(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetCustomer") - } - - var r0 *connect.Response[apiv1.PaymentServiceGetCustomerResponse] - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) *connect.Response[apiv1.PaymentServiceGetCustomerResponse]); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetCustomerResponse]) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -286,6 +256,36 @@ func (_m *PaymentServiceHandler) HasPaymentMethod(_a0 context.Context, _a1 *conn return r0, r1 } +// Update provides a mock function with given fields: _a0, _a1 +func (_m *PaymentServiceHandler) Update(_a0 context.Context, _a1 *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *connect.Response[apiv1.PaymentServiceUpdateResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) *connect.Response[apiv1.PaymentServiceUpdateResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceUpdateResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewPaymentServiceHandler creates a new instance of PaymentServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPaymentServiceHandler(t interface { diff --git a/js/api/v1/payment_pb.d.ts b/js/api/v1/payment_pb.d.ts index bd865826..f793f1b9 100644 --- a/js/api/v1/payment_pb.d.ts +++ b/js/api/v1/payment_pb.d.ts @@ -89,6 +89,12 @@ export type PaymentCustomer = Message<"api.v1.PaymentCustomer"> & { * @generated from field: optional int64 balance = 13; */ balance?: bigint; + /** + * Tier describes the state in which the customer is using the products. + * + * @generated from field: api.v1.ProductTier tier = 14; + */ + tier: ProductTier; }; /** * Describes the message api.v1.PaymentCustomer. @@ -390,13 +396,13 @@ export type Coupon = Message<"api.v1.Coupon"> & { */ export declare const CouponSchema: GenMessage; /** - * PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request + * PaymentServiceCreateRequest is the request payload for providing payment data * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerRequest + * @generated from message api.v1.PaymentServiceCreateRequest */ -export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerRequest"> & { +export type PaymentServiceCreateRequest = Message<"api.v1.PaymentServiceCreateRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -404,153 +410,171 @@ export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.Paymen /** * Name of the customer to be billed * - * @generated from field: optional string name = 4; + * @generated from field: string name = 2; */ - name?: string; + name: string; /** * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api * - * @generated from field: optional string payment_method_id = 5; + * @generated from field: string payment_method_id = 3; */ - paymentMethodId?: string; + paymentMethodId: string; /** * Email of the customer to be billed * - * @generated from field: optional string email = 6; + * @generated from field: string email = 4; */ - email?: string; - /** - * Card the customer to be billed - * - * @generated from field: optional api.v1.Card card = 7; - */ - card?: Card; + email: string; /** * Address is the postal address of the customer to be billed * - * @generated from field: api.v1.Address address = 8; + * @generated from field: api.v1.Address address = 5; */ address?: Address; /** * Vat which applies to the customer to be billed * - * @generated from field: optional string vat = 9; + * @generated from field: string vat = 6; */ - vat?: string; + vat: string; /** * PhoneNumber of the customer to be billed * - * @generated from field: optional string phone_number = 10; + * @generated from field: optional string phone_number = 7; */ phoneNumber?: string; }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerRequest. - * Use `create(PaymentServiceCreateOrUpdateCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateRequest. + * Use `create(PaymentServiceCreateRequestSchema)` to create a new message. */ -export declare const PaymentServiceCreateOrUpdateCustomerRequestSchema: GenMessage; +export declare const PaymentServiceCreateRequestSchema: GenMessage; /** - * PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request + * PaymentServiceCreateResponse is the response payload for a payment create request * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerResponse + * @generated from message api.v1.PaymentServiceCreateResponse */ -export type PaymentServiceCreateOrUpdateCustomerResponse = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerResponse"> & { +export type PaymentServiceCreateResponse = Message<"api.v1.PaymentServiceCreateResponse"> & { /** - * Customer is the customer + * Customer is the created customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ customer?: PaymentCustomer; }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerResponse. - * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateResponse. + * Use `create(PaymentServiceCreateResponseSchema)` to create a new message. */ -export declare const PaymentServiceCreateOrUpdateCustomerResponseSchema: GenMessage; +export declare const PaymentServiceCreateResponseSchema: GenMessage; /** - * PaymentServiceGetCustomerRequest is the request payload for a payment get customer request + * PaymentServiceUpdateRequest is the request payload for updating payment data * - * @generated from message api.v1.PaymentServiceGetCustomerRequest + * @generated from message api.v1.PaymentServiceUpdateRequest */ -export type PaymentServiceGetCustomerRequest = Message<"api.v1.PaymentServiceGetCustomerRequest"> & { +export type PaymentServiceUpdateRequest = Message<"api.v1.PaymentServiceUpdateRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ login: string; /** - * CustomerId of the customer + * Name of the customer to be billed * - * @generated from field: string customer_id = 2; + * @generated from field: optional string name = 2; */ - customerId: string; + name?: string; + /** + * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + * + * @generated from field: optional string payment_method_id = 3; + */ + paymentMethodId?: string; + /** + * Email of the customer to be billed + * + * @generated from field: optional string email = 4; + */ + email?: string; + /** + * Address is the postal address of the customer to be billed + * + * @generated from field: api.v1.Address address = 5; + */ + address?: Address; + /** + * Vat which applies to the customer to be billed + * + * @generated from field: optional string vat = 6; + */ + vat?: string; + /** + * PhoneNumber of the customer to be billed + * + * @generated from field: optional string phone_number = 7; + */ + phoneNumber?: string; }; /** - * Describes the message api.v1.PaymentServiceGetCustomerRequest. - * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateRequest. + * Use `create(PaymentServiceUpdateRequestSchema)` to create a new message. */ -export declare const PaymentServiceGetCustomerRequestSchema: GenMessage; +export declare const PaymentServiceUpdateRequestSchema: GenMessage; /** - * PaymentServiceGetCustomerResponse is the response payload for a payment get customer request + * PaymentServiceUpdateResponse is the response payload for a payment update request * - * @generated from message api.v1.PaymentServiceGetCustomerResponse + * @generated from message api.v1.PaymentServiceUpdateResponse */ -export type PaymentServiceGetCustomerResponse = Message<"api.v1.PaymentServiceGetCustomerResponse"> & { +export type PaymentServiceUpdateResponse = Message<"api.v1.PaymentServiceUpdateResponse"> & { /** - * Customer is the customer + * Customer is the updated customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ customer?: PaymentCustomer; }; /** - * Describes the message api.v1.PaymentServiceGetCustomerResponse. - * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateResponse. + * Use `create(PaymentServiceUpdateResponseSchema)` to create a new message. */ -export declare const PaymentServiceGetCustomerResponseSchema: GenMessage; +export declare const PaymentServiceUpdateResponseSchema: GenMessage; /** - * PaymentServiceCheckIfCustomerExistsRequest is the request payload for a payment check if customer exists request + * PaymentServiceGetRequest is the request payload for getting the payment data * - * @generated from message api.v1.PaymentServiceCheckIfCustomerExistsRequest + * @generated from message api.v1.PaymentServiceGetRequest */ -export type PaymentServiceCheckIfCustomerExistsRequest = Message<"api.v1.PaymentServiceCheckIfCustomerExistsRequest"> & { +export type PaymentServiceGetRequest = Message<"api.v1.PaymentServiceGetRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ login: string; }; /** - * Describes the message api.v1.PaymentServiceCheckIfCustomerExistsRequest. - * Use `create(PaymentServiceCheckIfCustomerExistsRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetRequest. + * Use `create(PaymentServiceGetRequestSchema)` to create a new message. */ -export declare const PaymentServiceCheckIfCustomerExistsRequestSchema: GenMessage; +export declare const PaymentServiceGetRequestSchema: GenMessage; /** - * PaymentServiceCheckIfCustomerExistsResponse is the response payload for a payment check if customer exists request + * PaymentServiceGetResponse is the response payload for a payment get request * - * @generated from message api.v1.PaymentServiceCheckIfCustomerExistsResponse + * @generated from message api.v1.PaymentServiceGetResponse */ -export type PaymentServiceCheckIfCustomerExistsResponse = Message<"api.v1.PaymentServiceCheckIfCustomerExistsResponse"> & { +export type PaymentServiceGetResponse = Message<"api.v1.PaymentServiceGetResponse"> & { /** - * Customer is the customer + * Customer is the payment customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ customer?: PaymentCustomer; - /** - * Exists indicates if this customer exists - * - * @generated from field: bool exists = 2; - */ - exists: boolean; }; /** - * Describes the message api.v1.PaymentServiceCheckIfCustomerExistsResponse. - * Use `create(PaymentServiceCheckIfCustomerExistsResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetResponse. + * Use `create(PaymentServiceGetResponseSchema)` to create a new message. */ -export declare const PaymentServiceCheckIfCustomerExistsResponseSchema: GenMessage; +export declare const PaymentServiceGetResponseSchema: GenMessage; /** * PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request * @@ -558,7 +582,7 @@ export declare const PaymentServiceCheckIfCustomerExistsResponseSchema: GenMessa */ export type PaymentServiceHasPaymentMethodRequest = Message<"api.v1.PaymentServiceHasPaymentMethodRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -600,34 +624,34 @@ export type PaymentServiceHasPaymentMethodResponse = Message<"api.v1.PaymentServ */ export declare const PaymentServiceHasPaymentMethodResponseSchema: GenMessage; /** - * PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request + * PaymentServiceDeleteRequest is the request payload for a delete payment request * - * @generated from message api.v1.PaymentServiceDeletePaymentMethodRequest + * @generated from message api.v1.PaymentServiceDeleteRequest */ -export type PaymentServiceDeletePaymentMethodRequest = Message<"api.v1.PaymentServiceDeletePaymentMethodRequest"> & { +export type PaymentServiceDeleteRequest = Message<"api.v1.PaymentServiceDeleteRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ login: string; }; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodRequest. - * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteRequest. + * Use `create(PaymentServiceDeleteRequestSchema)` to create a new message. */ -export declare const PaymentServiceDeletePaymentMethodRequestSchema: GenMessage; +export declare const PaymentServiceDeleteRequestSchema: GenMessage; /** - * PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request + * PaymentServiceDeleteResponse is the response payload for a delete payment request * - * @generated from message api.v1.PaymentServiceDeletePaymentMethodResponse + * @generated from message api.v1.PaymentServiceDeleteResponse */ -export type PaymentServiceDeletePaymentMethodResponse = Message<"api.v1.PaymentServiceDeletePaymentMethodResponse"> & {}; +export type PaymentServiceDeleteResponse = Message<"api.v1.PaymentServiceDeleteResponse"> & {}; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodResponse. - * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteResponse. + * Use `create(PaymentServiceDeleteResponseSchema)` to create a new message. */ -export declare const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage; +export declare const PaymentServiceDeleteResponseSchema: GenMessage; /** * PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request * @@ -635,7 +659,7 @@ export declare const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage */ export type PaymentServiceGetSubscriptionUsageRequest = Message<"api.v1.PaymentServiceGetSubscriptionUsageRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -671,7 +695,7 @@ export declare const PaymentServiceGetSubscriptionUsageResponseSchema: GenMessag */ export type PaymentServiceGetInvoicesRequest = Message<"api.v1.PaymentServiceGetInvoicesRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -742,7 +766,7 @@ export declare const PaymentServiceGetDefaultPricesResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -841,6 +865,35 @@ export declare enum UsageType { * Describes the enum api.v1.UsageType. */ export declare const UsageTypeSchema: GenEnum; +/** + * ProductTier is an explicit indicator for the state in which the customer is using the products. + * + * @generated from enum api.v1.ProductTier + */ +export declare enum ProductTier { + /** + * PRODUCT_TIER_UNSPECIFIED is unspecified + * + * @generated from enum value: PRODUCT_TIER_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + * + * @generated from enum value: PRODUCT_TIER_TRIAL = 1; + */ + TRIAL = 1, + /** + * PRODUCT_TIER_PAID indicates a customer that has provided payment information. + * + * @generated from enum value: PRODUCT_TIER_PAID = 2; + */ + PAID = 2 +} +/** + * Describes the enum api.v1.ProductTier. + */ +export declare const ProductTierSchema: GenEnum; /** * PaymentService serves payment related functions * @@ -848,54 +901,54 @@ export declare const UsageTypeSchema: GenEnum; */ export declare const PaymentService: GenService<{ /** - * CreateOrUpdateCustomer the payment data on the payment processor + * Create the payment data used for billing api resources * - * @generated from rpc api.v1.PaymentService.CreateOrUpdateCustomer + * @generated from rpc api.v1.PaymentService.Create */ - createOrUpdateCustomer: { + create: { methodKind: "unary"; - input: typeof PaymentServiceCreateOrUpdateCustomerRequestSchema; - output: typeof PaymentServiceCreateOrUpdateCustomerResponseSchema; + input: typeof PaymentServiceCreateRequestSchema; + output: typeof PaymentServiceCreateResponseSchema; }; /** - * GetCustomer from the payment processor + * Update the payment data * - * @generated from rpc api.v1.PaymentService.GetCustomer + * @generated from rpc api.v1.PaymentService.Update */ - getCustomer: { + update: { methodKind: "unary"; - input: typeof PaymentServiceGetCustomerRequestSchema; - output: typeof PaymentServiceGetCustomerResponseSchema; + input: typeof PaymentServiceUpdateRequestSchema; + output: typeof PaymentServiceUpdateResponseSchema; }; /** - * CheckIfCustomerExists at the payment processor + * Delete the payment data * - * @generated from rpc api.v1.PaymentService.CheckIfCustomerExists + * @generated from rpc api.v1.PaymentService.Delete */ - checkIfCustomerExists: { + delete: { methodKind: "unary"; - input: typeof PaymentServiceCheckIfCustomerExistsRequestSchema; - output: typeof PaymentServiceCheckIfCustomerExistsResponseSchema; + input: typeof PaymentServiceDeleteRequestSchema; + output: typeof PaymentServiceDeleteResponseSchema; }; /** - * HasPaymentMethod check if the customer has a payment method provided + * Get the payment data * - * @generated from rpc api.v1.PaymentService.HasPaymentMethod + * @generated from rpc api.v1.PaymentService.Get */ - hasPaymentMethod: { + get: { methodKind: "unary"; - input: typeof PaymentServiceHasPaymentMethodRequestSchema; - output: typeof PaymentServiceHasPaymentMethodResponseSchema; + input: typeof PaymentServiceGetRequestSchema; + output: typeof PaymentServiceGetResponseSchema; }; /** - * DeletePaymentMethod of the customer + * HasPaymentMethod check if the customer has a payment method provided * - * @generated from rpc api.v1.PaymentService.DeletePaymentMethod + * @generated from rpc api.v1.PaymentService.HasPaymentMethod */ - deletePaymentMethod: { + hasPaymentMethod: { methodKind: "unary"; - input: typeof PaymentServiceDeletePaymentMethodRequestSchema; - output: typeof PaymentServiceDeletePaymentMethodResponseSchema; + input: typeof PaymentServiceHasPaymentMethodRequestSchema; + output: typeof PaymentServiceHasPaymentMethodResponseSchema; }; /** * GetSubscriptionUsage of the customer diff --git a/js/api/v1/payment_pb.js b/js/api/v1/payment_pb.js index cff4de79..6059a88d 100644 --- a/js/api/v1/payment_pb.js +++ b/js/api/v1/payment_pb.js @@ -8,7 +8,7 @@ import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; /** * Describes the file api/v1/payment.proto. */ -export const file_api_v1_payment = /*@__PURE__*/ fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIt8DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEiMKBmNvdXBvbhgKIAEoCzIOLmFwaS52MS5Db3Vwb25IBYgBARIQCgN2YXQYCyABKAlIBogBARIZCgxwaG9uZV9udW1iZXIYDCABKAlIB4gBARIUCgdiYWxhbmNlGA0gASgDSAiIAQFCBwoFX25hbWVCDgoMX2N1c3RvbWVyX2lkQhQKEl9wYXltZW50X21ldGhvZF9pZEIICgZfZW1haWxCBwoFX2NhcmRCCQoHX2NvdXBvbkI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XNwb25zZSII2PMYAejzGAISkQEKFkhhc0NoYXJnZWFibGVSZXNvdXJjZXMSMy5hcGkudjEuUGF5bWVudFNlcnZpY2VIYXNDaGFyZ2VhYmxlUmVzb3VyY2VzUmVxdWVzdBo0LmFwaS52MS5QYXltZW50U2VydmljZUhhc0NoYXJnZWFibGVSZXNvdXJjZXNSZXNwb25zZSIMwvMYBAECAwTo8xgCQoUBCgpjb20uYXBpLnYxQgxQYXltZW50UHJvdG9QAVowZ2l0aHViLmNvbS9tZXRhbC1zdGFjay1jbG91ZC9hcGkvZ28vYXBpL3YxO2FwaXYxogIDQVhYqgIGQXBpLlYxygIGQXBpXFYx4gISQXBpXFYxXEdQQk1ldGFkYXRh6gIHQXBpOjpWMWIGcHJvdG8z", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); +export const file_api_v1_payment = /*@__PURE__*/ fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIoIECg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEiMKBmNvdXBvbhgKIAEoCzIOLmFwaS52MS5Db3Vwb25IBYgBARIQCgN2YXQYCyABKAlIBogBARIZCgxwaG9uZV9udW1iZXIYDCABKAlIB4gBARIUCgdiYWxhbmNlGA0gASgDSAiIAQESIQoEdGllchgOIAEoDjITLmFwaS52MS5Qcm9kdWN0VGllckIHCgVfbmFtZUIOCgxfY3VzdG9tZXJfaWRC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5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXNwb25zZSII2PMYAejzGAISkQEKFkhhc0NoYXJnZWFibGVSZXNvdXJjZXMSMy5hcGkudjEuUGF5bWVudFNlcnZpY2VIYXNDaGFyZ2VhYmxlUmVzb3VyY2VzUmVxdWVzdBo0LmFwaS52MS5QYXltZW50U2VydmljZUhhc0NoYXJnZWFibGVSZXNvdXJjZXNSZXNwb25zZSIMwvMYBAECAwTo8xgCQoUBCgpjb20uYXBpLnYxQgxQYXltZW50UHJvdG9QAVowZ2l0aHViLmNvbS9tZXRhbC1zdGFjay1jbG91ZC9hcGkvZ28vYXBpL3YxO2FwaXYxogIDQVhYqgIGQXBpLlYxygIGQXBpXFYx4gISQXBpXFYxXEdQQk1ldGFkYXRh6gIHQXBpOjpWMWIGcHJvdG8z", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); /** * Describes the message api.v1.PaymentCustomer. * Use `create(PaymentCustomerSchema)` to create a new message. @@ -45,35 +45,35 @@ export const InvoiceSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 5); */ export const CouponSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 6); /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerRequest. - * Use `create(PaymentServiceCreateOrUpdateCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateRequest. + * Use `create(PaymentServiceCreateRequestSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); +export const PaymentServiceCreateRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerResponse. - * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateResponse. + * Use `create(PaymentServiceCreateResponseSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); +export const PaymentServiceCreateResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); /** - * Describes the message api.v1.PaymentServiceGetCustomerRequest. - * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateRequest. + * Use `create(PaymentServiceUpdateRequestSchema)` to create a new message. */ -export const PaymentServiceGetCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); +export const PaymentServiceUpdateRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); /** - * Describes the message api.v1.PaymentServiceGetCustomerResponse. - * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateResponse. + * Use `create(PaymentServiceUpdateResponseSchema)` to create a new message. */ -export const PaymentServiceGetCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); +export const PaymentServiceUpdateResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); /** - * Describes the message api.v1.PaymentServiceCheckIfCustomerExistsRequest. - * Use `create(PaymentServiceCheckIfCustomerExistsRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetRequest. + * Use `create(PaymentServiceGetRequestSchema)` to create a new message. */ -export const PaymentServiceCheckIfCustomerExistsRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 11); +export const PaymentServiceGetRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 11); /** - * Describes the message api.v1.PaymentServiceCheckIfCustomerExistsResponse. - * Use `create(PaymentServiceCheckIfCustomerExistsResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetResponse. + * Use `create(PaymentServiceGetResponseSchema)` to create a new message. */ -export const PaymentServiceCheckIfCustomerExistsResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 12); +export const PaymentServiceGetResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 12); /** * Describes the message api.v1.PaymentServiceHasPaymentMethodRequest. * Use `create(PaymentServiceHasPaymentMethodRequestSchema)` to create a new message. @@ -85,15 +85,15 @@ export const PaymentServiceHasPaymentMethodRequestSchema = /*@__PURE__*/ message */ export const PaymentServiceHasPaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 14); /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodRequest. - * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteRequest. + * Use `create(PaymentServiceDeleteRequestSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 15); +export const PaymentServiceDeleteRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 15); /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodResponse. - * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteResponse. + * Use `create(PaymentServiceDeleteResponseSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 16); +export const PaymentServiceDeleteResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 16); /** * Describes the message api.v1.PaymentServiceGetSubscriptionUsageRequest. * Use `create(PaymentServiceGetSubscriptionUsageRequestSchema)` to create a new message. @@ -206,6 +206,36 @@ export var UsageType; * Describes the enum api.v1.UsageType. */ export const UsageTypeSchema = /*@__PURE__*/ enumDesc(file_api_v1_payment, 1); +/** + * ProductTier is an explicit indicator for the state in which the customer is using the products. + * + * @generated from enum api.v1.ProductTier + */ +export var ProductTier; +(function (ProductTier) { + /** + * PRODUCT_TIER_UNSPECIFIED is unspecified + * + * @generated from enum value: PRODUCT_TIER_UNSPECIFIED = 0; + */ + ProductTier[ProductTier["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + /** + * PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + * + * @generated from enum value: PRODUCT_TIER_TRIAL = 1; + */ + ProductTier[ProductTier["TRIAL"] = 1] = "TRIAL"; + /** + * PRODUCT_TIER_PAID indicates a customer that has provided payment information. + * + * @generated from enum value: PRODUCT_TIER_PAID = 2; + */ + ProductTier[ProductTier["PAID"] = 2] = "PAID"; +})(ProductTier || (ProductTier = {})); +/** + * Describes the enum api.v1.ProductTier. + */ +export const ProductTierSchema = /*@__PURE__*/ enumDesc(file_api_v1_payment, 2); /** * PaymentService serves payment related functions * diff --git a/js/api/v1/payment_pb.ts b/js/api/v1/payment_pb.ts index 671d90a2..7d99dc12 100644 --- a/js/api/v1/payment_pb.ts +++ b/js/api/v1/payment_pb.ts @@ -14,7 +14,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file api/v1/payment.proto. */ export const file_api_v1_payment: GenFile = /*@__PURE__*/ - fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIt8DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEiMKBmNvdXBvbhgKIAEoCzIOLmFwaS52MS5Db3Vwb25IBYgBARIQCgN2YXQYCyABKAlIBogBARIZCgxwaG9uZV9udW1iZXIYDCABKAlIB4gBARIUCgdiYWxhbmNlGA0gASgDSAiIAQFCBwoFX25hbWVCDgoMX2N1c3RvbWVyX2lkQhQKEl9wYXltZW50X21ldGhvZF9p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aS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXNwb25zZSII2PMYAejzGAISkQEKFkhhc0NoYXJnZWFibGVSZXNvdXJjZXMSMy5hcGkudjEuUGF5bWVudFNlcnZpY2VIYXNDaGFyZ2VhYmxlUmVzb3VyY2VzUmVxdWVzdBo0LmFwaS52MS5QYXltZW50U2VydmljZUhhc0NoYXJnZWFibGVSZXNvdXJjZXNSZXNwb25zZSIMwvMYBAECAwTo8xgCQoUBCgpjb20uYXBpLnYxQgxQYXltZW50UHJvdG9QAVowZ2l0aHViLmNvbS9tZXRhbC1zdGFjay1jbG91ZC9hcGkvZ28vYXBpL3YxO2FwaXYxogIDQVhYqgIGQXBpLlYxygIGQXBpXFYx4gISQXBpXFYxXEdQQk1ldGFkYXRh6gIHQXBpOjpWMWIGcHJvdG8z", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); + fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIoIECg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEiMKBmNvdXBvbhgKIAEoCzIOLmFwaS52MS5Db3Vwb25IBYgBARIQCgN2YXQYCyABKAlIBogBARIZCgxwaG9uZV9udW1iZXIYDCABKAlIB4gBARIUCgdiYWxhbmNlGA0gASgDSAiIAQESIQoEdGllchgOIAEoDjITLmFwaS52MS5Qcm9kdWN0VGllckIHCgVfbmFtZUIOCg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VxdWVzdBouLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXNwb25zZSII2PMYAejzGAISkQEKFkhhc0NoYXJnZWFibGVSZXNvdXJjZXMSMy5hcGkudjEuUGF5bWVudFNlcnZpY2VIYXNDaGFyZ2VhYmxlUmVzb3VyY2VzUmVxdWVzdBo0LmFwaS52MS5QYXltZW50U2VydmljZUhhc0NoYXJnZWFibGVSZXNvdXJjZXNSZXNwb25zZSIMwvMYBAECAwTo8xgCQoUBCgpjb20uYXBpLnYxQgxQYXltZW50UHJvdG9QAVowZ2l0aHViLmNvbS9tZXRhbC1zdGFjay1jbG91ZC9hcGkvZ28vYXBpL3YxO2FwaXYxogIDQVhYqgIGQXBpLlYxygIGQXBpXFYx4gISQXBpXFYxXEdQQk1ldGFkYXRh6gIHQXBpOjpWMWIGcHJvdG8z", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); /** * PaymentCustomer is a customer at the payment processor @@ -112,6 +112,13 @@ export type PaymentCustomer = Message<"api.v1.PaymentCustomer"> & { * @generated from field: optional int64 balance = 13; */ balance?: bigint; + + /** + * Tier describes the state in which the customer is using the products. + * + * @generated from field: api.v1.ProductTier tier = 14; + */ + tier: ProductTier; }; /** @@ -465,13 +472,13 @@ export const CouponSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 6); /** - * PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request + * PaymentServiceCreateRequest is the request payload for providing payment data * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerRequest + * @generated from message api.v1.PaymentServiceCreateRequest */ -export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerRequest"> & { +export type PaymentServiceCreateRequest = Message<"api.v1.PaymentServiceCreateRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -480,68 +487,61 @@ export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.Paymen /** * Name of the customer to be billed * - * @generated from field: optional string name = 4; + * @generated from field: string name = 2; */ - name?: string; + name: string; /** * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api * - * @generated from field: optional string payment_method_id = 5; + * @generated from field: string payment_method_id = 3; */ - paymentMethodId?: string; + paymentMethodId: string; /** * Email of the customer to be billed * - * @generated from field: optional string email = 6; - */ - email?: string; - - /** - * Card the customer to be billed - * - * @generated from field: optional api.v1.Card card = 7; + * @generated from field: string email = 4; */ - card?: Card; + email: string; /** * Address is the postal address of the customer to be billed * - * @generated from field: api.v1.Address address = 8; + * @generated from field: api.v1.Address address = 5; */ address?: Address; /** * Vat which applies to the customer to be billed * - * @generated from field: optional string vat = 9; + * @generated from field: string vat = 6; */ - vat?: string; + vat: string; /** * PhoneNumber of the customer to be billed * - * @generated from field: optional string phone_number = 10; + * @generated from field: optional string phone_number = 7; */ phoneNumber?: string; }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerRequest. - * Use `create(PaymentServiceCreateOrUpdateCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateRequest. + * Use `create(PaymentServiceCreateRequestSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerRequestSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceCreateRequestSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); /** - * PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request + * PaymentServiceCreateResponse is the response payload for a payment create request * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerResponse + * @generated from message api.v1.PaymentServiceCreateResponse */ -export type PaymentServiceCreateOrUpdateCustomerResponse = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerResponse"> & { +export type PaymentServiceCreateResponse = Message<"api.v1.PaymentServiceCreateResponse"> & { /** - * Customer is the customer + * Customer is the created customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ @@ -549,48 +549,83 @@ export type PaymentServiceCreateOrUpdateCustomerResponse = Message<"api.v1.Payme }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerResponse. - * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateResponse. + * Use `create(PaymentServiceCreateResponseSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerResponseSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceCreateResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); /** - * PaymentServiceGetCustomerRequest is the request payload for a payment get customer request + * PaymentServiceUpdateRequest is the request payload for updating payment data * - * @generated from message api.v1.PaymentServiceGetCustomerRequest + * @generated from message api.v1.PaymentServiceUpdateRequest */ -export type PaymentServiceGetCustomerRequest = Message<"api.v1.PaymentServiceGetCustomerRequest"> & { +export type PaymentServiceUpdateRequest = Message<"api.v1.PaymentServiceUpdateRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ login: string; /** - * CustomerId of the customer + * Name of the customer to be billed * - * @generated from field: string customer_id = 2; + * @generated from field: optional string name = 2; */ - customerId: string; + name?: string; + + /** + * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + * + * @generated from field: optional string payment_method_id = 3; + */ + paymentMethodId?: string; + + /** + * Email of the customer to be billed + * + * @generated from field: optional string email = 4; + */ + email?: string; + + /** + * Address is the postal address of the customer to be billed + * + * @generated from field: api.v1.Address address = 5; + */ + address?: Address; + + /** + * Vat which applies to the customer to be billed + * + * @generated from field: optional string vat = 6; + */ + vat?: string; + + /** + * PhoneNumber of the customer to be billed + * + * @generated from field: optional string phone_number = 7; + */ + phoneNumber?: string; }; /** - * Describes the message api.v1.PaymentServiceGetCustomerRequest. - * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateRequest. + * Use `create(PaymentServiceUpdateRequestSchema)` to create a new message. */ -export const PaymentServiceGetCustomerRequestSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceUpdateRequestSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); /** - * PaymentServiceGetCustomerResponse is the response payload for a payment get customer request + * PaymentServiceUpdateResponse is the response payload for a payment update request * - * @generated from message api.v1.PaymentServiceGetCustomerResponse + * @generated from message api.v1.PaymentServiceUpdateResponse */ -export type PaymentServiceGetCustomerResponse = Message<"api.v1.PaymentServiceGetCustomerResponse"> & { +export type PaymentServiceUpdateResponse = Message<"api.v1.PaymentServiceUpdateResponse"> & { /** - * Customer is the customer + * Customer is the updated customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ @@ -598,20 +633,20 @@ export type PaymentServiceGetCustomerResponse = Message<"api.v1.PaymentServiceGe }; /** - * Describes the message api.v1.PaymentServiceGetCustomerResponse. - * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateResponse. + * Use `create(PaymentServiceUpdateResponseSchema)` to create a new message. */ -export const PaymentServiceGetCustomerResponseSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceUpdateResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); /** - * PaymentServiceCheckIfCustomerExistsRequest is the request payload for a payment check if customer exists request + * PaymentServiceGetRequest is the request payload for getting the payment data * - * @generated from message api.v1.PaymentServiceCheckIfCustomerExistsRequest + * @generated from message api.v1.PaymentServiceGetRequest */ -export type PaymentServiceCheckIfCustomerExistsRequest = Message<"api.v1.PaymentServiceCheckIfCustomerExistsRequest"> & { +export type PaymentServiceGetRequest = Message<"api.v1.PaymentServiceGetRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -619,38 +654,31 @@ export type PaymentServiceCheckIfCustomerExistsRequest = Message<"api.v1.Payment }; /** - * Describes the message api.v1.PaymentServiceCheckIfCustomerExistsRequest. - * Use `create(PaymentServiceCheckIfCustomerExistsRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetRequest. + * Use `create(PaymentServiceGetRequestSchema)` to create a new message. */ -export const PaymentServiceCheckIfCustomerExistsRequestSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceGetRequestSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 11); /** - * PaymentServiceCheckIfCustomerExistsResponse is the response payload for a payment check if customer exists request + * PaymentServiceGetResponse is the response payload for a payment get request * - * @generated from message api.v1.PaymentServiceCheckIfCustomerExistsResponse + * @generated from message api.v1.PaymentServiceGetResponse */ -export type PaymentServiceCheckIfCustomerExistsResponse = Message<"api.v1.PaymentServiceCheckIfCustomerExistsResponse"> & { +export type PaymentServiceGetResponse = Message<"api.v1.PaymentServiceGetResponse"> & { /** - * Customer is the customer + * Customer is the payment customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ customer?: PaymentCustomer; - - /** - * Exists indicates if this customer exists - * - * @generated from field: bool exists = 2; - */ - exists: boolean; }; /** - * Describes the message api.v1.PaymentServiceCheckIfCustomerExistsResponse. - * Use `create(PaymentServiceCheckIfCustomerExistsResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetResponse. + * Use `create(PaymentServiceGetResponseSchema)` to create a new message. */ -export const PaymentServiceCheckIfCustomerExistsResponseSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceGetResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 12); /** @@ -660,7 +688,7 @@ export const PaymentServiceCheckIfCustomerExistsResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -710,13 +738,13 @@ export const PaymentServiceHasPaymentMethodResponseSchema: GenMessage & { +export type PaymentServiceDeleteRequest = Message<"api.v1.PaymentServiceDeleteRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -724,25 +752,25 @@ export type PaymentServiceDeletePaymentMethodRequest = Message<"api.v1.PaymentSe }; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodRequest. - * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteRequest. + * Use `create(PaymentServiceDeleteRequestSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodRequestSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceDeleteRequestSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 15); /** - * PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request + * PaymentServiceDeleteResponse is the response payload for a delete payment request * - * @generated from message api.v1.PaymentServiceDeletePaymentMethodResponse + * @generated from message api.v1.PaymentServiceDeleteResponse */ -export type PaymentServiceDeletePaymentMethodResponse = Message<"api.v1.PaymentServiceDeletePaymentMethodResponse"> & { +export type PaymentServiceDeleteResponse = Message<"api.v1.PaymentServiceDeleteResponse"> & { }; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodResponse. - * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteResponse. + * Use `create(PaymentServiceDeleteResponseSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceDeleteResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 16); /** @@ -752,7 +780,7 @@ export const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -794,7 +822,7 @@ export const PaymentServiceGetSubscriptionUsageResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -879,7 +907,7 @@ export const PaymentServiceGetDefaultPricesResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -996,6 +1024,40 @@ export enum UsageType { export const UsageTypeSchema: GenEnum = /*@__PURE__*/ enumDesc(file_api_v1_payment, 1); +/** + * ProductTier is an explicit indicator for the state in which the customer is using the products. + * + * @generated from enum api.v1.ProductTier + */ +export enum ProductTier { + /** + * PRODUCT_TIER_UNSPECIFIED is unspecified + * + * @generated from enum value: PRODUCT_TIER_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + * + * @generated from enum value: PRODUCT_TIER_TRIAL = 1; + */ + TRIAL = 1, + + /** + * PRODUCT_TIER_PAID indicates a customer that has provided payment information. + * + * @generated from enum value: PRODUCT_TIER_PAID = 2; + */ + PAID = 2, +} + +/** + * Describes the enum api.v1.ProductTier. + */ +export const ProductTierSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_api_v1_payment, 2); + /** * PaymentService serves payment related functions * @@ -1003,54 +1065,54 @@ export const UsageTypeSchema: GenEnum = /*@__PURE__*/ */ export const PaymentService: GenService<{ /** - * CreateOrUpdateCustomer the payment data on the payment processor + * Create the payment data used for billing api resources * - * @generated from rpc api.v1.PaymentService.CreateOrUpdateCustomer + * @generated from rpc api.v1.PaymentService.Create */ - createOrUpdateCustomer: { + create: { methodKind: "unary"; - input: typeof PaymentServiceCreateOrUpdateCustomerRequestSchema; - output: typeof PaymentServiceCreateOrUpdateCustomerResponseSchema; + input: typeof PaymentServiceCreateRequestSchema; + output: typeof PaymentServiceCreateResponseSchema; }, /** - * GetCustomer from the payment processor + * Update the payment data * - * @generated from rpc api.v1.PaymentService.GetCustomer + * @generated from rpc api.v1.PaymentService.Update */ - getCustomer: { + update: { methodKind: "unary"; - input: typeof PaymentServiceGetCustomerRequestSchema; - output: typeof PaymentServiceGetCustomerResponseSchema; + input: typeof PaymentServiceUpdateRequestSchema; + output: typeof PaymentServiceUpdateResponseSchema; }, /** - * CheckIfCustomerExists at the payment processor + * Delete the payment data * - * @generated from rpc api.v1.PaymentService.CheckIfCustomerExists + * @generated from rpc api.v1.PaymentService.Delete */ - checkIfCustomerExists: { + delete: { methodKind: "unary"; - input: typeof PaymentServiceCheckIfCustomerExistsRequestSchema; - output: typeof PaymentServiceCheckIfCustomerExistsResponseSchema; + input: typeof PaymentServiceDeleteRequestSchema; + output: typeof PaymentServiceDeleteResponseSchema; }, /** - * HasPaymentMethod check if the customer has a payment method provided + * Get the payment data * - * @generated from rpc api.v1.PaymentService.HasPaymentMethod + * @generated from rpc api.v1.PaymentService.Get */ - hasPaymentMethod: { + get: { methodKind: "unary"; - input: typeof PaymentServiceHasPaymentMethodRequestSchema; - output: typeof PaymentServiceHasPaymentMethodResponseSchema; + input: typeof PaymentServiceGetRequestSchema; + output: typeof PaymentServiceGetResponseSchema; }, /** - * DeletePaymentMethod of the customer + * HasPaymentMethod check if the customer has a payment method provided * - * @generated from rpc api.v1.PaymentService.DeletePaymentMethod + * @generated from rpc api.v1.PaymentService.HasPaymentMethod */ - deletePaymentMethod: { + hasPaymentMethod: { methodKind: "unary"; - input: typeof PaymentServiceDeletePaymentMethodRequestSchema; - output: typeof PaymentServiceDeletePaymentMethodResponseSchema; + input: typeof PaymentServiceHasPaymentMethodRequestSchema; + output: typeof PaymentServiceHasPaymentMethodResponseSchema; }, /** * GetSubscriptionUsage of the customer diff --git a/js/permissions/servicepermissions.json b/js/permissions/servicepermissions.json index b916bc2c..a9f57d11 100755 --- a/js/permissions/servicepermissions.json +++ b/js/permissions/servicepermissions.json @@ -48,11 +48,11 @@ "TENANT_ROLE_OWNER": [ "/api.v1.AuditService/Get", "/api.v1.AuditService/List", - "/api.v1.PaymentService/CreateOrUpdateCustomer", - "/api.v1.PaymentService/GetCustomer", - "/api.v1.PaymentService/CheckIfCustomerExists", + "/api.v1.PaymentService/Create", + "/api.v1.PaymentService/Update", + "/api.v1.PaymentService/Delete", + "/api.v1.PaymentService/Get", "/api.v1.PaymentService/HasPaymentMethod", - "/api.v1.PaymentService/DeletePaymentMethod", "/api.v1.PaymentService/GetSubscriptionUsage", "/api.v1.PaymentService/GetInvoices", "/api.v1.PaymentService/HasChargeableResources", @@ -177,15 +177,15 @@ "/api.v1.IPService/Update": true, "/api.v1.MethodService/List": true, "/api.v1.MethodService/TokenScopedList": true, - "/api.v1.PaymentService/CheckIfCustomerExists": true, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": true, + "/api.v1.PaymentService/Create": true, + "/api.v1.PaymentService/Delete": true, + "/api.v1.PaymentService/Get": true, "/api.v1.PaymentService/GetDefaultPrices": true, "/api.v1.PaymentService/GetInvoices": true, "/api.v1.PaymentService/GetSubscriptionUsage": true, "/api.v1.PaymentService/HasChargeableResources": true, "/api.v1.PaymentService/HasPaymentMethod": true, + "/api.v1.PaymentService/Update": true, "/api.v1.ProjectService/Create": true, "/api.v1.ProjectService/Delete": true, "/api.v1.ProjectService/Get": true, @@ -276,14 +276,14 @@ "tenant": { "/api.v1.AuditService/Get": true, "/api.v1.AuditService/List": true, - "/api.v1.PaymentService/CheckIfCustomerExists": true, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": true, + "/api.v1.PaymentService/Create": true, + "/api.v1.PaymentService/Delete": true, + "/api.v1.PaymentService/Get": true, "/api.v1.PaymentService/GetInvoices": true, "/api.v1.PaymentService/GetSubscriptionUsage": true, "/api.v1.PaymentService/HasChargeableResources": true, "/api.v1.PaymentService/HasPaymentMethod": true, + "/api.v1.PaymentService/Update": true, "/api.v1.ProjectService/Create": true, "/api.v1.TenantService/Delete": true, "/api.v1.TenantService/Get": true, @@ -367,15 +367,15 @@ "/api.v1.IPService/Update": true, "/api.v1.MethodService/List": true, "/api.v1.MethodService/TokenScopedList": true, - "/api.v1.PaymentService/CheckIfCustomerExists": false, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": false, + "/api.v1.PaymentService/Create": true, + "/api.v1.PaymentService/Delete": true, + "/api.v1.PaymentService/Get": false, "/api.v1.PaymentService/GetDefaultPrices": false, "/api.v1.PaymentService/GetInvoices": false, "/api.v1.PaymentService/GetSubscriptionUsage": false, "/api.v1.PaymentService/HasChargeableResources": false, "/api.v1.PaymentService/HasPaymentMethod": false, + "/api.v1.PaymentService/Update": true, "/api.v1.ProjectService/Create": true, "/api.v1.ProjectService/Delete": true, "/api.v1.ProjectService/Get": false, diff --git a/proto/api/v1/payment.proto b/proto/api/v1/payment.proto index d2ec2470..a5567566 100644 --- a/proto/api/v1/payment.proto +++ b/proto/api/v1/payment.proto @@ -8,20 +8,24 @@ import "google/protobuf/timestamp.proto"; // PaymentService serves payment related functions service PaymentService { - // CreateOrUpdateCustomer the payment data on the payment processor - rpc CreateOrUpdateCustomer(PaymentServiceCreateOrUpdateCustomerRequest) returns (PaymentServiceCreateOrUpdateCustomerResponse) { + // Create the payment data used for billing api resources + rpc Create(PaymentServiceCreateRequest) returns (PaymentServiceCreateResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; } - // GetCustomer from the payment processor - rpc GetCustomer(PaymentServiceGetCustomerRequest) returns (PaymentServiceGetCustomerResponse) { + // Update the payment data + rpc Update(PaymentServiceUpdateRequest) returns (PaymentServiceUpdateResponse) { + option (tenant_roles) = TENANT_ROLE_OWNER; + } + // Delete the payment data + rpc Delete(PaymentServiceDeleteRequest) returns (PaymentServiceDeleteResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; - option (auditing) = AUDITING_EXCLUDED; } - // CheckIfCustomerExists at the payment processor - rpc CheckIfCustomerExists(PaymentServiceCheckIfCustomerExistsRequest) returns (PaymentServiceCheckIfCustomerExistsResponse) { + // Get the payment data + rpc Get(PaymentServiceGetRequest) returns (PaymentServiceGetResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; option (auditing) = AUDITING_EXCLUDED; } + // HasPaymentMethod check if the customer has a payment method provided rpc HasPaymentMethod(PaymentServiceHasPaymentMethodRequest) returns (PaymentServiceHasPaymentMethodResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; @@ -30,10 +34,7 @@ service PaymentService { option (tenant_roles) = TENANT_ROLE_GUEST; option (auditing) = AUDITING_EXCLUDED; } - // DeletePaymentMethod of the customer - rpc DeletePaymentMethod(PaymentServiceDeletePaymentMethodRequest) returns (PaymentServiceDeletePaymentMethodResponse) { - option (tenant_roles) = TENANT_ROLE_OWNER; - } + // GetSubscriptionUsage of the customer rpc GetSubscriptionUsage(PaymentServiceGetSubscriptionUsageRequest) returns (PaymentServiceGetSubscriptionUsageResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; @@ -87,6 +88,8 @@ message PaymentCustomer { optional string phone_number = 12; // Balance actual balance of the customer optional int64 balance = 13; + // Tier describes the state in which the customer is using the products. + ProductTier tier = 14; } // Card is the payment card the customer pays with @@ -148,6 +151,16 @@ enum UsageType { USAGE_TYPE_LICENSED = 2; } +// ProductTier is an explicit indicator for the state in which the customer is using the products. +enum ProductTier { + // PRODUCT_TIER_UNSPECIFIED is unspecified + PRODUCT_TIER_UNSPECIFIED = 0; + // PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + PRODUCT_TIER_TRIAL = 1; + // PRODUCT_TIER_PAID indicates a customer that has provided payment information. + PRODUCT_TIER_PAID = 2; +} + // Address postal address of a customer message Address { // Line1 the first address line @@ -214,78 +227,86 @@ message Coupon { int64 amount_left = 10; } -// PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request -message PaymentServiceCreateOrUpdateCustomerRequest { - reserved 2; - reserved "customer"; - reserved 3; - reserved "accepted_terms_and_conditions"; - - // Login of the customer +// PaymentServiceCreateRequest is the request payload for providing payment data +message PaymentServiceCreateRequest { + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; // Name of the customer to be billed - optional string name = 4; + string name = 2 [(buf.validate.field).required = true]; // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api - optional string payment_method_id = 5; + string payment_method_id = 3 [ + (buf.validate.field).string = {min_len: 3}, + (buf.validate.field).string.pattern = "pm_[a-zA-Z0-9]*$" + ]; // Email of the customer to be billed - optional string email = 6 [(buf.validate.field).string.email = true]; - // Card the customer to be billed - optional Card card = 7; + string email = 4 [(buf.validate.field).string.email = true]; // Address is the postal address of the customer to be billed - Address address = 8; + Address address = 5; // Vat which applies to the customer to be billed - optional string vat = 9; + string vat = 6 [(buf.validate.field).required = true]; // PhoneNumber of the customer to be billed - optional string phone_number = 10; + optional string phone_number = 7 [(buf.validate.field).string = {min_len: 1}]; } -// PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request -message PaymentServiceCreateOrUpdateCustomerResponse { - // Customer is the customer +// PaymentServiceCreateResponse is the response payload for a payment create request +message PaymentServiceCreateResponse { + // Customer is the created customer PaymentCustomer customer = 1; } -// PaymentServiceGetCustomerRequest is the request payload for a payment get customer request -message PaymentServiceGetCustomerRequest { - // Login of the customer +// PaymentServiceUpdateRequest is the request payload for updating payment data +message PaymentServiceUpdateRequest { + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; - // CustomerId of the customer - string customer_id = 2; + + // Name of the customer to be billed + optional string name = 2 [(buf.validate.field).string = {min_len: 1}]; + // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + optional string payment_method_id = 3 [ + (buf.validate.field).string = {min_len: 3}, + (buf.validate.field).string.pattern = "pm_[a-zA-Z0-9]*$" + ]; + // Email of the customer to be billed + optional string email = 4 [(buf.validate.field).string.email = true]; + // Address is the postal address of the customer to be billed + Address address = 5; + // Vat which applies to the customer to be billed + optional string vat = 6 [(buf.validate.field).string = {min_len: 1}]; + // PhoneNumber of the customer to be billed + optional string phone_number = 7 [(buf.validate.field).string = {min_len: 1}]; } -// PaymentServiceGetCustomerResponse is the response payload for a payment get customer request -message PaymentServiceGetCustomerResponse { - // Customer is the customer +// PaymentServiceUpdateResponse is the response payload for a payment update request +message PaymentServiceUpdateResponse { + // Customer is the updated customer PaymentCustomer customer = 1; } -// PaymentServiceCheckIfCustomerExistsRequest is the request payload for a payment check if customer exists request -message PaymentServiceCheckIfCustomerExistsRequest { - // Login of the customer +// PaymentServiceGetRequest is the request payload for getting the payment data +message PaymentServiceGetRequest { + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; } -// PaymentServiceCheckIfCustomerExistsResponse is the response payload for a payment check if customer exists request -message PaymentServiceCheckIfCustomerExistsResponse { - // Customer is the customer +// PaymentServiceGetResponse is the response payload for a payment get request +message PaymentServiceGetResponse { + // Customer is the payment customer PaymentCustomer customer = 1; - // Exists indicates if this customer exists - bool exists = 2; } // PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request message PaymentServiceHasPaymentMethodRequest { - // Login of the customer + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 @@ -302,21 +323,21 @@ message PaymentServiceHasPaymentMethodResponse { bool positive_balance = 3; } -// PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request -message PaymentServiceDeletePaymentMethodRequest { - // Login of the customer +// PaymentServiceDeleteRequest is the request payload for a delete payment request +message PaymentServiceDeleteRequest { + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; } -// PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request -message PaymentServiceDeletePaymentMethodResponse {} +// PaymentServiceDeleteResponse is the response payload for a delete payment request +message PaymentServiceDeleteResponse {} // PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request message PaymentServiceGetSubscriptionUsageRequest { - // Login of the customer + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 @@ -331,7 +352,7 @@ message PaymentServiceGetSubscriptionUsageResponse { // PaymentServiceHasPaymentMethodRequest is the request payload for a get invoices request message PaymentServiceGetInvoicesRequest { - // Login of the customer + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 @@ -357,7 +378,7 @@ message PaymentServiceGetDefaultPricesResponse { // PaymentServiceHasChargeableResourcesRequest is the request payload for a has chargeable request message PaymentServiceHasChargeableResourcesRequest { - // Login of the customer + // Login of the tenant string login = 1; }