Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit 96eed1a

Browse files
authored
Align PascalCase error codes (#9)
Align PascalCase naming for OpenIapError constants to match Android parity and update every call site accordingly. Blocked by SwiftPM sandbox restrictions, tests require local run.
1 parent d02aad6 commit 96eed1a

File tree

6 files changed

+161
-287
lines changed

6 files changed

+161
-287
lines changed

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ func requestPurchaseIOS() // Should be requestPurchase() if cross-platform
8989
- **API**: `Api` when at beginning/middle, `API` when as suffix
9090
- **URL**: `Url` when at beginning/middle, `URL` when as suffix
9191

92+
## Error Code Naming
93+
94+
- `OpenIapError` static code constants use PascalCase names (e.g. `UserCancelled`, `SkuNotFound`) while the raw string value stays as the `E_` code for parity with other platforms.
95+
- Always reference the PascalCase constants in Swift and avoid introducing new `E_`-prefixed identifiers.
96+
9297
## Testing
9398

9499
- Run tests with: `swift test`

CLAUDE.md

Lines changed: 0 additions & 132 deletions
This file was deleted.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

Example/OpenIapExample/Screens/PurchaseFlowScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ struct PurchaseFlowScreen: View {
290290
showPurchaseResult = true
291291

292292
// Show error alert for non-cancellation errors
293-
if error.code != OpenIapError.E_USER_CANCELLED {
293+
if error.code != OpenIapError.UserCancelled {
294294
errorMessage = error.message
295295
showError = true
296296
}

0 commit comments

Comments
 (0)