@jsdev_ninja/core 0.8.41 → 0.8.42

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.
@@ -47,12 +47,15 @@ export const HypTokenRequestSchema = z.object({
47
47
  TransId: numericTextSchema,
48
48
  //todo api key is not required???
49
49
  });
50
+ export type THypTokenRequest = z.infer<typeof HypTokenRequestSchema>;
51
+
50
52
  export const HypTokenResponseSchema = z.object({
51
53
  Id: numericTextSchema,
52
54
  Token: numericTextSchema,
53
55
  Tokef: numericTextSchema, // credit card validity date in the format YYMM
54
56
  CCode: numericTextSchema, //0 code is valid
55
57
  });
58
+ export type THypTokenResponse = z.infer<typeof HypTokenResponseSchema>;
56
59
 
57
60
  export const PayProtocolResponseSchema = PayProtocolGeneralSchema.extend({
58
61
  Id: textSchema, // transaction Id in Hypay
@@ -1,4 +1,8 @@
1
- import { TPaymentLinkRequest } from "../entities/Payment";
1
+ import {
2
+ THypSoftTransactionRequest,
3
+ THypTokenRequest,
4
+ TPaymentLinkRequest,
5
+ } from "../entities/Payment";
2
6
 
3
7
  const baseUrl = "https://pay.hyp.co.il/p/";
4
8
 
@@ -9,7 +13,7 @@ function objectToQueryParams<T extends { [key: string]: any }>(obj: T) {
9
13
  }
10
14
 
11
15
  export const hypPaymentService = {
12
- async chargeJ5Transaction(params: TPaymentLinkRequest) {
16
+ async chargeJ5Transaction(params: THypSoftTransactionRequest & THypTokenRequest) {
13
17
  try {
14
18
  const tokenParams = objectToQueryParams({});
15
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsdev_ninja/core",
3
- "version": "0.8.41",
3
+ "version": "0.8.42",
4
4
  "main": "dist/core.cjs.js",
5
5
  "module": "dist/core.es.js",
6
6
  "types": "dist/index.d.ts",