payra-sdk 1.2.7__tar.gz → 1.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: payra_sdk
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: Python SDK for Payra payment signature generation (backend)
5
5
  Author: Your Name
6
6
  Author-email: Wraith <support@payra.cash>
@@ -159,9 +159,9 @@ PAYRA_LINEA_RPC_URL_2=
159
159
 
160
160
  - The cache automatically refreshes when it expires.
161
161
  - You can adjust the cache duration by setting `PAYRA_EXCHANGE_RATE_CACHE_TIME`:
162
- - `5` → cache for 5 minutes
163
- - `60` → cache for 1 hour
164
- - `720` → cache for 12 hours (default)
162
+ - `5` → cache for 5 minutes
163
+ - `60` → cache for 1 hour
164
+ - `720` → cache for 12 hours (default)
165
165
  - Each network (Polygon, Ethereum, Linea) has its own **merchant ID**, **signature key**, and **RPC URLs**.
166
166
  - The SDK automatically detects which chain configuration to use based on the selected network.
167
167
  - You can use multiple RPC URLs for redundancy (the SDK will automatically fall back if one fails).
@@ -181,11 +181,11 @@ try:
181
181
 
182
182
  PAYMENT_DATA = {
183
183
  "network": "polygon",
184
- "token_address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", # USDT on Polygon
185
- "order_id": "ord-258",
186
- "amount_wei": amount_wei, # e.g. 3.34 USDT in smallest unit
184
+ "tokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", # USDT on Polygon
185
+ "orderId": "ord-258",
186
+ "amountWei": amount_wei, # e.g. 3.34 USDT in smallest unit
187
187
  "timestamp": 1753826059, # current Unix timestamp
188
- "payer_address": "0xe6c961D6ad9a27Ea8e5d99e40abaC365DE9Cc162"
188
+ "payerAddress": "0xe6c961D6ad9a27Ea8e5d99e40abaC365DE9Cc162"
189
189
  }
190
190
 
191
191
  # Initialize signer
@@ -194,11 +194,11 @@ try:
194
194
  # Generate cryptographic signature
195
195
  signature = payra_signature.generate(
196
196
  network=PAYMENT_DATA["network"],
197
- token_address=PAYMENT_DATA["token_address"],
198
- order_id=PAYMENT_DATA["order_id"],
199
- amount_wei=PAYMENT_DATA["amount_wei"],
197
+ token_address=PAYMENT_DATA["tokenAddress"],
198
+ order_id=PAYMENT_DATA["orderId"],
199
+ amount_wei=PAYMENT_DATA["amountWei"],
200
200
  timestamp=PAYMENT_DATA["timestamp"],
201
- payer_address=PAYMENT_DATA["payer_address"]
201
+ payer_address=PAYMENT_DATA["payerAddress"]
202
202
  )
203
203
 
204
204
  print(f"Generated signature: {signature}")
@@ -213,16 +213,16 @@ except Exception as e:
213
213
  | Field | Type | Description |
214
214
  |--------------|----------|----------------------------------------------|
215
215
  | **`network`** | `string` | Selected network name |
216
- | **`token_address`** | `string` | ERC20 token contract address |
217
- | **`order_id`** | `string` | Unique order reference (e.g. ORDER-123) |
218
- | **`amount_wei`** | `string` or `integer` | Token amount in smallest unit (e.g. wei) |
216
+ | **`tokenAddress`** | `string` | ERC20 token contract address |
217
+ | **`orderId`** | `string` | Unique order reference (e.g. ORDER-123) |
218
+ | **`amountWei`** | `string` or `integer` | Token amount in smallest unit (e.g. wei) |
219
219
  | **`timestamp`** | `number` | Unix timestamp of signature creation |
220
- | **`payer_address`** | `string` | Payer Wallet Address
220
+ | **`payerAddress`** | `string` | Payer Wallet Address
221
221
 
222
222
  #### Behind the Scenes
223
223
 
224
224
  1. The backend converts the amount to the smallest blockchain unit (e.g. wei).
225
- 2. A `PayraSignatureGenerator` instance is created using your signature key from `.env`
225
+ 2. A `PayraSignature` instance is created using your signature key from `.env`
226
226
  3. It generates an ECDSA signature that is fully verifiable on-chain by the Payra smart contract.
227
227
  4. The resulting signature should be sent to the **frontend**, which must call `payOrder(...)` using the same parameters (`timestamp`, `orderId`, `amount`, `tokenAddress`, etc.) that were used to generate the signature.
