SDK naming conventions
What the SDKs rename, what they leave alone, and where the line falls.
The Wajub API speaks snake_case on the wire. created_at, authorization_url, per_page. The
question every SDK has to answer is how much of that to translate into the host language.
Wajub's answer is deliberately narrow. Method names follow your language. Payload field names do not. A field keeps the name the API gave it, in all seven SDKs.
What changes, and what does not
| Layer | Follows the language | Example |
|---|---|---|
| Client, resource and method names | Yes | wajub.payments.listRefunds(), client.Payments.ListRefunds() |
| Fields you send | No | "authorization_url", "per_page", "decline_code" |
| Fields you read back | No | payment.authorization_url, payment["created_at"] |
| HTTP paths and query parameters | No | /webhook-endpoints, ?per_page=50 |
| Header names | No | Idempotency-Key, X-Wajub-Signature |
| Enum values | No | payment.succeeded, pending, XAF |
| Resource ids | No | trx_…, cus_…, po_… |
So the same field is spelled the same way whichever SDK you are in, and the API reference is readable from any of them without a mental mapping step.
"authorization_url": "https://pay.wajub.com/tok_xxxxx"In Ruby it is payment.authorization_url, in Java payment.getRaw().get("authorization_url"),
and in C# payment.Raw["authorization_url"].
The method names, by language
| SDK | Style | A method that shows it |
|---|---|---|
| Node.js | camelCase | wajub.webhookEndpoints.rotateSecret() |
| Python | snake_case | wajub.webhook_endpoints.rotate_secret() |
| PHP | camelCase | $wajub->webhookEndpoints->rotateSecret() |
| Go | PascalCase | client.WebhookEndpoints.RotateSecret() |
| Ruby | snake_case | client.webhook_endpoints.rotate_secret |
| Java | camelCase | client.webhookEndpoints().rotateSecret() |
| C# | PascalCase with Async | client.WebhookEndpoints.RotateSecretAsync() |
Two names had to bend further than the rest, because the obvious one was already taken.
| Where | Why |
|---|---|
initialize_payment in Ruby | initialize is the constructor. Every other SDK calls the alias initialize |
wajub.global_ in Python | global is a keyword. Every other SDK calls the accessor global |
The typed languages decode a few fields
Go, Java and C# are statically typed, so they cannot hand you an arbitrary bag of fields and let you reach into it. They decode a small struct and keep everything else raw.
payment.id
payment.status
payment.amount
payment.currency
payment.authorization_url
payment.authorization_token
payment.reference // an index signature covers the restThose are the only renamed fields in the whole surface, and the rename is mechanical:
authorization_url becomes AuthorizationURL in Go, getAuthorizationUrl() in Java,
AuthorizationUrl in C#.
Amount is where the typed decoding costs you
Go, Java and C# all decode amount as a 64 bit integer. Amounts travel in the major unit, so
GHS 12.50 truncates to 12. Zero-decimal currencies such as XAF and XOF are unaffected. For
anything else read Raw["amount"], which keeps the value the API sent.
The mobile SDKs made the opposite choice, twice
They are the one place where this is not consistent.
| SDK | Field style | Example |
|---|---|---|
wajub_mobile (Flutter) | Renamed to camelCase | error.declineCode, transaction.amountTotal |
com.wajub:wajub-mobile-core (Android) | Renamed to camelCase | error.declineCode, channel.publishableKey |
@wajub/react-native | Kept as snake_case | error.decline_code, channel.publishable_key |
Flutter and Android decode into data classes and rename as they go. React Native keeps the wire shape. Porting a handler between React Native and Flutter therefore means renaming every field, which is worth knowing before you start.
Reading the API reference from any SDK
The reference documents the wire. Apply exactly one transformation.
| In the reference | In your code |
|---|---|
POST /webhook-endpoints/{id}/rotate-secret | The method, in your language's style |
authorization_url in the response body | The same string, unchanged |
per_page as a query parameter | The same string, unchanged |
Without an SDK, everything is snake_case
A raw HTTP call sends and receives snake_case in JSON bodies and query strings. There is no
endpoint that accepts camelCase.
Related pages
- SDKs & LibrariesEvery package, and where each one lives.
- SDK QuickstartThe same first call, in five languages side by side.
- API errorsThe error envelope and every status code.
- PaginationThe list shape every SDK wraps.
- Signature verificationThe header names, which never change.
- Mobile SDKsWhere the field naming diverges, and why.