@bloque/payments 0.0.3 → 0.0.4
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.
- package/README.md +5 -5
- package/dist/client.d.ts +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/package.json +2 -15
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ import { Bloque, type PaymentSubmitPayload } from '@bloque/payments';
|
|
|
24
24
|
// Initialize the SDK (server-side only)
|
|
25
25
|
const bloque = new Bloque({
|
|
26
26
|
apiKey: process.env.BLOQUE_API_KEY!,
|
|
27
|
-
|
|
27
|
+
mode: 'production', // or 'sandbox' for testing
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
app.post('/api/payments', async (req, res) => {
|
|
@@ -52,7 +52,7 @@ import { Bloque } from '@bloque/payments';
|
|
|
52
52
|
|
|
53
53
|
const bloque = new Bloque({
|
|
54
54
|
apiKey: 'your-api-key-here', // Required: Your Bloque API key
|
|
55
|
-
|
|
55
|
+
mode: 'sandbox', // Required: 'sandbox' or 'production'
|
|
56
56
|
});
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -251,7 +251,7 @@ You can set the webhook secret during SDK initialization:
|
|
|
251
251
|
```typescript
|
|
252
252
|
const bloque = new Bloque({
|
|
253
253
|
apiKey: process.env.BLOQUE_API_KEY!,
|
|
254
|
-
|
|
254
|
+
mode: 'production',
|
|
255
255
|
webhookSecret: process.env.BLOQUE_WEBHOOK_SECRET,
|
|
256
256
|
});
|
|
257
257
|
|
|
@@ -277,7 +277,7 @@ import { Bloque, type PaymentSubmitPayload } from '@bloque/payments';
|
|
|
277
277
|
// Initialize SDK with your API key
|
|
278
278
|
const bloque = new Bloque({
|
|
279
279
|
apiKey: process.env.BLOQUE_API_KEY!,
|
|
280
|
-
|
|
280
|
+
mode: 'production',
|
|
281
281
|
});
|
|
282
282
|
|
|
283
283
|
// API endpoint handler
|
|
@@ -408,7 +408,7 @@ import { Bloque } from '@bloque/payments';
|
|
|
408
408
|
// Initialize SDK with webhook secret
|
|
409
409
|
const bloque = new Bloque({
|
|
410
410
|
apiKey: process.env.BLOQUE_API_KEY!,
|
|
411
|
-
|
|
411
|
+
mode: 'production',
|
|
412
412
|
webhookSecret: process.env.BLOQUE_WEBHOOK_SECRET,
|
|
413
413
|
});
|
|
414
414
|
|
package/dist/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CheckoutResource } from './resources/checkout';
|
|
|
2
2
|
import { PaymentResource } from './resources/payment';
|
|
3
3
|
import { WebhookResource } from './resources/webhook';
|
|
4
4
|
export type BloqueConfig = {
|
|
5
|
-
|
|
5
|
+
mode: 'sandbox' | 'production';
|
|
6
6
|
apiKey: string;
|
|
7
7
|
timeout?: number;
|
|
8
8
|
maxRetries?: number;
|
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -26,7 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
Bloque: ()=>Bloque
|
|
28
28
|
});
|
|
29
|
-
var package_namespaceObject = JSON.parse('{"UU":"@bloque/payments","rE":"0.0.
|
|
29
|
+
var package_namespaceObject = JSON.parse('{"UU":"@bloque/payments","rE":"0.0.4"}');
|
|
30
30
|
class BloqueError extends Error {
|
|
31
31
|
constructor(message){
|
|
32
32
|
super(message);
|
|
@@ -321,7 +321,7 @@ class Bloque {
|
|
|
321
321
|
if (!config.apiKey) throw new Error('API key is required');
|
|
322
322
|
this.#config = config;
|
|
323
323
|
this.#httpClient = new HttpClient({
|
|
324
|
-
baseURL: 'sandbox' === this.#config.
|
|
324
|
+
baseURL: 'sandbox' === this.#config.mode ? 'https://dev.bloque.app/api/payments' : 'https://api.bloque.app/api/payments',
|
|
325
325
|
apiKey: this.#config.apiKey,
|
|
326
326
|
timeout: this.#config.timeout,
|
|
327
327
|
maxRetries: this.#config.maxRetries
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHmac } from "node:crypto";
|
|
2
|
-
var package_namespaceObject = JSON.parse('{"UU":"@bloque/payments","rE":"0.0.
|
|
2
|
+
var package_namespaceObject = JSON.parse('{"UU":"@bloque/payments","rE":"0.0.4"}');
|
|
3
3
|
class BloqueError extends Error {
|
|
4
4
|
constructor(message){
|
|
5
5
|
super(message);
|
|
@@ -293,7 +293,7 @@ class Bloque {
|
|
|
293
293
|
if (!config.apiKey) throw new Error('API key is required');
|
|
294
294
|
this.#config = config;
|
|
295
295
|
this.#httpClient = new HttpClient({
|
|
296
|
-
baseURL: 'sandbox' === this.#config.
|
|
296
|
+
baseURL: 'sandbox' === this.#config.mode ? 'https://dev.bloque.app/api/payments' : 'https://api.bloque.app/api/payments',
|
|
297
297
|
apiKey: this.#config.apiKey,
|
|
298
298
|
timeout: this.#config.timeout,
|
|
299
299
|
maxRetries: this.#config.maxRetries
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloque/payments",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Official Bloque SDK for creating and managing payments and checkouts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -36,20 +36,7 @@
|
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=22"
|
|
38
38
|
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "rslib build",
|
|
41
|
-
"dev": "rslib build --watch",
|
|
42
|
-
"clean": "rm -rf node_modules && rm -rf dist",
|
|
43
|
-
"check": "biome check --write",
|
|
44
|
-
"typecheck": "tsgo --noEmit"
|
|
45
|
-
},
|
|
46
39
|
"dependencies": {
|
|
47
|
-
"@bloque/payments-core": "
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@rslib/core": "catalog:",
|
|
51
|
-
"@types/node": "catalog:",
|
|
52
|
-
"@typescript/native-preview": "catalog:",
|
|
53
|
-
"typescript": "catalog:"
|
|
40
|
+
"@bloque/payments-core": "0.0.4"
|
|
54
41
|
}
|
|
55
42
|
}
|