228
228
 
@@ -252,7 +252,7 @@ try:
252
252
 
253
253
  print("Order ID:", ORDER_ID)
254
254
  print("Details:", details)
255
-
255
+
256
256
  except PayraSDKException as e:
257
257
  print(f"Payra SDK error: {e}")
258
258
  except Exception as e:
@@ -262,14 +262,14 @@ except Exception as e:
262
262
  #### Behind the Scenes
263
263
 
264
264
  1. The backend initializes a `PayraOrderService` object for the desired blockchain network.
265
- 2. It calls `get_details(order_id)` to check if the order transaction exists and is confirmed on-chain.
265
+ 2. It calls `get_details(order_id)` to get transaction details from blockchain.
266
266
  3. The function returns a dictionary with:
267
267
 
268
268
  ```python
269
269
  {
270
270
  "success": True,
271
271
  "paid": True,
272
- "error": None.
272
+ "error": None,
273
273
  "toke": '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
274
274
  "amount": 400000,
275
275
  "fee": 3600,
@@ -316,7 +316,7 @@ except Exception as e:
316
316
  #### Behind the Scenes
317
317
 
318
318
  1. The backend initializes a `PayraOrderService` object for the desired blockchain network.
319
- 2. It calls `is_order_paid(order_id)` to check if the order transaction exists and is confirmed on-chain.
319
+ 2. It calls `is_paid(order_id)` to check if the order transaction exists and is confirmed on-chain.
320
320
  3. The function returns a dictionary with:
321
321
  ```python
322
322
  {
@@ -367,17 +367,16 @@ You can run the included `examples` to test signing and verification:
367
367
  ```python
368
368
  python3 example_signature.py
369
369
  python3 example_order_get_details.py
370
- python3 example_order_is_paid
370
+ python3 example_order_is_paid.py
371
371
  python3 example_utils.py
372
372
  ```
373
373
 
374
374
  Make sure your `.env` file contains correct values for the `network` being used.
375
375
 
376
- ### Tips
376
+ ## Security Notice
377
377
 
378
- - Always verify your `.env` configuration before running any signing or on-chain verification examples.
379
- - The SDK examples are safe to run, they use **read-only RPC calls** (no real transactions are broadcast).
380
- - You can modify `example_signature.py` to test custom token addresses or order parameters.
378
+ Never expose your signature key in frontend or client-side code.
379
+ This SDK is **server-side only** and must be used securely on your backend. Never use it in frontend or browser environments. Also, never commit your `.env` file to version control.
381
380
 
382
381
  ## Projects
383
382
 
@@ -400,4 +399,5 @@ Make sure your `.env` file contains correct values for the `network` being used.
400
399
  - [Dev.to](https://dev.to/payracash)
401
400
 
402
401
  ## License
402
+
403
403
  MIT © [Payra](https://payra.cash)
@@ -135,9 +135,9 @@ PAYRA_LINEA_RPC_URL_2=
135
135
 
136
136
  - The cache automatically refreshes when it expires.
137
137
  - You can adjust the cache duration by setting `PAYRA_EXCHANGE_RATE_CACHE_TIME`:
138
- - `5` → cache for 5 minutes
139
- - `60` → cache for 1 hour
140
- - `720` → cache for 12 hours (default)
138
+ - `5` → cache for 5 minutes
139
+ - `60` → cache for 1 hour
140
+ - `720` → cache for 12 hours (default)
141
141
  - Each network (Polygon, Ethereum, Linea) has its own **merchant ID**, **signature key**, and **RPC URLs**.
142
142
  - The SDK automatically detects which chain configuration to use based on the selected network.
143
143
  - You can use multiple RPC URLs for redundancy (the SDK will automatically fall back if one fails).
@@ -157,11 +157,11 @@ try:
157
157
 
158
158
  PAYMENT_DATA = {
159
159
  "network": "polygon",
160
- "token_address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", # USDT on Polygon
161
- "order_id": "ord-258",
162
- "amount_wei": amount_wei, # e.g. 3.34 USDT in smallest unit
160
+ "tokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", # USDT on Polygon
161
+ "orderId": "ord-258",
162
+ "amountWei": amount_wei, # e.g. 3.34 USDT in smallest unit
163
163
  "timestamp": 1753826059, # current Unix timestamp
164
- "payer_address": "0xe6c961D6ad9a27Ea8e5d99e40abaC365DE9Cc162"
164
+ "payerAddress": "0xe6c961D6ad9a27Ea8e5d99e40abaC365DE9Cc162"
165
165
  }
166
166
 
167
167
  # Initialize signer
@@ -170,11 +170,11 @@ try:
170
170
  # Generate cryptographic signature
171
171
  signature = payra_signature.generate(
172
172
  network=PAYMENT_DATA["network"],
173
- token_address=PAYMENT_DATA["token_address"],
174
- order_id=PAYMENT_DATA["order_id"],
175
- amount_wei=PAYMENT_DATA["amount_wei"],
173
+ token_address=PAYMENT_DATA["tokenAddress"],
174
+ order_id=PAYMENT_DATA["orderId"],
175
+ amount_wei=PAYMENT_DATA["amountWei"],
176
176
  timestamp=PAYMENT_DATA["timestamp"],
177
- payer_address=PAYMENT_DATA["payer_address"]
177
+ payer_address=PAYMENT_DATA["payerAddress"]
178
178
  )
179
179
 
180
180
  print(f"Generated signature: {signature}")
@@ -189,16 +189,16 @@ except Exception as e:
189
189
  | Field | Type | Description |
190
190
  |--------------|----------|----------------------------------------------|
191
191
  | **`network`** | `string` | Selected network name |
192
- | **`token_address`** | `string` | ERC20 token contract address |
193
- | **`order_id`** | `string` | Unique order reference (e.g. ORDER-123) |
194
- | **`amount_wei`** | `string` or `integer` | Token amount in smallest unit (e.g. wei) |
192
+ | **`tokenAddress`** | `string` | ERC20 token contract address |
193
+ | **`orderId`** | `string` | Unique order reference (e.g. ORDER-123) |
194
+ | **`amountWei`** | `string` or `integer` | Token amount in smallest unit (e.g. wei) |
195
195
  | **`timestamp`** | `number` | Unix timestamp of signature creation |
196
- | **`payer_address`** | `string` | Payer Wallet Address
196
+ | **`payerAddress`** | `string` | Payer Wallet Address
197
197
 
198
198
  #### Behind the Scenes
199
199
 
200
200
  1. The backend converts the amount to the smallest blockchain unit (e.g. wei).
201
- 2. A `PayraSignatureGenerator` instance is created using your signature key from `.env`
201
+ 2. A `PayraSignature` instance is created using your signature key from `.env`
202
202
  3. It generates an ECDSA signature that is fully verifiable on-chain by the Payra smart contract.
203
203
  4. The resulting signature should be sent to the **frontend**, which must call `payOrder(...)` using the same parameters (`timestamp`, `orderId`, `amount`, `tokenAddress`, etc.) that were used to generate the signature.
204
204
 
@@ -228,7 +228,7 @@ try:
228
228
 
229
229
  print("Order ID:", ORDER_ID)
230
230
  print("Details:", details)
231
-
231
+
232
232
  except PayraSDKException as e:
233
233
  print(f"Payra SDK error: {e}")
234
234
  except Exception as e:
@@ -238,14 +238,14 @@ except Exception as e:
238
238
  #### Behind the Scenes
239
239
 
240
240
  1. The backend initializes a `PayraOrderService` object for the desired blockchain network.
241
- 2. It calls `get_details(order_id)` to check if the order transaction exists and is confirmed on-chain.
241
+ 2. It calls `get_details(order_id)` to get transaction details from blockchain.
242
242
  3. The function returns a dictionary with:
243
243
 
244
244
  ```python
245
245
  {
246
246
  "success": True,
247
247
  "paid": True,
248
- "error": None.
248
+ "error": None,
249
249
  "toke": '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
250
250
  "amount": 400000,
251
251
  "fee": 3600,
@@ -292,7 +292,7 @@ except Exception as e:
292
292
  #### Behind the Scenes
293
293
 
294
294
  1. The backend initializes a `PayraOrderService` object for the desired blockchain network.
295
- 2. It calls `is_order_paid(order_id)` to check if the order transaction exists and is confirmed on-chain.
295
+ 2. It calls `is_paid(order_id)` to check if the order transaction exists and is confirmed on-chain.
296
296
  3. The function returns a dictionary with:
297
297
  ```python
298
298
  {
@@ -343,17 +343,16 @@ You can run the included `examples` to test signing and verification:
343
343
  ```python
344
344
  python3 example_signature.py
345
345
  python3 example_order_get_details.py
346
- python3 example_order_is_paid
346
+ python3 example_order_is_paid.py
347
347
  python3 example_utils.py
348
348
  ```
349
349
 
350
350
  Make sure your `.env` file contains correct values for the `network` being used.
351
351
 
352
- ### Tips
352
+ ## Security Notice
353
353
 
354
- - Always verify your `.env` configuration before running any signing or on-chain verification examples.
355
- - The SDK examples are safe to run, they use **read-only RPC calls** (no real transactions are broadcast).
356
- - You can modify `example_signature.py` to test custom token addresses or order parameters.
354
+ Never expose your signature key in frontend or client-side code.
355
+ This SDK is **server-side only** and must be used securely on your backend. Never use it in frontend or browser environments. Also, never commit your `.env` file to version control.
357
356
 
358
357
  ## Projects
359
358
 
@@ -376,4 +375,5 @@ Make sure your `.env` file contains correct values for the `network` being used.
376
375
  - [Dev.to](https://dev.to/payracash)
377
376
 
378
377
  ## License
378
+
379
379
  MIT © [Payra](https://payra.cash)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: payra_sdk
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: Python SDK for Payra payment signature generation (backend)
5
5
  Author: Your Name
6
6
  Author-email: Wraith <support@payra.cash>
@@ -159,9 +159,9 @@ PAYRA_LINEA_RPC_URL_2=
159
159
 
160
160
  - The cache automatically refreshes when it expires.
161
161
  - You can adjust the cache duration by setting `PAYRA_EXCHANGE_RATE_CACHE_TIME`:
162
- - `5` → cache for 5 minutes
163
- - `60` → cache for 1 hour
164
- - `720` → cache for 12 hours (default)
162
+ - `5` → cache for 5 minutes
163
+ - `60` → cache for 1 hour
164
+ - `720` → cache for 12 hours (default)
165
165
  - Each network (Polygon, Ethereum, Linea) has its own **merchant ID**, **signature key**, and **RPC URLs**.
166
166
  - The SDK automatically detects which chain configuration to use based on the selected network.
167
167
  - You can use multiple RPC URLs for redundancy (the SDK will automatically fall back if one fails).
@@ -181,11 +181,11 @@ try:
181
181
 
182
182
  PAYMENT_DATA = {
183
183
  "network": "polygon",
184
- "token_address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", # USDT on Polygon
185
- "order_id": "ord-258",
186
- "amount_wei": amount_wei, # e.g. 3.34 USDT in smallest unit
184
+ "tokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", # USDT on Polygon
185
+ "orderId": "ord-258",
186
+ "amountWei": amount_wei, # e.g. 3.34 USDT in smallest unit
187
187
  "timestamp": 1753826059, # current Unix timestamp
188
- "payer_address": "0xe6c961D6ad9a27Ea8e5d99e40abaC365DE9Cc162"
188
+ "payerAddress": "0xe6c961D6ad9a27Ea8e5d99e40abaC365DE9Cc162"
189
189
  }
190
190
 
191
191
  # Initialize signer
@@ -194,11 +194,11 @@ try:
194
194
  # Generate cryptographic signature
195
195
  signature = payra_signature.generate(
196
196
  network=PAYMENT_DATA["network"],
197
- token_address=PAYMENT_DATA["token_address"],
198
- order_id=PAYMENT_DATA["order_id"],
199
- amount_wei=PAYMENT_DATA["amount_wei"],
197
+ token_address=PAYMENT_DATA["tokenAddress"],
198
+ order_id=PAYMENT_DATA["orderId"],
199
+ amount_wei=PAYMENT_DATA["amountWei"],
200
200
  timestamp=PAYMENT_DATA["timestamp"],
201
- payer_address=PAYMENT_DATA["payer_address"]
201
+ payer_address=PAYMENT_DATA["payerAddress"]
202
202
  )
203
203
 
204
204
  print(f"Generated signature: {signature}")
@@ -213,16 +213,16 @@ except Exception as e:
213
213
  | Field | Type | Description |
214
214
  |--------------|----------|----------------------------------------------|
215
215
  | **`network`** | `string` | Selected network name |
216
- | **`token_address`** | `string` | ERC20 token contract address |
217
- | **`order_id`** | `string` | Unique order reference (e.g. ORDER-123) |
218
- | **`amount_wei`** | `string` or `integer` | Token amount in smallest unit (e.g. wei) |
216
+ | **`tokenAddress`** | `string` | ERC20 token contract address |
217
+ | **`orderId`** | `string` | Unique order reference (e.g. ORDER-123) |
218
+ | **`amountWei`** | `string` or `integer` | Token amount in smallest unit (e.g. wei) |
219
219
  | **`timestamp`** | `number` | Unix timestamp of signature creation |
220
- | **`payer_address`** | `string` | Payer Wallet Address
220
+ | **`payerAddress`** | `string` | Payer Wallet Address
221
221
 
222
222
  #### Behind the Scenes
223
223
 
224
224
  1. The backend converts the amount to the smallest blockchain unit (e.g. wei).
225
- 2. A `PayraSignatureGenerator` instance is created using your signature key from `.env`
225
+ 2. A `PayraSignature` instance is created using your signature key from `.env`
226
226
  3. It generates an ECDSA signature that is fully verifiable on-chain by the Payra smart contract.
227
227
  4. The resulting signature should be sent to the **frontend**, which must call `payOrder(...)` using the same parameters (`timestamp`, `orderId`, `amount`, `tokenAddress`, etc.) that were used to generate the signature.
228
228
 
@@ -252,7 +252,7 @@ try:
252
252
 
253
253
  print("Order ID:", ORDER_ID)
254
254
  print("Details:", details)
255
-
255
+
256
256
  except PayraSDKException as e:
257
257
  print(f"Payra SDK error: {e}")
258
258
  except Exception as e:
@@ -262,14 +262,14 @@ except Exception as e:
262
262
  #### Behind the Scenes
263
263
 
264
264
  1. The backend initializes a `PayraOrderService` object for the desired blockchain network.
265
- 2. It calls `get_details(order_id)` to check if the order transaction exists and is confirmed on-chain.
265
+ 2. It calls `get_details(order_id)` to get transaction details from blockchain.
266
266
  3. The function returns a dictionary with:
267
267
 
268
268
  ```python
269
269
  {
270
270
  "success": True,
271
271
  "paid": True,
272
- "error": None.
272
+ "error": None,
273
273
  "toke": '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
274
274
  "amount": 400000,
275
275
  "fee": 3600,
@@ -316,7 +316,7 @@ except Exception as e:
316
316
  #### Behind the Scenes
317
317
 
318
318
  1. The backend initializes a `PayraOrderService` object for the desired blockchain network.
319
- 2. It calls `is_order_paid(order_id)` to check if the order transaction exists and is confirmed on-chain.
319
+ 2. It calls `is_paid(order_id)` to check if the order transaction exists and is confirmed on-chain.
320
320
  3. The function returns a dictionary with:
321
321
  ```python
322
322
  {
@@ -367,17 +367,16 @@ You can run the included `examples` to test signing and verification:
367
367
  ```python
368
368
  python3 example_signature.py
369
369
  python3 example_order_get_details.py
370
- python3 example_order_is_paid
370
+ python3 example_order_is_paid.py
371
371
  python3 example_utils.py
372
372
  ```
373
373
 
374
374
  Make sure your `.env` file contains correct values for the `network` being used.
375
375
 
376
- ### Tips
376
+ ## Security Notice
377
377
 
378
- - Always verify your `.env` configuration before running any signing or on-chain verification examples.
379
- - The SDK examples are safe to run, they use **read-only RPC calls** (no real transactions are broadcast).
380
- - You can modify `example_signature.py` to test custom token addresses or order parameters.
378
+ Never expose your signature key in frontend or client-side code.
379
+ This SDK is **server-side only** and must be used securely on your backend. Never use it in frontend or browser environments. Also, never commit your `.env` file to version control.
381
380
 
382
381
  ## Projects
383
382
 
@@ -400,4 +399,5 @@ Make sure your `.env` file contains correct values for the `network` being used.
400
399
  - [Dev.to](https://dev.to/payracash)
401
400
 
402
401
  ## License
402
+
403
403
  MIT © [Payra](https://payra.cash)
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "payra_sdk"
5
- version = "1.2.7"
5
+ version = "1.2.8"
6
6
  description = "Python SDK for Payra payment signature generation (backend)"
7
7
  readme = "README.md"
8
8
  authors = [{ name = "Wraith", email = "support@payra.cash" }]
File without changes
File without changes
File without changes
File without changes
File without changes