@smartsoft001/trans-shell-app-services 2.184.0 → 2.185.0
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
CHANGED
|
@@ -30,3 +30,11 @@ Methods:
|
|
|
30
30
|
<td>Retrieves a transaction by its ID from the repository.</td>
|
|
31
31
|
</tr>
|
|
32
32
|
</table>
|
|
33
|
+
|
|
34
|
+
## ⚠️ Internal service and payment amounts
|
|
35
|
+
|
|
36
|
+
`TransService.create` charges only the `amount` your internal service approves. Register a provider
|
|
37
|
+
under `TRANS_TOKEN_INTERNAL_SERVICE` whose `create` returns `{ amount }` (a positive integer in minor
|
|
38
|
+
units), or set `internalApiUrl` to a back end whose response contains `amount`. With neither, the
|
|
39
|
+
built-in fallback makes no request and `create` rejects with `DomainValidationError`, so no payment
|
|
40
|
+
can be created in that offline mode. Refreshes still work.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartsoft001/trans-shell-app-services",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.185.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"@nestjs/axios": "^4.0.1",
|
|
23
23
|
"@nestjs/common": "^11.1.5",
|
|
24
24
|
"@nestjs/core": "^11.2.1",
|
|
25
|
-
"@smartsoft001/domain-core": "2.
|
|
26
|
-
"@smartsoft001/paynow": "2.
|
|
27
|
-
"@smartsoft001/paypal": "2.
|
|
28
|
-
"@smartsoft001/payu": "2.
|
|
29
|
-
"@smartsoft001/revolut": "2.
|
|
30
|
-
"@smartsoft001/trans-domain": "2.
|
|
25
|
+
"@smartsoft001/domain-core": "2.185.0",
|
|
26
|
+
"@smartsoft001/paynow": "2.185.0",
|
|
27
|
+
"@smartsoft001/paypal": "2.185.0",
|
|
28
|
+
"@smartsoft001/payu": "2.185.0",
|
|
29
|
+
"@smartsoft001/revolut": "2.185.0",
|
|
30
|
+
"@smartsoft001/trans-domain": "2.185.0",
|
|
31
31
|
"rxjs": "^7.8.1"
|
|
32
32
|
},
|
|
33
33
|
"types": "./src/index.d.ts"
|
|
@@ -35,11 +35,10 @@ let TransService = class TransService {
|
|
|
35
35
|
}
|
|
36
36
|
_internalService = {
|
|
37
37
|
create: (trans) => {
|
|
38
|
+
// Only a back end can price an order. Without one there is no amount
|
|
39
|
+
// to charge, so a payment cannot start.
|
|
38
40
|
if (!this.config.internalApiUrl)
|
|
39
|
-
return Promise.
|
|
40
|
-
date: new Date(),
|
|
41
|
-
req: trans,
|
|
42
|
-
});
|
|
41
|
+
return Promise.reject(new domain_core_1.DomainValidationError('No internal service approves the payment amount: set internalApiUrl or provide TRANS_TOKEN_INTERNAL_SERVICE'));
|
|
43
42
|
return (0, rxjs_1.firstValueFrom)(this.httpService.post(this.config.internalApiUrl, trans)).then((res) => res.data);
|
|
44
43
|
},
|
|
45
44
|
refresh: (trans) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trans.service.js","sourceRoot":"","sources":["../../../../../../../../../packages/trans/shell/app-services/src/lib/services/trans/trans.service.ts"],"names":[],"mappings":";;;;AAAA,yCAA4C;AAC5C,2CAAsD;AACtD,uCAAyC;AACzC,+BAAsC;AAEtC,
|
|
1
|
+
{"version":3,"file":"trans.service.js","sourceRoot":"","sources":["../../../../../../../../../packages/trans/shell/app-services/src/lib/services/trans/trans.service.ts"],"names":[],"mappings":";;;;AAAA,yCAA4C;AAC5C,2CAAsD;AACtD,uCAAyC;AACzC,+BAAsC;AAEtC,2DAGmC;AACnC,iDAAqD;AACrD,iDAAqD;AACrD,6CAAiD;AACjD,mDAAuD;AACvD,6DASoC;AAEpC,mEAA4E;AAGrE,IAAM,YAAY,GAAlB,MAAM,YAAY;IA8Cb;IACA;IACA;IACA;IACA;IACA;IACA;IACY;IACA;IACA;IAC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