Skip to content

PaymentService returns string instead of ENUM #118

Description

@Conceptiks

Hey @Pilzington,

we talked about this on a call already, but I still wanted to make sure this doesn't get lost:

When fetching prices on the /prices page of our website, I use PaymentService.getDefaultPrices() to retrieve a PaymentServiceGetDefaultPricesResponse type. This type seems to return a class that contains an array of Price classes:

api/js/api/v1/payment_pb.ts

Lines 1226 to 1232 in 777e867

exportclassPaymentServiceGetDefaultPricesResponseextendsMessage<PaymentServiceGetDefaultPricesResponse>{
/**
* @generated from field: repeated api.v1.Price prices = 1;
*/
prices: Price[]=[];
constructor(data?: PartialMessage<PaymentServiceGetDefaultPricesResponse>){

This Price Class looks to reference productType as an enum.

/**
* @generated from field: api.v1.ProductType product_type = 5;
*/
productType=ProductType.UNSPECIFIED;

In my case, fetching from the API doesn't return the ENUM member but the metadata from the enum:

{"name": "ip","unitAmountDecimal": 0.016203704,"currency": "eur","unitLabel": "minute","productType": "PRODUCT_TYPE_NETWORK",// <-- THIS seems to be the Enum.metadata.name instead of the enum member itself?"description": "Connect to the internet with ephemeral or static public facing IPv4 addresses."}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions