Uh oh!
There was an error while loading. Please reload this page.
Turn payment service endpoints into CRUD. - #200
Conversation
This makes our API more consistent and makes it easier to implement and handle for the CLI.
| option (tenant_roles) = TENANT_ROLE_OWNER; | ||
| } | ||
| // Get the payment data | ||
| rpc Get(PaymentServiceGetRequest) returns (PaymentServiceGetResponse) { |
There was a problem hiding this comment.
Could this endpoint make the CheckIfCustomerExists obsolete?
There was a problem hiding this comment.
Yes, I removed CheckIfCustomerExists now.
| message PaymentServiceDeletePaymentMethodRequest { | ||
| // Login of the customer | ||
| // PaymentServiceDeleteRequest is the request payload for a delete payment request | ||
| message PaymentServiceDeleteRequest { |
There was a problem hiding this comment.
It's a bit counterintuitive that a create requests creates a customer but a delete request deletes a payment method but I don't have a better idea either.
There was a problem hiding this comment.
There is no "Customer" anymore in these methods, so this should be consistent in the API definition.
| string name = 2; | ||
| // 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; | ||
| // Email of the customer to be billed | ||
| optional string email = 6 [(buf.validate.field).string.email = true]; | ||
| string email = 4 [(buf.validate.field).string.email = true]; | ||
| // Card the customer to be billed | ||
| optional Card card = 7; | ||
| Card card = 5; | ||
| // Address is the postal address of the customer to be billed | ||
| Address address = 8; | ||
| Address address = 6; | ||
| // Vat which applies to the customer to be billed | ||
| optional string vat = 9; | ||
| string vat = 7; | ||
| // PhoneNumber of the customer to be billed | ||
| optional string phone_number = 10; | ||
| optional string phone_number = 8; |
There was a problem hiding this comment.
Pretty sure that we should add more validations to this. Fields like address must be provided?
There was a problem hiding this comment.
Yes, I think there should more validations in general.
10c4d51 to
1298609Compare
This makes our API more consistent and makes it easier to implement and handle for the CLI.