SDK naming conventions
What the SDKs rename, what they leave alone, and where the line falls.
In the server SDKs, method names follow your language, and field names keep the API's
snake_case: created_at, authorization_url, per_page.
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 | /webhooks, ?per_page=50 |
| Header names | No | Idempotency-Key, X-Wajub-Signature |
| Enum values | No | payment.succeeded, pending, XAF |
| Resource ids | No | trx_…, cus_…, po_… |
"authorization_url": "https://pay.wajub.com/test_xxxxx"In Ruby it is payment.authorization_url, in Java payment.getAuthorizationUrl(), and in C#
payment.AuthorizationUrl. In Go, Java and C#, read it from that typed field:
Raw["authorization_url"] finds nothing.
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() |
In Python, the global accessor is wajub.global_, because global is a keyword.
Create a payment with payments.create.
The typed languages decode a few fields
Go, Java and C# give a payment's main fields as typed fields named the language's way, and every
other field in Raw, under its API name.
payment.id
payment.status
payment.amount
payment.currency
payment.authorization_url
payment.authorization_token
payment.reference // an index signature covers the restReading the API reference from any SDK
The reference documents the wire. Apply exactly one transformation.
| In the reference | In your code |
|---|---|
POST /webhooks/{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.