@trusted-solutions/sdit.models 0.29.0-alpha.0 → 0.30.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/base-data.d.ts +15 -15
- package/base-data.js +2 -2
- package/constants/client-endpoints.d.ts +7 -7
- package/constants/client-endpoints.js +10 -10
- package/constants/district-zip.taiwan.d.ts +7 -7
- package/constants/district-zip.taiwan.js +499 -499
- package/constants/index.d.ts +3 -3
- package/constants/index.js +6 -6
- package/constants/industry.d.ts +4 -4
- package/constants/industry.js +27 -27
- package/data-service/config.d.ts +62 -62
- package/data-service/config.js +895 -895
- package/data-service/enum.d.ts +82 -82
- package/data-service/enum.js +101 -101
- package/data-service/index.d.ts +4 -4
- package/data-service/index.js +7 -7
- package/data-service/lambda.d.ts +92 -92
- package/data-service/lambda.js +3 -3
- package/data-service/model.d.ts +79 -79
- package/data-service/model.js +190 -190
- package/enums/analysis.d.ts +201 -201
- package/enums/analysis.js +213 -213
- package/enums/block-storage.d.ts +4 -4
- package/enums/block-storage.js +8 -8
- package/enums/close-type.d.ts +4 -4
- package/enums/close-type.js +8 -8
- package/enums/cognito-filter-key.d.ts +14 -14
- package/enums/cognito-filter-key.js +19 -19
- package/enums/cognito-operator.d.ts +4 -4
- package/enums/cognito-operator.js +8 -8
- package/enums/company.d.ts +4 -4
- package/enums/company.js +8 -8
- package/enums/customer.d.ts +23 -23
- package/enums/customer.js +29 -29
- package/enums/discount-module.d.ts +18 -18
- package/enums/discount-module.js +27 -27
- package/enums/dynamodb-operator.d.ts +66 -66
- package/enums/dynamodb-operator.js +77 -77
- package/enums/error-type.d.ts +109 -109
- package/enums/error-type.js +145 -145
- package/enums/event.d.ts +29 -29
- package/enums/event.js +36 -36
- package/enums/external.d.ts +3 -3
- package/enums/external.js +7 -7
- package/enums/filter-keys.d.ts +9 -9
- package/enums/filter-keys.js +15 -15
- package/enums/import-data.d.ts +3 -3
- package/enums/import-data.js +7 -7
- package/enums/index.d.ts +41 -41
- package/enums/index.js +44 -44
- package/enums/inventory.d.ts +7 -7
- package/enums/inventory.js +11 -11
- package/enums/invoice-carrier-type.d.ts +5 -5
- package/enums/invoice-carrier-type.js +9 -9
- package/enums/invoice-error-name.d.ts +4 -4
- package/enums/invoice-error-name.js +8 -8
- package/enums/invoice-provider.d.ts +6 -5
- package/enums/invoice-provider.js +10 -9
- package/enums/invoice-provider.js.map +1 -1
- package/enums/invoice-status-type.d.ts +4 -4
- package/enums/invoice-status-type.js +8 -8
- package/enums/invoice-type.d.ts +6 -6
- package/enums/invoice-type.js +10 -10
- package/enums/language.d.ts +4 -4
- package/enums/language.js +8 -8
- package/enums/number-of-customers-group-type.d.ts +12 -12
- package/enums/number-of-customers-group-type.js +16 -16
- package/enums/offline-sync-type.d.ts +7 -7
- package/enums/offline-sync-type.js +11 -11
- package/enums/order-action-name.d.ts +4 -4
- package/enums/order-action-name.js +8 -8
- package/enums/order-item.d.ts +13 -13
- package/enums/order-item.js +18 -18
- package/enums/order-source-type.d.ts +5 -5
- package/enums/order-source-type.js +9 -9
- package/enums/order-status.d.ts +18 -18
- package/enums/order-status.js +22 -22
- package/enums/payment-parameters.d.ts +18 -18
- package/enums/payment-parameters.js +25 -25
- package/enums/payment-service-provider.d.ts +28 -28
- package/enums/payment-service-provider.js +32 -32
- package/enums/payment-type.d.ts +35 -35
- package/enums/payment-type.js +39 -39
- package/enums/permission-name.d.ts +30 -30
- package/enums/permission-name.js +34 -34
- package/enums/printer.d.ts +57 -57
- package/enums/printer.js +68 -68
- package/enums/real-time-switch-type.d.ts +8 -8
- package/enums/real-time-switch-type.js +12 -12
- package/enums/receipt.d.ts +4 -4
- package/enums/receipt.js +8 -8
- package/enums/serve-type.d.ts +6 -6
- package/enums/serve-type.js +10 -10
- package/enums/server-error.d.ts +4 -4
- package/enums/server-error.js +8 -8
- package/enums/store.d.ts +15 -15
- package/enums/store.js +21 -21
- package/enums/table-index.d.ts +25 -25
- package/enums/table-index.js +32 -32
- package/enums/table.d.ts +6 -6
- package/enums/table.js +10 -10
- package/enums/tax-type.d.ts +5 -5
- package/enums/tax-type.js +9 -9
- package/enums/user.d.ts +8 -8
- package/enums/user.js +13 -13
- package/lambda/contract.d.ts +97 -97
- package/lambda/contract.js +2 -2
- package/lambda/error/create-order-when-item-sold-out.d.ts +6 -6
- package/lambda/error/create-order-when-item-sold-out.js +2 -2
- package/lambda/error/index.d.ts +1 -1
- package/lambda/error/index.js +4 -4
- package/lambda/index.d.ts +10 -10
- package/lambda/index.js +13 -13
- package/lambda/line-notify.d.ts +8 -8
- package/lambda/line-notify.js +4 -4
- package/lambda/online-integration.d.ts +110 -110
- package/lambda/online-integration.js +2 -2
- package/lambda/online-ordering.d.ts +290 -290
- package/lambda/online-ordering.js +2 -2
- package/lambda/override.d.ts +23 -23
- package/lambda/override.js +2 -2
- package/lambda/pos-integration.d.ts +19 -19
- package/lambda/pos-integration.js +2 -2
- package/lambda/request/analysis.d.ts +4 -4
- package/lambda/request/analysis.js +2 -2
- package/lambda/request/chain.d.ts +30 -30
- package/lambda/request/chain.js +2 -2
- package/lambda/request/closing.d.ts +64 -64
- package/lambda/request/closing.js +2 -2
- package/lambda/request/common.d.ts +19 -19
- package/lambda/request/common.js +2 -2
- package/lambda/request/custom-analysis-group.d.ts +19 -19
- package/lambda/request/custom-analysis-group.js +2 -2
- package/lambda/request/customer.d.ts +19 -19
- package/lambda/request/customer.js +2 -2
- package/lambda/request/discount-module.d.ts +50 -50
- package/lambda/request/discount-module.js +2 -2
- package/lambda/request/event.d.ts +9 -9
- package/lambda/request/event.js +2 -2
- package/lambda/request/import-data.d.ts +15 -15
- package/lambda/request/import-data.js +2 -2
- package/lambda/request/index.d.ts +20 -20
- package/lambda/request/index.js +23 -23
- package/lambda/request/invoice.d.ts +96 -93
- package/lambda/request/invoice.js +2 -2
- package/lambda/request/kiosk.d.ts +15 -15
- package/lambda/request/kiosk.js +2 -2
- package/lambda/request/menu.d.ts +89 -89
- package/lambda/request/menu.js +2 -2
- package/lambda/request/offline-sync.d.ts +33 -33
- package/lambda/request/offline-sync.js +2 -2
- package/lambda/request/order.d.ts +49 -49
- package/lambda/request/order.js +2 -2
- package/lambda/request/payment.d.ts +19 -19
- package/lambda/request/payment.js +2 -2
- package/lambda/request/printer.d.ts +42 -42
- package/lambda/request/printer.js +2 -2
- package/lambda/request/real-time-switch.d.ts +33 -33
- package/lambda/request/real-time-switch.js +2 -2
- package/lambda/request/receipt.d.ts +5 -5
- package/lambda/request/receipt.js +2 -2
- package/lambda/request/store.d.ts +77 -77
- package/lambda/request/store.js +2 -2
- package/lambda/request/user.d.ts +29 -29
- package/lambda/request/user.js +2 -2
- package/lambda/response/analysis.d.ts +4 -4
- package/lambda/response/analysis.js +2 -2
- package/lambda/response/chain.d.ts +14 -14
- package/lambda/response/chain.js +2 -2
- package/lambda/response/closing.d.ts +14 -14
- package/lambda/response/closing.js +3 -3
- package/lambda/response/common.d.ts +15 -15
- package/lambda/response/common.js +2 -2
- package/lambda/response/custom-analysis-group.d.ts +14 -14
- package/lambda/response/custom-analysis-group.js +7 -7
- package/lambda/response/customer.d.ts +12 -12
- package/lambda/response/customer.js +2 -2
- package/lambda/response/discount-module.d.ts +28 -28
- package/lambda/response/discount-module.js +2 -2
- package/lambda/response/event.d.ts +4 -4
- package/lambda/response/event.js +2 -2
- package/lambda/response/index.d.ts +17 -17
- package/lambda/response/index.js +20 -20
- package/lambda/response/invoice.d.ts +34 -34
- package/lambda/response/invoice.js +2 -2
- package/lambda/response/kiosk.d.ts +12 -12
- package/lambda/response/kiosk.js +2 -2
- package/lambda/response/menu.d.ts +54 -54
- package/lambda/response/menu.js +2 -2
- package/lambda/response/order.d.ts +20 -20
- package/lambda/response/order.js +2 -2
- package/lambda/response/payment.d.ts +199 -199
- package/lambda/response/payment.js +2 -2
- package/lambda/response/printer.d.ts +22 -22
- package/lambda/response/printer.js +2 -2
- package/lambda/response/receipt.d.ts +4 -4
- package/lambda/response/receipt.js +2 -2
- package/lambda/response/store.d.ts +38 -38
- package/lambda/response/store.js +2 -2
- package/lambda/response/user.d.ts +17 -17
- package/lambda/response/user.js +2 -2
- package/lambda/subscription.d.ts +141 -141
- package/lambda/subscription.js +9 -9
- package/models/analysis-summary.d.ts +23 -23
- package/models/analysis-summary.js +2 -2
- package/models/analysis.d.ts +56 -56
- package/models/analysis.js +2 -2
- package/models/appointment.d.ts +18 -18
- package/models/appointment.js +2 -2
- package/models/array-mutations.d.ts +8 -8
- package/models/array-mutations.js +2 -2
- package/models/chain.d.ts +5 -5
- package/models/chain.js +2 -2
- package/models/cognito-filters.d.ts +21 -21
- package/models/cognito-filters.js +2 -2
- package/models/contract.d.ts +31 -31
- package/models/contract.js +2 -2
- package/models/csv/customer.d.ts +18 -18
- package/models/csv/customer.js +2 -2
- package/models/csv/index.d.ts +1 -1
- package/models/csv/index.js +4 -4
- package/models/custom-analysis-group.d.ts +5 -5
- package/models/custom-analysis-group.js +2 -2
- package/models/customer.d.ts +33 -33
- package/models/customer.js +2 -2
- package/models/discount-module/bundle-discount-module.d.ts +9 -9
- package/models/discount-module/bundle-discount-module.js +2 -2
- package/models/discount-module/discount-module.d.ts +92 -92
- package/models/discount-module/discount-module.js +2 -2
- package/models/discount-module/entire-order-discount-module.d.ts +6 -6
- package/models/discount-module/entire-order-discount-module.js +2 -2
- package/models/discount-module/index.d.ts +3 -3
- package/models/discount-module/index.js +6 -6
- package/models/discount-module/selected-item-discount-module.d.ts +9 -9
- package/models/discount-module/selected-item-discount-module.js +2 -2
- package/models/dynamodb-filters.d.ts +37 -37
- package/models/dynamodb-filters.js +2 -2
- package/models/dynamodb-index.d.ts +19 -19
- package/models/dynamodb-index.js +2 -2
- package/models/error/index.d.ts +11 -11
- package/models/error/index.js +6 -6
- package/models/error/invoice.d.ts +3 -3
- package/models/error/invoice.js +11 -11
- package/models/error/order.d.ts +17 -17
- package/models/error/order.js +42 -42
- package/models/error/store.d.ts +6 -6
- package/models/error/store.js +18 -18
- package/models/event.d.ts +13 -13
- package/models/event.js +2 -2
- package/models/external-config.d.ts +10 -10
- package/models/external-config.js +2 -2
- package/models/filter-request.d.ts +13 -13
- package/models/filter-request.js +2 -2
- package/models/index.d.ts +40 -40
- package/models/index.js +43 -43
- package/models/inventory/index.d.ts +5 -5
- package/models/inventory/index.js +8 -8
- package/models/inventory/inventory-item-record.d.ts +52 -52
- package/models/inventory/inventory-item-record.js +2 -2
- package/models/inventory/inventory-item.d.ts +38 -38
- package/models/inventory/inventory-item.js +2 -2
- package/models/inventory/inventory-record.d.ts +40 -40
- package/models/inventory/inventory-record.js +2 -2
- package/models/inventory/inventory.d.ts +23 -23
- package/models/inventory/inventory.js +2 -2
- package/models/inventory/relation.d.ts +17 -17
- package/models/inventory/relation.js +2 -2
- package/models/invoice-config.d.ts +25 -14
- package/models/invoice-config.js +2 -2
- package/models/invoice.d.ts +83 -83
- package/models/invoice.js +2 -2
- package/models/json/base-json.d.ts +3 -3
- package/models/json/base-json.js +2 -2
- package/models/json/index.d.ts +2 -2
- package/models/json/index.js +5 -5
- package/models/json/product-json.d.ts +16 -16
- package/models/json/product-json.js +2 -2
- package/models/kiosk.d.ts +4 -4
- package/models/kiosk.js +2 -2
- package/models/language.d.ts +8 -8
- package/models/language.js +2 -2
- package/models/menu.d.ts +111 -111
- package/models/menu.js +10 -10
- package/models/online-integration.d.ts +88 -88
- package/models/online-integration.js +59 -59
- package/models/online-ordering.d.ts +253 -253
- package/models/online-ordering.js +43 -43
- package/models/order-action.d.ts +11 -11
- package/models/order-action.js +2 -2
- package/models/order.d.ts +451 -451
- package/models/order.js +2 -2
- package/models/override.d.ts +28 -28
- package/models/override.js +14 -14
- package/models/payment-config.d.ts +69 -69
- package/models/payment-config.js +2 -2
- package/models/payment-parameters.d.ts +116 -116
- package/models/payment-parameters.js +3 -3
- package/models/payment.d.ts +42 -42
- package/models/payment.js +2 -2
- package/models/permission/index.d.ts +4 -4
- package/models/permission/index.js +7 -7
- package/models/permission/store-permission.d.ts +9 -9
- package/models/permission/store-permission.js +2 -2
- package/models/permission/store-role-store-permission.d.ts +5 -5
- package/models/permission/store-role-store-permission.js +2 -2
- package/models/permission/store-role-store-user.d.ts +5 -5
- package/models/permission/store-role-store-user.js +2 -2
- package/models/permission/store-role.d.ts +5 -5
- package/models/permission/store-role.js +2 -2
- package/models/plugin/index.d.ts +5 -5
- package/models/plugin/index.js +8 -8
- package/models/plugin/intent-handler/index.d.ts +2 -2
- package/models/plugin/intent-handler/index.js +5 -5
- package/models/plugin/intent-handler/intent-handler-request.d.ts +14 -14
- package/models/plugin/intent-handler/intent-handler-request.js +2 -2
- package/models/plugin/intent-handler/intent-handler-response.d.ts +7 -7
- package/models/plugin/intent-handler/intent-handler-response.js +2 -2
- package/models/plugin/payment-machine/index.d.ts +3 -3
- package/models/plugin/payment-machine/index.js +6 -6
- package/models/plugin/payment-machine/models/fixed-string.model.d.ts +14 -14
- package/models/plugin/payment-machine/models/fixed-string.model.js +52 -52
- package/models/plugin/payment-machine/models/index.d.ts +5 -5
- package/models/plugin/payment-machine/models/index.js +8 -8
- package/models/plugin/payment-machine/models/nccc/index.d.ts +3 -3
- package/models/plugin/payment-machine/models/nccc/index.js +6 -6
- package/models/plugin/payment-machine/models/nccc/payment-machine-d200.model.d.ts +41 -41
- package/models/plugin/payment-machine/models/nccc/payment-machine-d200.model.js +140 -140
- package/models/plugin/payment-machine/models/nccc/payment-machine-v3p.model.d.ts +42 -42
- package/models/plugin/payment-machine/models/nccc/payment-machine-v3p.model.js +621 -621
- package/models/plugin/payment-machine/models/nccc/payment-machine-vx520.model.d.ts +21 -21
- package/models/plugin/payment-machine/models/nccc/payment-machine-vx520.model.js +28 -28
- package/models/plugin/payment-machine/models/payment-machine-minimum.model.d.ts +38 -38
- package/models/plugin/payment-machine/models/payment-machine-minimum.model.js +27 -27
- package/models/plugin/payment-machine/models/payment-machine-union.model.d.ts +123 -123
- package/models/plugin/payment-machine/models/payment-machine-union.model.js +376 -376
- package/models/plugin/payment-machine/models/tsb/index.d.ts +1 -1
- package/models/plugin/payment-machine/models/tsb/index.js +4 -4
- package/models/plugin/payment-machine/models/tsb/payment-machine-d220.model.d.ts +20 -20
- package/models/plugin/payment-machine/models/tsb/payment-machine-d220.model.js +27 -27
- package/models/plugin/payment-machine/payment-machine-request.d.ts +8 -8
- package/models/plugin/payment-machine/payment-machine-request.js +2 -2
- package/models/plugin/payment-machine/payment-machine.d.ts +43 -43
- package/models/plugin/payment-machine/payment-machine.js +50 -50
- package/models/plugin/peripheral.model.d.ts +53 -53
- package/models/plugin/peripheral.model.js +38 -38
- package/models/plugin/printer/index.d.ts +2 -2
- package/models/plugin/printer/index.js +5 -5
- package/models/plugin/printer/printer-request.d.ts +20 -20
- package/models/plugin/printer/printer-request.js +2 -2
- package/models/plugin/printer/printer.d.ts +92 -92
- package/models/plugin/printer/printer.js +11 -11
- package/models/plugin/serial-port/index.d.ts +2 -2
- package/models/plugin/serial-port/index.js +5 -5
- package/models/plugin/serial-port/serial-port-request.d.ts +11 -11
- package/models/plugin/serial-port/serial-port-request.js +2 -2
- package/models/plugin/serial-port/serial-port.d.ts +17 -17
- package/models/plugin/serial-port/serial-port.js +22 -22
- package/models/printer.d.ts +70 -70
- package/models/printer.js +2 -2
- package/models/receipt.d.ts +61 -61
- package/models/receipt.js +2 -2
- package/models/store.d.ts +251 -250
- package/models/store.js +3 -3
- package/models/table.d.ts +35 -35
- package/models/table.js +9 -9
- package/models/template-interface/index.d.ts +1 -1
- package/models/template-interface/index.js +4 -4
- package/models/template-interface/list.d.ts +10 -10
- package/models/template-interface/list.js +2 -2
- package/models/user.d.ts +31 -31
- package/models/user.js +2 -2
- package/models/utils/index.d.ts +1 -1
- package/models/utils/index.js +4 -4
- package/models/utils/utils-data.d.ts +4 -4
- package/models/utils/utils-data.js +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +5 -5
- package/public-api.js +8 -8
- package/third-party-api/uber-eats/enums/ub-menu.d.ts +24 -24
- package/third-party-api/uber-eats/enums/ub-menu.js +32 -32
- package/third-party-api/uber-eats/enums/ub-order.d.ts +55 -55
- package/third-party-api/uber-eats/enums/ub-order.js +66 -66
- package/third-party-api/uber-eats/enums/ub-utils.d.ts +34 -34
- package/third-party-api/uber-eats/enums/ub-utils.js +40 -40
- package/third-party-api/uber-eats/index.d.ts +13 -13
- package/third-party-api/uber-eats/index.js +16 -16
- package/third-party-api/uber-eats/models/ub-cancel-order.d.ts +28 -28
- package/third-party-api/uber-eats/models/ub-cancel-order.js +17 -17
- package/third-party-api/uber-eats/models/ub-cart.d.ts +84 -84
- package/third-party-api/uber-eats/models/ub-cart.js +2 -2
- package/third-party-api/uber-eats/models/ub-menu-config.d.ts +40 -40
- package/third-party-api/uber-eats/models/ub-menu-config.js +2 -2
- package/third-party-api/uber-eats/models/ub-menu-item.d.ts +112 -112
- package/third-party-api/uber-eats/models/ub-menu-item.js +2 -2
- package/third-party-api/uber-eats/models/ub-order.d.ts +59 -59
- package/third-party-api/uber-eats/models/ub-order.js +2 -2
- package/third-party-api/uber-eats/models/ub-payment.d.ts +59 -59
- package/third-party-api/uber-eats/models/ub-payment.js +2 -2
- package/third-party-api/uber-eats/models/ub-pos-accept-order.d.ts +39 -39
- package/third-party-api/uber-eats/models/ub-pos-accept-order.js +2 -2
- package/third-party-api/uber-eats/models/ub-pos-deny-order.d.ts +29 -29
- package/third-party-api/uber-eats/models/ub-pos-deny-order.js +17 -17
- package/third-party-api/uber-eats/models/ub-quantity-constraint-rules.d.ts +48 -48
- package/third-party-api/uber-eats/models/ub-quantity-constraint-rules.js +2 -2
- package/third-party-api/uber-eats/models/ub-utils.d.ts +41 -41
- package/third-party-api/uber-eats/models/ub-utils.js +2 -2
|
@@ -1,622 +1,622 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RetryDataNCCCV3P = exports.SettlementDataNCCCV3P = exports.RefundDataNCCCV3P = exports.PayDataNCCCV3P = void 0;
|
|
4
|
-
const payment_machine_union_model_1 = require("../payment-machine-union.model");
|
|
5
|
-
const fixed_string_model_1 = require("../fixed-string.model");
|
|
6
|
-
const payment_machine_1 = require("../../payment-machine");
|
|
7
|
-
/**
|
|
8
|
-
* @Deprecated - Please import from HAL
|
|
9
|
-
*/
|
|
10
|
-
class PayDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
11
|
-
// D220
|
|
12
|
-
// VID: 4660,0x1234
|
|
13
|
-
// PID: 0257,0x0101
|
|
14
|
-
// V3P 轉接線
|
|
15
|
-
// VID: 0x0403
|
|
16
|
-
// PID: 0x6001
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
}
|
|
20
|
-
transformDataForRequest(data) {
|
|
21
|
-
this.paymentCardType = data.paymentCardType;
|
|
22
|
-
this.totalAmount = data.totalAmount;
|
|
23
|
-
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
24
|
-
}
|
|
25
|
-
transformDataForResponse(data) {
|
|
26
|
-
if (!data) {
|
|
27
|
-
this.isSuccess = false;
|
|
28
|
-
this.retry = true;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
//#region Set fields: NCCC/V3P response to TNect
|
|
32
|
-
// 1-5
|
|
33
|
-
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
34
|
-
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
35
|
-
this.transTypeIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
36
|
-
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
37
|
-
this.StringToTradeType(this.transType);
|
|
38
|
-
this.cUPSmartPayESVCIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
39
|
-
// 6-10
|
|
40
|
-
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
41
|
-
this.StringToPaymentCardType(this.cUPSmartPayESVCIndicator, this.hostId);
|
|
42
|
-
this.receiptNo = new fixed_string_model_1.FixedString().FromLongString(data, 13, 6).TrimmedValue;
|
|
43
|
-
this.cardNo = new fixed_string_model_1.FixedString().FromLongString(data, 19, 19).TrimmedValue;
|
|
44
|
-
this.cardExpireDate = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).TrimmedValue;
|
|
45
|
-
this.totalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
46
|
-
// 11-15
|
|
47
|
-
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
48
|
-
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
49
|
-
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
50
|
-
this.creditCardApprovalNo = new fixed_string_model_1.FixedString().FromLongString(data, 66, 9).TrimmedValue;
|
|
51
|
-
this.waveCardContactlessIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 75, 1).TrimmedValue;
|
|
52
|
-
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
53
|
-
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
54
|
-
// 16-20
|
|
55
|
-
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
56
|
-
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
57
|
-
this.expAmount = new fixed_string_model_1.FixedString().FromLongString(data, 103, 12).TrimmedValue;
|
|
58
|
-
this.storeId = new fixed_string_model_1.FixedString().FromLongString(data, 115, 18).TrimmedValue;
|
|
59
|
-
this.installmentRedeemIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 133, 1).TrimmedValue;
|
|
60
|
-
// 21-25
|
|
61
|
-
this.redeemPaidAmt = new fixed_string_model_1.FixedString().FromLongString(data, 134, 12).TrimmedValue;
|
|
62
|
-
this.redeemPoint = new fixed_string_model_1.FixedString().FromLongString(data, 146, 8).TrimmedValue;
|
|
63
|
-
this.pointsOfBalance = new fixed_string_model_1.FixedString().FromLongString(data, 154, 8).TrimmedValue;
|
|
64
|
-
this.redeemAmt = new fixed_string_model_1.FixedString().FromLongString(data, 162, 12).TrimmedValue;
|
|
65
|
-
this.installmentPeriod = new fixed_string_model_1.FixedString().FromLongString(data, 174, 2).TrimmedValue;
|
|
66
|
-
// 26-30
|
|
67
|
-
this.eTicketBalanceBeforeTrade = new fixed_string_model_1.FixedString().FromLongString(data, 176, 12).ValueAsDouble / 100;
|
|
68
|
-
this.eTicketBalanceAfterTrade = new fixed_string_model_1.FixedString().FromLongString(data, 188, 12).ValueAsDouble / 100;
|
|
69
|
-
this.eTicketChargeAmount = new fixed_string_model_1.FixedString().FromLongString(data, 200, 12).ValueAsDouble / 100;
|
|
70
|
-
this.cardType = new fixed_string_model_1.FixedString().FromLongString(data, 212, 2).TrimmedValue;
|
|
71
|
-
this.StringToPaymentCardDetailedType(this.cardType);
|
|
72
|
-
this.batchNo = new fixed_string_model_1.FixedString().FromLongString(data, 214, 6).TrimmedValue;
|
|
73
|
-
// 31-35
|
|
74
|
-
this.startTransType = new fixed_string_model_1.FixedString().FromLongString(data, 220, 2).TrimmedValue;
|
|
75
|
-
this.mPFlag = new fixed_string_model_1.FixedString().FromLongString(data, 222, 1).TrimmedValue;
|
|
76
|
-
this.sPIssuerId = new fixed_string_model_1.FixedString().FromLongString(data, 223, 8).TrimmedValue;
|
|
77
|
-
this.targetTradeTime = new fixed_string_model_1.FixedString().FromLongString(data, 231, 8).TrimmedValue;
|
|
78
|
-
this.StringToTargetTradeUnixTime(this.targetTradeTime);
|
|
79
|
-
this.aTSETicketTransactionId = new fixed_string_model_1.FixedString().FromLongString(data, 239, 12).TrimmedValue;
|
|
80
|
-
this.StringToTransactionId(this.creditCardApprovalNo, this.aTSETicketTransactionId);
|
|
81
|
-
// 36-40
|
|
82
|
-
this.payItem = new fixed_string_model_1.FixedString().FromLongString(data, 251, 5).TrimmedValue;
|
|
83
|
-
this.cardNoHashValue = new fixed_string_model_1.FixedString().FromLongString(data, 256, 50).TrimmedValue;
|
|
84
|
-
this.mPResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 306, 6).TrimmedValue;
|
|
85
|
-
this.aSMAwardFlag = new fixed_string_model_1.FixedString().FromLongString(data, 312, 1).TrimmedValue;
|
|
86
|
-
this.mCPIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 313, 1).TrimmedValue;
|
|
87
|
-
// 41-43
|
|
88
|
-
this.bankCodeList = new fixed_string_model_1.FixedString().FromLongString(data, 314, 3).TrimmedValue;
|
|
89
|
-
this.reserved5 = new fixed_string_model_1.FixedString().FromLongString(data, 317, 5).TrimmedValue;
|
|
90
|
-
this.hGData = new fixed_string_model_1.FixedString().FromLongString(data, 322, 78).TrimmedValue;
|
|
91
|
-
//#endregion
|
|
92
|
-
}
|
|
93
|
-
ToString() {
|
|
94
|
-
this.FillNCCCV3PRequest();
|
|
95
|
-
//#region Set fields: TNect to NCCC/V3P request
|
|
96
|
-
const totalAmountString = (this.totalAmount * 100).toString().padStart(12, '0');
|
|
97
|
-
this.transType = this.TradeTypeToString();
|
|
98
|
-
this.cUPSmartPayESVCIndicator = this.PaymentCardTypeToStrings(false).cUPSmartPayESVCIndicator;
|
|
99
|
-
this.hostId = this.PaymentCardTypeToStrings(false).hostId;
|
|
100
|
-
this.transDate = PayDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
101
|
-
this.transTime = PayDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
102
|
-
this.targetTradeTime = PayDataNCCCV3P.ToDate(this.targetTradeUnixTime);
|
|
103
|
-
this.creditCardApprovalNo = this.TransactionIdToStrings().creditCardApprovalNo;
|
|
104
|
-
this.aTSETicketTransactionId = this.TransactionIdToStrings().aTSETicketTransactionId;
|
|
105
|
-
this.waveCardContactlessIndicator = null;
|
|
106
|
-
this.cardType = null;
|
|
107
|
-
this.eCRResponseCode = null;
|
|
108
|
-
const eTicketBalanceBeforeTradeString = null;
|
|
109
|
-
const eTicketBalanceAfterTradeString = null;
|
|
110
|
-
const eTicketChargeAmountString = null;
|
|
111
|
-
return '' +
|
|
112
|
-
// 1-5
|
|
113
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
114
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
115
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transTypeIndicator, 1).Value +
|
|
116
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
117
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cUPSmartPayESVCIndicator, 1).Value +
|
|
118
|
-
// 6-10
|
|
119
|
-
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
120
|
-
new fixed_string_model_1.FixedString().FromShortString(this.receiptNo, 6).Value +
|
|
121
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardNo, 19).Value +
|
|
122
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardExpireDate, 4).Value +
|
|
123
|
-
new fixed_string_model_1.FixedString().FromShortString(totalAmountString, 12).Value +
|
|
124
|
-
// 11-15
|
|
125
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
126
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
127
|
-
new fixed_string_model_1.FixedString().FromShortString(this.creditCardApprovalNo, 9).Value +
|
|
128
|
-
new fixed_string_model_1.FixedString().FromShortString(this.waveCardContactlessIndicator, 1).Value +
|
|
129
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
130
|
-
// 16-20
|
|
131
|
-
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
132
|
-
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
133
|
-
new fixed_string_model_1.FixedString().FromShortString(this.expAmount, 12).Value +
|
|
134
|
-
new fixed_string_model_1.FixedString().FromShortString(this.storeId, 18).Value +
|
|
135
|
-
new fixed_string_model_1.FixedString().FromShortString(this.installmentRedeemIndicator, 1).Value +
|
|
136
|
-
// 21-25
|
|
137
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemPaidAmt, 12).Value +
|
|
138
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemPoint, 8).Value +
|
|
139
|
-
new fixed_string_model_1.FixedString().FromShortString(this.pointsOfBalance, 8).Value +
|
|
140
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemAmt, 12).Value +
|
|
141
|
-
new fixed_string_model_1.FixedString().FromShortString(this.installmentPeriod, 2).Value +
|
|
142
|
-
// 26-30
|
|
143
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceBeforeTradeString, 12).Value +
|
|
144
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceAfterTradeString, 12).Value +
|
|
145
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketChargeAmountString, 12).Value +
|
|
146
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardType, 2).Value +
|
|
147
|
-
new fixed_string_model_1.FixedString().FromShortString(this.batchNo, 6).Value +
|
|
148
|
-
// 31-35
|
|
149
|
-
new fixed_string_model_1.FixedString().FromShortString(this.startTransType, 2).Value +
|
|
150
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mPFlag, 1).Value +
|
|
151
|
-
new fixed_string_model_1.FixedString().FromShortString(this.sPIssuerId, 8).Value +
|
|
152
|
-
new fixed_string_model_1.FixedString().FromShortString(this.targetTradeTime, 8).Value +
|
|
153
|
-
new fixed_string_model_1.FixedString().FromShortString(this.aTSETicketTransactionId, 12).Value +
|
|
154
|
-
// 36-40
|
|
155
|
-
new fixed_string_model_1.FixedString().FromShortString(this.payItem, 5).Value +
|
|
156
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardNoHashValue, 50).Value +
|
|
157
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mPResponseCode, 6).Value +
|
|
158
|
-
new fixed_string_model_1.FixedString().FromShortString(this.aSMAwardFlag, 1).Value +
|
|
159
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mCPIndicator, 1).Value +
|
|
160
|
-
// 41-43
|
|
161
|
-
new fixed_string_model_1.FixedString().FromShortString(this.bankCodeList, 3).Value +
|
|
162
|
-
new fixed_string_model_1.FixedString().FromShortString(this.reserved5, 5).Value +
|
|
163
|
-
new fixed_string_model_1.FixedString().FromShortString(this.hGData, 78).Value +
|
|
164
|
-
'';
|
|
165
|
-
//#endregion
|
|
166
|
-
}
|
|
167
|
-
FillNCCCV3PRequest() {
|
|
168
|
-
this.eCRIndicator = 'I';
|
|
169
|
-
this.tradeType = PayDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.pay];
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
exports.PayDataNCCCV3P = PayDataNCCCV3P;
|
|
173
|
-
/**
|
|
174
|
-
* @Deprecated - Please import from HAL
|
|
175
|
-
*/
|
|
176
|
-
class RefundDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
177
|
-
constructor() {
|
|
178
|
-
super();
|
|
179
|
-
}
|
|
180
|
-
transformDataForRequest(data) {
|
|
181
|
-
this.paymentCardType = data.paymentCardType;
|
|
182
|
-
this.totalAmount = data.totalAmount;
|
|
183
|
-
this.transactionId = data.transactionId;
|
|
184
|
-
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
185
|
-
this.targetTradeUnixTime = data.targetTradeUnixTime;
|
|
186
|
-
}
|
|
187
|
-
transformDataForResponse(data) {
|
|
188
|
-
if (!data) {
|
|
189
|
-
this.isSuccess = false;
|
|
190
|
-
this.retry = true;
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
//#region Set fields: NCCC/V3P response to TNect
|
|
194
|
-
// 1-5
|
|
195
|
-
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
196
|
-
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
197
|
-
this.transTypeIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
198
|
-
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
199
|
-
this.StringToTradeType(this.transType);
|
|
200
|
-
this.cUPSmartPayESVCIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
201
|
-
// 6-10
|
|
202
|
-
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
203
|
-
this.StringToPaymentCardType(this.cUPSmartPayESVCIndicator, this.hostId);
|
|
204
|
-
this.receiptNo = new fixed_string_model_1.FixedString().FromLongString(data, 13, 6).TrimmedValue;
|
|
205
|
-
this.cardNo = new fixed_string_model_1.FixedString().FromLongString(data, 19, 19).TrimmedValue;
|
|
206
|
-
this.cardExpireDate = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).TrimmedValue;
|
|
207
|
-
this.totalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
208
|
-
// 11-15
|
|
209
|
-
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
210
|
-
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
211
|
-
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
212
|
-
this.creditCardApprovalNo = new fixed_string_model_1.FixedString().FromLongString(data, 66, 9).TrimmedValue;
|
|
213
|
-
this.waveCardContactlessIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 75, 1).TrimmedValue;
|
|
214
|
-
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
215
|
-
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
216
|
-
// 16-20
|
|
217
|
-
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
218
|
-
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
219
|
-
this.expAmount = new fixed_string_model_1.FixedString().FromLongString(data, 103, 12).TrimmedValue;
|
|
220
|
-
this.storeId = new fixed_string_model_1.FixedString().FromLongString(data, 115, 18).TrimmedValue;
|
|
221
|
-
this.installmentRedeemIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 133, 1).TrimmedValue;
|
|
222
|
-
// 21-25
|
|
223
|
-
this.redeemPaidAmt = new fixed_string_model_1.FixedString().FromLongString(data, 134, 12).TrimmedValue;
|
|
224
|
-
this.redeemPoint = new fixed_string_model_1.FixedString().FromLongString(data, 146, 8).TrimmedValue;
|
|
225
|
-
this.pointsOfBalance = new fixed_string_model_1.FixedString().FromLongString(data, 154, 8).TrimmedValue;
|
|
226
|
-
this.redeemAmt = new fixed_string_model_1.FixedString().FromLongString(data, 162, 12).TrimmedValue;
|
|
227
|
-
this.installmentPeriod = new fixed_string_model_1.FixedString().FromLongString(data, 174, 2).TrimmedValue;
|
|
228
|
-
// 26-30
|
|
229
|
-
this.eTicketBalanceBeforeTrade = new fixed_string_model_1.FixedString().FromLongString(data, 176, 12).ValueAsDouble / 100;
|
|
230
|
-
this.eTicketBalanceAfterTrade = new fixed_string_model_1.FixedString().FromLongString(data, 188, 12).ValueAsDouble / 100;
|
|
231
|
-
this.eTicketChargeAmount = new fixed_string_model_1.FixedString().FromLongString(data, 200, 12).ValueAsDouble / 100;
|
|
232
|
-
this.cardType = new fixed_string_model_1.FixedString().FromLongString(data, 212, 2).TrimmedValue;
|
|
233
|
-
this.StringToPaymentCardDetailedType(this.cardType);
|
|
234
|
-
this.batchNo = new fixed_string_model_1.FixedString().FromLongString(data, 214, 6).TrimmedValue;
|
|
235
|
-
// 31-35
|
|
236
|
-
this.startTransType = new fixed_string_model_1.FixedString().FromLongString(data, 220, 2).TrimmedValue;
|
|
237
|
-
this.mPFlag = new fixed_string_model_1.FixedString().FromLongString(data, 222, 1).TrimmedValue;
|
|
238
|
-
this.sPIssuerId = new fixed_string_model_1.FixedString().FromLongString(data, 223, 8).TrimmedValue;
|
|
239
|
-
this.targetTradeTime = new fixed_string_model_1.FixedString().FromLongString(data, 231, 8).TrimmedValue;
|
|
240
|
-
this.StringToTargetTradeUnixTime(this.targetTradeTime);
|
|
241
|
-
this.aTSETicketTransactionId = new fixed_string_model_1.FixedString().FromLongString(data, 239, 12).TrimmedValue;
|
|
242
|
-
this.StringToTransactionId(this.creditCardApprovalNo, this.aTSETicketTransactionId);
|
|
243
|
-
// 36-40
|
|
244
|
-
this.payItem = new fixed_string_model_1.FixedString().FromLongString(data, 251, 5).TrimmedValue;
|
|
245
|
-
this.cardNoHashValue = new fixed_string_model_1.FixedString().FromLongString(data, 256, 50).TrimmedValue;
|
|
246
|
-
this.mPResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 306, 6).TrimmedValue;
|
|
247
|
-
this.aSMAwardFlag = new fixed_string_model_1.FixedString().FromLongString(data, 312, 1).TrimmedValue;
|
|
248
|
-
this.mCPIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 313, 1).TrimmedValue;
|
|
249
|
-
// 41-43
|
|
250
|
-
this.bankCodeList = new fixed_string_model_1.FixedString().FromLongString(data, 314, 3).TrimmedValue;
|
|
251
|
-
this.reserved5 = new fixed_string_model_1.FixedString().FromLongString(data, 317, 5).TrimmedValue;
|
|
252
|
-
this.hGData = new fixed_string_model_1.FixedString().FromLongString(data, 322, 78).TrimmedValue;
|
|
253
|
-
//#endregion
|
|
254
|
-
}
|
|
255
|
-
ToString() {
|
|
256
|
-
this.FillNCCCV3PRequest();
|
|
257
|
-
//#region Set fields: TNect to NCCC/V3P request
|
|
258
|
-
const totalAmountString = (this.totalAmount * 100).toString().padStart(12, '0');
|
|
259
|
-
this.transType = this.TradeTypeToString();
|
|
260
|
-
this.cUPSmartPayESVCIndicator = this.PaymentCardTypeToStrings(false).cUPSmartPayESVCIndicator;
|
|
261
|
-
this.hostId = this.PaymentCardTypeToStrings(false).hostId;
|
|
262
|
-
this.transDate = RefundDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
263
|
-
this.transTime = RefundDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
264
|
-
this.targetTradeTime = RefundDataNCCCV3P.ToDate(this.targetTradeUnixTime);
|
|
265
|
-
this.creditCardApprovalNo = this.TransactionIdToStrings().creditCardApprovalNo;
|
|
266
|
-
this.aTSETicketTransactionId = this.TransactionIdToStrings().aTSETicketTransactionId;
|
|
267
|
-
this.waveCardContactlessIndicator = null;
|
|
268
|
-
this.cardType = null;
|
|
269
|
-
this.eCRResponseCode = null;
|
|
270
|
-
const eTicketBalanceBeforeTradeString = null;
|
|
271
|
-
const eTicketBalanceAfterTradeString = null;
|
|
272
|
-
const eTicketChargeAmountString = null;
|
|
273
|
-
return '' +
|
|
274
|
-
// 1-5
|
|
275
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
276
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
277
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transTypeIndicator, 1).Value +
|
|
278
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
279
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cUPSmartPayESVCIndicator, 1).Value +
|
|
280
|
-
// 6-10
|
|
281
|
-
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
282
|
-
new fixed_string_model_1.FixedString().FromShortString(this.receiptNo, 6).Value +
|
|
283
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardNo, 19).Value +
|
|
284
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardExpireDate, 4).Value +
|
|
285
|
-
new fixed_string_model_1.FixedString().FromShortString(totalAmountString, 12).Value +
|
|
286
|
-
// 11-15
|
|
287
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
288
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
289
|
-
new fixed_string_model_1.FixedString().FromShortString(this.creditCardApprovalNo, 9).Value +
|
|
290
|
-
new fixed_string_model_1.FixedString().FromShortString(this.waveCardContactlessIndicator, 1).Value +
|
|
291
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
292
|
-
// 16-20
|
|
293
|
-
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
294
|
-
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
295
|
-
new fixed_string_model_1.FixedString().FromShortString(this.expAmount, 12).Value +
|
|
296
|
-
new fixed_string_model_1.FixedString().FromShortString(this.storeId, 18).Value +
|
|
297
|
-
new fixed_string_model_1.FixedString().FromShortString(this.installmentRedeemIndicator, 1).Value +
|
|
298
|
-
// 21-25
|
|
299
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemPaidAmt, 12).Value +
|
|
300
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemPoint, 8).Value +
|
|
301
|
-
new fixed_string_model_1.FixedString().FromShortString(this.pointsOfBalance, 8).Value +
|
|
302
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemAmt, 12).Value +
|
|
303
|
-
new fixed_string_model_1.FixedString().FromShortString(this.installmentPeriod, 2).Value +
|
|
304
|
-
// 26-30
|
|
305
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceBeforeTradeString, 12).Value +
|
|
306
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceAfterTradeString, 12).Value +
|
|
307
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketChargeAmountString, 12).Value +
|
|
308
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardType, 2).Value +
|
|
309
|
-
new fixed_string_model_1.FixedString().FromShortString(this.batchNo, 6).Value +
|
|
310
|
-
// 31-35
|
|
311
|
-
new fixed_string_model_1.FixedString().FromShortString(this.startTransType, 2).Value +
|
|
312
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mPFlag, 1).Value +
|
|
313
|
-
new fixed_string_model_1.FixedString().FromShortString(this.sPIssuerId, 8).Value +
|
|
314
|
-
new fixed_string_model_1.FixedString().FromShortString(this.targetTradeTime, 8).Value +
|
|
315
|
-
new fixed_string_model_1.FixedString().FromShortString(this.aTSETicketTransactionId, 12).Value +
|
|
316
|
-
// 36-40
|
|
317
|
-
new fixed_string_model_1.FixedString().FromShortString(this.payItem, 5).Value +
|
|
318
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardNoHashValue, 50).Value +
|
|
319
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mPResponseCode, 6).Value +
|
|
320
|
-
new fixed_string_model_1.FixedString().FromShortString(this.aSMAwardFlag, 1).Value +
|
|
321
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mCPIndicator, 1).Value +
|
|
322
|
-
// 41-43
|
|
323
|
-
new fixed_string_model_1.FixedString().FromShortString(this.bankCodeList, 3).Value +
|
|
324
|
-
new fixed_string_model_1.FixedString().FromShortString(this.reserved5, 5).Value +
|
|
325
|
-
new fixed_string_model_1.FixedString().FromShortString(this.hGData, 78).Value +
|
|
326
|
-
'';
|
|
327
|
-
//#endregion
|
|
328
|
-
}
|
|
329
|
-
FillNCCCV3PRequest() {
|
|
330
|
-
this.eCRIndicator = 'I';
|
|
331
|
-
this.tradeType = RefundDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.refund];
|
|
332
|
-
this.aSMAwardFlag = ' ';
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
exports.RefundDataNCCCV3P = RefundDataNCCCV3P;
|
|
336
|
-
/**
|
|
337
|
-
* @Deprecated - Please import from HAL
|
|
338
|
-
*/
|
|
339
|
-
class SettlementDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
340
|
-
constructor() {
|
|
341
|
-
super();
|
|
342
|
-
}
|
|
343
|
-
transformDataForRequest(data) {
|
|
344
|
-
this.paymentCardType = data.paymentCardType;
|
|
345
|
-
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
346
|
-
}
|
|
347
|
-
transformDataForResponse(data) {
|
|
348
|
-
if (!data) {
|
|
349
|
-
this.isSuccess = false;
|
|
350
|
-
this.retry = true;
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
//#region Set fields: NCCC/V3P response to TNect
|
|
354
|
-
// 1-5
|
|
355
|
-
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
356
|
-
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
357
|
-
this.reserved1 = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
358
|
-
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
359
|
-
this.StringToTradeType(this.transType);
|
|
360
|
-
this.settlementIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
361
|
-
// 6-10
|
|
362
|
-
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
363
|
-
this.StringToPaymentCardType(this.settlementIndicator, this.hostId);
|
|
364
|
-
this.reserved25 = new fixed_string_model_1.FixedString().FromLongString(data, 13, 25).TrimmedValue;
|
|
365
|
-
this.creditCardTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).ValueAsInt;
|
|
366
|
-
this.creditCardTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
367
|
-
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
368
|
-
// 11-15
|
|
369
|
-
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
370
|
-
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
371
|
-
this.reserved10 = new fixed_string_model_1.FixedString().FromLongString(data, 66, 10).TrimmedValue;
|
|
372
|
-
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
373
|
-
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
374
|
-
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
375
|
-
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
376
|
-
// 16-20
|
|
377
|
-
this.easyCardTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 103, 3).ValueAsInt;
|
|
378
|
-
this.easyCardTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 106, 10).ValueAsDouble / 100;
|
|
379
|
-
this.iPassTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 116, 3).ValueAsInt;
|
|
380
|
-
this.iPassTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 119, 10).ValueAsDouble / 100;
|
|
381
|
-
this.iCashTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 129, 3).ValueAsInt;
|
|
382
|
-
// 21-24
|
|
383
|
-
this.iCashTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 132, 10).ValueAsDouble / 100;
|
|
384
|
-
this.happyCashTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 142, 3).ValueAsInt;
|
|
385
|
-
this.happyCashTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 145, 10).ValueAsDouble / 100;
|
|
386
|
-
this.reserved245 = new fixed_string_model_1.FixedString().FromLongString(data, 155, 245).TrimmedValue;
|
|
387
|
-
//#endregion
|
|
388
|
-
}
|
|
389
|
-
ToString() {
|
|
390
|
-
this.FillNCCCV3PRequest();
|
|
391
|
-
//#region Set fields: TNect to NCCC/V3P request
|
|
392
|
-
this.transType = this.TradeTypeToString();
|
|
393
|
-
this.settlementIndicator = this.PaymentCardTypeToStrings(true).cUPSmartPayESVCIndicator;
|
|
394
|
-
this.hostId = this.PaymentCardTypeToStrings(true).hostId;
|
|
395
|
-
this.transDate = SettlementDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
396
|
-
this.transTime = SettlementDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
397
|
-
this.eCRResponseCode = null;
|
|
398
|
-
const creditCardTotalTradeNumbers = null;
|
|
399
|
-
const creditCardTotalAmount = null;
|
|
400
|
-
const easyCardTotalTradeNumbers = null;
|
|
401
|
-
const easyCardTotalAmount = null;
|
|
402
|
-
const iPassTotalTradeNumbers = null;
|
|
403
|
-
const iPassTotalAmount = null;
|
|
404
|
-
const iCashTotalTradeNumbers = null;
|
|
405
|
-
const iCashTotalAmount = null;
|
|
406
|
-
const happyCashTotalTradeNumbers = null;
|
|
407
|
-
const happyCashTotalAmount = null;
|
|
408
|
-
return '' +
|
|
409
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
410
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
411
|
-
new fixed_string_model_1.FixedString().FromShortString(this.reserved1, 1).Value +
|
|
412
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
413
|
-
new fixed_string_model_1.FixedString().FromShortString(this.settlementIndicator, 1).Value +
|
|
414
|
-
// 6-10
|
|
415
|
-
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
416
|
-
new fixed_string_model_1.FixedString().FromShortString(this.reserved25, 25).Value +
|
|
417
|
-
new fixed_string_model_1.FixedString().FromShortString(creditCardTotalTradeNumbers, 4).Value +
|
|
418
|
-
new fixed_string_model_1.FixedString().FromShortString(creditCardTotalAmount, 12).Value +
|
|
419
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
420
|
-
// 11-15
|
|
421
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
422
|
-
new fixed_string_model_1.FixedString().FromShortString(this.reserved10, 10).Value +
|
|
423
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
424
|
-
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
425
|
-
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
426
|
-
// 16-20
|
|
427
|
-
new fixed_string_model_1.FixedString().FromShortString(easyCardTotalTradeNumbers, 3).Value +
|
|
428
|
-
new fixed_string_model_1.FixedString().FromShortString(easyCardTotalAmount, 10).Value +
|
|
429
|
-
new fixed_string_model_1.FixedString().FromShortString(iPassTotalTradeNumbers, 3).Value +
|
|
430
|
-
new fixed_string_model_1.FixedString().FromShortString(iPassTotalAmount, 10).Value +
|
|
431
|
-
new fixed_string_model_1.FixedString().FromShortString(iCashTotalTradeNumbers, 3).Value +
|
|
432
|
-
// 21-24
|
|
433
|
-
new fixed_string_model_1.FixedString().FromShortString(iCashTotalAmount, 10).Value +
|
|
434
|
-
new fixed_string_model_1.FixedString().FromShortString(happyCashTotalTradeNumbers, 3).Value +
|
|
435
|
-
new fixed_string_model_1.FixedString().FromShortString(happyCashTotalAmount, 10).Value +
|
|
436
|
-
new fixed_string_model_1.FixedString().FromShortString(this.reserved245, 245).Value +
|
|
437
|
-
'';
|
|
438
|
-
//#endregion
|
|
439
|
-
}
|
|
440
|
-
FillNCCCV3PRequest() {
|
|
441
|
-
this.eCRIndicator = 'I';
|
|
442
|
-
this.tradeType = SettlementDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.settlement];
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
exports.SettlementDataNCCCV3P = SettlementDataNCCCV3P;
|
|
446
|
-
/**
|
|
447
|
-
* @Deprecated - Please import from HAL
|
|
448
|
-
*/
|
|
449
|
-
class RetryDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
450
|
-
constructor() {
|
|
451
|
-
super();
|
|
452
|
-
}
|
|
453
|
-
transformDataForRequest(data) {
|
|
454
|
-
// [Pay] fields
|
|
455
|
-
this.paymentCardType = data.paymentCardType;
|
|
456
|
-
this.totalAmount = data.totalAmount;
|
|
457
|
-
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
458
|
-
// [Refund] fields
|
|
459
|
-
this.paymentCardType = data.paymentCardType;
|
|
460
|
-
this.totalAmount = data.totalAmount;
|
|
461
|
-
this.transactionId = data.transactionId;
|
|
462
|
-
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
463
|
-
this.targetTradeUnixTime = data.targetTradeUnixTime;
|
|
464
|
-
// [Settlement] fields
|
|
465
|
-
this.paymentCardType = data.paymentCardType;
|
|
466
|
-
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
467
|
-
// [Retry] fields
|
|
468
|
-
this.retryTradeType = data.retryTradeType;
|
|
469
|
-
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
470
|
-
}
|
|
471
|
-
transformDataForResponse(data) {
|
|
472
|
-
if (!data) {
|
|
473
|
-
this.isSuccess = false;
|
|
474
|
-
this.retry = true;
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
//#region Set fields: NCCC/V3P response to TNect
|
|
478
|
-
// 1-5
|
|
479
|
-
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
480
|
-
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
481
|
-
this.transTypeIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
482
|
-
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
483
|
-
this.StringToTradeType(this.transType);
|
|
484
|
-
this.cUPSmartPayESVCIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
485
|
-
// 6-10
|
|
486
|
-
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
487
|
-
this.StringToPaymentCardType(this.cUPSmartPayESVCIndicator, this.hostId);
|
|
488
|
-
this.receiptNo = new fixed_string_model_1.FixedString().FromLongString(data, 13, 6).TrimmedValue;
|
|
489
|
-
this.cardNo = new fixed_string_model_1.FixedString().FromLongString(data, 19, 19).TrimmedValue;
|
|
490
|
-
this.cardExpireDate = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).TrimmedValue;
|
|
491
|
-
this.totalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
492
|
-
// 11-15
|
|
493
|
-
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
494
|
-
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
495
|
-
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
496
|
-
this.creditCardApprovalNo = new fixed_string_model_1.FixedString().FromLongString(data, 66, 9).TrimmedValue;
|
|
497
|
-
this.waveCardContactlessIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 75, 1).TrimmedValue;
|
|
498
|
-
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
499
|
-
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
500
|
-
// 16-20
|
|
501
|
-
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
502
|
-
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
503
|
-
this.expAmount = new fixed_string_model_1.FixedString().FromLongString(data, 103, 12).TrimmedValue;
|
|
504
|
-
this.storeId = new fixed_string_model_1.FixedString().FromLongString(data, 115, 18).TrimmedValue;
|
|
505
|
-
this.installmentRedeemIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 133, 1).TrimmedValue;
|
|
506
|
-
// 21-25
|
|
507
|
-
this.redeemPaidAmt = new fixed_string_model_1.FixedString().FromLongString(data, 134, 12).TrimmedValue;
|
|
508
|
-
this.redeemPoint = new fixed_string_model_1.FixedString().FromLongString(data, 146, 8).TrimmedValue;
|
|
509
|
-
this.pointsOfBalance = new fixed_string_model_1.FixedString().FromLongString(data, 154, 8).TrimmedValue;
|
|
510
|
-
this.redeemAmt = new fixed_string_model_1.FixedString().FromLongString(data, 162, 12).TrimmedValue;
|
|
511
|
-
this.installmentPeriod = new fixed_string_model_1.FixedString().FromLongString(data, 174, 2).TrimmedValue;
|
|
512
|
-
// 26-30
|
|
513
|
-
this.eTicketBalanceBeforeTrade = new fixed_string_model_1.FixedString().FromLongString(data, 176, 12).ValueAsDouble / 100;
|
|
514
|
-
this.eTicketBalanceAfterTrade = new fixed_string_model_1.FixedString().FromLongString(data, 188, 12).ValueAsDouble / 100;
|
|
515
|
-
this.eTicketChargeAmount = new fixed_string_model_1.FixedString().FromLongString(data, 200, 12).ValueAsDouble / 100;
|
|
516
|
-
this.cardType = new fixed_string_model_1.FixedString().FromLongString(data, 212, 2).TrimmedValue;
|
|
517
|
-
this.StringToPaymentCardDetailedType(this.cardType);
|
|
518
|
-
this.batchNo = new fixed_string_model_1.FixedString().FromLongString(data, 214, 6).TrimmedValue;
|
|
519
|
-
// 31-35
|
|
520
|
-
this.startTransType = new fixed_string_model_1.FixedString().FromLongString(data, 220, 2).TrimmedValue;
|
|
521
|
-
this.StringToRetryTradeType(this.startTransType);
|
|
522
|
-
this.mPFlag = new fixed_string_model_1.FixedString().FromLongString(data, 222, 1).TrimmedValue;
|
|
523
|
-
this.sPIssuerId = new fixed_string_model_1.FixedString().FromLongString(data, 223, 8).TrimmedValue;
|
|
524
|
-
this.targetTradeTime = new fixed_string_model_1.FixedString().FromLongString(data, 231, 8).TrimmedValue;
|
|
525
|
-
this.StringToTargetTradeUnixTime(this.targetTradeTime);
|
|
526
|
-
this.aTSETicketTransactionId = new fixed_string_model_1.FixedString().FromLongString(data, 239, 12).TrimmedValue;
|
|
527
|
-
this.StringToTransactionId(this.creditCardApprovalNo, this.aTSETicketTransactionId);
|
|
528
|
-
// 36-40
|
|
529
|
-
this.payItem = new fixed_string_model_1.FixedString().FromLongString(data, 251, 5).TrimmedValue;
|
|
530
|
-
this.cardNoHashValue = new fixed_string_model_1.FixedString().FromLongString(data, 256, 50).TrimmedValue;
|
|
531
|
-
this.mPResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 306, 6).TrimmedValue;
|
|
532
|
-
this.aSMAwardFlag = new fixed_string_model_1.FixedString().FromLongString(data, 312, 1).TrimmedValue;
|
|
533
|
-
this.mCPIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 313, 1).TrimmedValue;
|
|
534
|
-
// 41-43
|
|
535
|
-
this.bankCodeList = new fixed_string_model_1.FixedString().FromLongString(data, 314, 3).TrimmedValue;
|
|
536
|
-
this.reserved5 = new fixed_string_model_1.FixedString().FromLongString(data, 317, 5).TrimmedValue;
|
|
537
|
-
this.hGData = new fixed_string_model_1.FixedString().FromLongString(data, 322, 78).TrimmedValue;
|
|
538
|
-
//#endregion
|
|
539
|
-
}
|
|
540
|
-
ToString() {
|
|
541
|
-
this.FillNCCCV3PRequest();
|
|
542
|
-
//#region Set fields: TNect to NCCC/V3P request
|
|
543
|
-
const totalAmountString = (this.totalAmount * 100).toString().padStart(12, '0');
|
|
544
|
-
this.transType = this.TradeTypeToString();
|
|
545
|
-
this.cUPSmartPayESVCIndicator = this.PaymentCardTypeToStrings(false).cUPSmartPayESVCIndicator;
|
|
546
|
-
this.hostId = this.PaymentCardTypeToStrings(false).hostId;
|
|
547
|
-
this.transDate = RetryDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
548
|
-
this.transTime = RetryDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
549
|
-
this.targetTradeTime = RetryDataNCCCV3P.ToDate(this.targetTradeUnixTime);
|
|
550
|
-
this.creditCardApprovalNo = this.TransactionIdToStrings().creditCardApprovalNo;
|
|
551
|
-
this.aTSETicketTransactionId = this.TransactionIdToStrings().aTSETicketTransactionId;
|
|
552
|
-
this.waveCardContactlessIndicator = null;
|
|
553
|
-
this.cardType = null;
|
|
554
|
-
this.eCRResponseCode = null;
|
|
555
|
-
const eTicketBalanceBeforeTradeString = null;
|
|
556
|
-
const eTicketBalanceAfterTradeString = null;
|
|
557
|
-
const eTicketChargeAmountString = null;
|
|
558
|
-
this.startTransType = this.RetryTradeTypeToString();
|
|
559
|
-
return '' +
|
|
560
|
-
// 1-5
|
|
561
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
562
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
563
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transTypeIndicator, 1).Value +
|
|
564
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
565
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cUPSmartPayESVCIndicator, 1).Value +
|
|
566
|
-
// 6-10
|
|
567
|
-
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
568
|
-
new fixed_string_model_1.FixedString().FromShortString(this.receiptNo, 6).Value +
|
|
569
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardNo, 19).Value +
|
|
570
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardExpireDate, 4).Value +
|
|
571
|
-
new fixed_string_model_1.FixedString().FromShortString(totalAmountString, 12).Value +
|
|
572
|
-
// 11-15
|
|
573
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
574
|
-
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
575
|
-
new fixed_string_model_1.FixedString().FromShortString(this.creditCardApprovalNo, 9).Value +
|
|
576
|
-
new fixed_string_model_1.FixedString().FromShortString(this.waveCardContactlessIndicator, 1).Value +
|
|
577
|
-
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
578
|
-
// 16-20
|
|
579
|
-
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
580
|
-
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
581
|
-
new fixed_string_model_1.FixedString().FromShortString(this.expAmount, 12).Value +
|
|
582
|
-
new fixed_string_model_1.FixedString().FromShortString(this.storeId, 18).Value +
|
|
583
|
-
new fixed_string_model_1.FixedString().FromShortString(this.installmentRedeemIndicator, 1).Value +
|
|
584
|
-
// 21-25
|
|
585
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemPaidAmt, 12).Value +
|
|
586
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemPoint, 8).Value +
|
|
587
|
-
new fixed_string_model_1.FixedString().FromShortString(this.pointsOfBalance, 8).Value +
|
|
588
|
-
new fixed_string_model_1.FixedString().FromShortString(this.redeemAmt, 12).Value +
|
|
589
|
-
new fixed_string_model_1.FixedString().FromShortString(this.installmentPeriod, 2).Value +
|
|
590
|
-
// 26-30
|
|
591
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceBeforeTradeString, 12).Value +
|
|
592
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceAfterTradeString, 12).Value +
|
|
593
|
-
new fixed_string_model_1.FixedString().FromShortString(eTicketChargeAmountString, 12).Value +
|
|
594
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardType, 2).Value +
|
|
595
|
-
new fixed_string_model_1.FixedString().FromShortString(this.batchNo, 6).Value +
|
|
596
|
-
// 31-35
|
|
597
|
-
new fixed_string_model_1.FixedString().FromShortString(this.startTransType, 2).Value +
|
|
598
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mPFlag, 1).Value +
|
|
599
|
-
new fixed_string_model_1.FixedString().FromShortString(this.sPIssuerId, 8).Value +
|
|
600
|
-
new fixed_string_model_1.FixedString().FromShortString(this.targetTradeTime, 8).Value +
|
|
601
|
-
new fixed_string_model_1.FixedString().FromShortString(this.aTSETicketTransactionId, 12).Value +
|
|
602
|
-
// 36-40
|
|
603
|
-
new fixed_string_model_1.FixedString().FromShortString(this.payItem, 5).Value +
|
|
604
|
-
new fixed_string_model_1.FixedString().FromShortString(this.cardNoHashValue, 50).Value +
|
|
605
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mPResponseCode, 6).Value +
|
|
606
|
-
new fixed_string_model_1.FixedString().FromShortString(this.aSMAwardFlag, 1).Value +
|
|
607
|
-
new fixed_string_model_1.FixedString().FromShortString(this.mCPIndicator, 1).Value +
|
|
608
|
-
// 41-43
|
|
609
|
-
new fixed_string_model_1.FixedString().FromShortString(this.bankCodeList, 3).Value +
|
|
610
|
-
new fixed_string_model_1.FixedString().FromShortString(this.reserved5, 5).Value +
|
|
611
|
-
new fixed_string_model_1.FixedString().FromShortString(this.hGData, 78).Value +
|
|
612
|
-
'';
|
|
613
|
-
//#endregion
|
|
614
|
-
}
|
|
615
|
-
FillNCCCV3PRequest() {
|
|
616
|
-
this.eCRIndicator = 'I';
|
|
617
|
-
this.tradeType = RetryDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.retry];
|
|
618
|
-
this.aSMAwardFlag = ' ';
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
exports.RetryDataNCCCV3P = RetryDataNCCCV3P;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryDataNCCCV3P = exports.SettlementDataNCCCV3P = exports.RefundDataNCCCV3P = exports.PayDataNCCCV3P = void 0;
|
|
4
|
+
const payment_machine_union_model_1 = require("../payment-machine-union.model");
|
|
5
|
+
const fixed_string_model_1 = require("../fixed-string.model");
|
|
6
|
+
const payment_machine_1 = require("../../payment-machine");
|
|
7
|
+
/**
|
|
8
|
+
* @Deprecated - Please import from HAL
|
|
9
|
+
*/
|
|
10
|
+
class PayDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
11
|
+
// D220
|
|
12
|
+
// VID: 4660,0x1234
|
|
13
|
+
// PID: 0257,0x0101
|
|
14
|
+
// V3P 轉接線
|
|
15
|
+
// VID: 0x0403
|
|
16
|
+
// PID: 0x6001
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
}
|
|
20
|
+
transformDataForRequest(data) {
|
|
21
|
+
this.paymentCardType = data.paymentCardType;
|
|
22
|
+
this.totalAmount = data.totalAmount;
|
|
23
|
+
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
24
|
+
}
|
|
25
|
+
transformDataForResponse(data) {
|
|
26
|
+
if (!data) {
|
|
27
|
+
this.isSuccess = false;
|
|
28
|
+
this.retry = true;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
//#region Set fields: NCCC/V3P response to TNect
|
|
32
|
+
// 1-5
|
|
33
|
+
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
34
|
+
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
35
|
+
this.transTypeIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
36
|
+
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
37
|
+
this.StringToTradeType(this.transType);
|
|
38
|
+
this.cUPSmartPayESVCIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
39
|
+
// 6-10
|
|
40
|
+
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
41
|
+
this.StringToPaymentCardType(this.cUPSmartPayESVCIndicator, this.hostId);
|
|
42
|
+
this.receiptNo = new fixed_string_model_1.FixedString().FromLongString(data, 13, 6).TrimmedValue;
|
|
43
|
+
this.cardNo = new fixed_string_model_1.FixedString().FromLongString(data, 19, 19).TrimmedValue;
|
|
44
|
+
this.cardExpireDate = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).TrimmedValue;
|
|
45
|
+
this.totalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
46
|
+
// 11-15
|
|
47
|
+
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
48
|
+
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
49
|
+
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
50
|
+
this.creditCardApprovalNo = new fixed_string_model_1.FixedString().FromLongString(data, 66, 9).TrimmedValue;
|
|
51
|
+
this.waveCardContactlessIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 75, 1).TrimmedValue;
|
|
52
|
+
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
53
|
+
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
54
|
+
// 16-20
|
|
55
|
+
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
56
|
+
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
57
|
+
this.expAmount = new fixed_string_model_1.FixedString().FromLongString(data, 103, 12).TrimmedValue;
|
|
58
|
+
this.storeId = new fixed_string_model_1.FixedString().FromLongString(data, 115, 18).TrimmedValue;
|
|
59
|
+
this.installmentRedeemIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 133, 1).TrimmedValue;
|
|
60
|
+
// 21-25
|
|
61
|
+
this.redeemPaidAmt = new fixed_string_model_1.FixedString().FromLongString(data, 134, 12).TrimmedValue;
|
|
62
|
+
this.redeemPoint = new fixed_string_model_1.FixedString().FromLongString(data, 146, 8).TrimmedValue;
|
|
63
|
+
this.pointsOfBalance = new fixed_string_model_1.FixedString().FromLongString(data, 154, 8).TrimmedValue;
|
|
64
|
+
this.redeemAmt = new fixed_string_model_1.FixedString().FromLongString(data, 162, 12).TrimmedValue;
|
|
65
|
+
this.installmentPeriod = new fixed_string_model_1.FixedString().FromLongString(data, 174, 2).TrimmedValue;
|
|
66
|
+
// 26-30
|
|
67
|
+
this.eTicketBalanceBeforeTrade = new fixed_string_model_1.FixedString().FromLongString(data, 176, 12).ValueAsDouble / 100;
|
|
68
|
+
this.eTicketBalanceAfterTrade = new fixed_string_model_1.FixedString().FromLongString(data, 188, 12).ValueAsDouble / 100;
|
|
69
|
+
this.eTicketChargeAmount = new fixed_string_model_1.FixedString().FromLongString(data, 200, 12).ValueAsDouble / 100;
|
|
70
|
+
this.cardType = new fixed_string_model_1.FixedString().FromLongString(data, 212, 2).TrimmedValue;
|
|
71
|
+
this.StringToPaymentCardDetailedType(this.cardType);
|
|
72
|
+
this.batchNo = new fixed_string_model_1.FixedString().FromLongString(data, 214, 6).TrimmedValue;
|
|
73
|
+
// 31-35
|
|
74
|
+
this.startTransType = new fixed_string_model_1.FixedString().FromLongString(data, 220, 2).TrimmedValue;
|
|
75
|
+
this.mPFlag = new fixed_string_model_1.FixedString().FromLongString(data, 222, 1).TrimmedValue;
|
|
76
|
+
this.sPIssuerId = new fixed_string_model_1.FixedString().FromLongString(data, 223, 8).TrimmedValue;
|
|
77
|
+
this.targetTradeTime = new fixed_string_model_1.FixedString().FromLongString(data, 231, 8).TrimmedValue;
|
|
78
|
+
this.StringToTargetTradeUnixTime(this.targetTradeTime);
|
|
79
|
+
this.aTSETicketTransactionId = new fixed_string_model_1.FixedString().FromLongString(data, 239, 12).TrimmedValue;
|
|
80
|
+
this.StringToTransactionId(this.creditCardApprovalNo, this.aTSETicketTransactionId);
|
|
81
|
+
// 36-40
|
|
82
|
+
this.payItem = new fixed_string_model_1.FixedString().FromLongString(data, 251, 5).TrimmedValue;
|
|
83
|
+
this.cardNoHashValue = new fixed_string_model_1.FixedString().FromLongString(data, 256, 50).TrimmedValue;
|
|
84
|
+
this.mPResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 306, 6).TrimmedValue;
|
|
85
|
+
this.aSMAwardFlag = new fixed_string_model_1.FixedString().FromLongString(data, 312, 1).TrimmedValue;
|
|
86
|
+
this.mCPIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 313, 1).TrimmedValue;
|
|
87
|
+
// 41-43
|
|
88
|
+
this.bankCodeList = new fixed_string_model_1.FixedString().FromLongString(data, 314, 3).TrimmedValue;
|
|
89
|
+
this.reserved5 = new fixed_string_model_1.FixedString().FromLongString(data, 317, 5).TrimmedValue;
|
|
90
|
+
this.hGData = new fixed_string_model_1.FixedString().FromLongString(data, 322, 78).TrimmedValue;
|
|
91
|
+
//#endregion
|
|
92
|
+
}
|
|
93
|
+
ToString() {
|
|
94
|
+
this.FillNCCCV3PRequest();
|
|
95
|
+
//#region Set fields: TNect to NCCC/V3P request
|
|
96
|
+
const totalAmountString = (this.totalAmount * 100).toString().padStart(12, '0');
|
|
97
|
+
this.transType = this.TradeTypeToString();
|
|
98
|
+
this.cUPSmartPayESVCIndicator = this.PaymentCardTypeToStrings(false).cUPSmartPayESVCIndicator;
|
|
99
|
+
this.hostId = this.PaymentCardTypeToStrings(false).hostId;
|
|
100
|
+
this.transDate = PayDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
101
|
+
this.transTime = PayDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
102
|
+
this.targetTradeTime = PayDataNCCCV3P.ToDate(this.targetTradeUnixTime);
|
|
103
|
+
this.creditCardApprovalNo = this.TransactionIdToStrings().creditCardApprovalNo;
|
|
104
|
+
this.aTSETicketTransactionId = this.TransactionIdToStrings().aTSETicketTransactionId;
|
|
105
|
+
this.waveCardContactlessIndicator = null;
|
|
106
|
+
this.cardType = null;
|
|
107
|
+
this.eCRResponseCode = null;
|
|
108
|
+
const eTicketBalanceBeforeTradeString = null;
|
|
109
|
+
const eTicketBalanceAfterTradeString = null;
|
|
110
|
+
const eTicketChargeAmountString = null;
|
|
111
|
+
return '' +
|
|
112
|
+
// 1-5
|
|
113
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
114
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
115
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transTypeIndicator, 1).Value +
|
|
116
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
117
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cUPSmartPayESVCIndicator, 1).Value +
|
|
118
|
+
// 6-10
|
|
119
|
+
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
120
|
+
new fixed_string_model_1.FixedString().FromShortString(this.receiptNo, 6).Value +
|
|
121
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardNo, 19).Value +
|
|
122
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardExpireDate, 4).Value +
|
|
123
|
+
new fixed_string_model_1.FixedString().FromShortString(totalAmountString, 12).Value +
|
|
124
|
+
// 11-15
|
|
125
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
126
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
127
|
+
new fixed_string_model_1.FixedString().FromShortString(this.creditCardApprovalNo, 9).Value +
|
|
128
|
+
new fixed_string_model_1.FixedString().FromShortString(this.waveCardContactlessIndicator, 1).Value +
|
|
129
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
130
|
+
// 16-20
|
|
131
|
+
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
132
|
+
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
133
|
+
new fixed_string_model_1.FixedString().FromShortString(this.expAmount, 12).Value +
|
|
134
|
+
new fixed_string_model_1.FixedString().FromShortString(this.storeId, 18).Value +
|
|
135
|
+
new fixed_string_model_1.FixedString().FromShortString(this.installmentRedeemIndicator, 1).Value +
|
|
136
|
+
// 21-25
|
|
137
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemPaidAmt, 12).Value +
|
|
138
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemPoint, 8).Value +
|
|
139
|
+
new fixed_string_model_1.FixedString().FromShortString(this.pointsOfBalance, 8).Value +
|
|
140
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemAmt, 12).Value +
|
|
141
|
+
new fixed_string_model_1.FixedString().FromShortString(this.installmentPeriod, 2).Value +
|
|
142
|
+
// 26-30
|
|
143
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceBeforeTradeString, 12).Value +
|
|
144
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceAfterTradeString, 12).Value +
|
|
145
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketChargeAmountString, 12).Value +
|
|
146
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardType, 2).Value +
|
|
147
|
+
new fixed_string_model_1.FixedString().FromShortString(this.batchNo, 6).Value +
|
|
148
|
+
// 31-35
|
|
149
|
+
new fixed_string_model_1.FixedString().FromShortString(this.startTransType, 2).Value +
|
|
150
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mPFlag, 1).Value +
|
|
151
|
+
new fixed_string_model_1.FixedString().FromShortString(this.sPIssuerId, 8).Value +
|
|
152
|
+
new fixed_string_model_1.FixedString().FromShortString(this.targetTradeTime, 8).Value +
|
|
153
|
+
new fixed_string_model_1.FixedString().FromShortString(this.aTSETicketTransactionId, 12).Value +
|
|
154
|
+
// 36-40
|
|
155
|
+
new fixed_string_model_1.FixedString().FromShortString(this.payItem, 5).Value +
|
|
156
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardNoHashValue, 50).Value +
|
|
157
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mPResponseCode, 6).Value +
|
|
158
|
+
new fixed_string_model_1.FixedString().FromShortString(this.aSMAwardFlag, 1).Value +
|
|
159
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mCPIndicator, 1).Value +
|
|
160
|
+
// 41-43
|
|
161
|
+
new fixed_string_model_1.FixedString().FromShortString(this.bankCodeList, 3).Value +
|
|
162
|
+
new fixed_string_model_1.FixedString().FromShortString(this.reserved5, 5).Value +
|
|
163
|
+
new fixed_string_model_1.FixedString().FromShortString(this.hGData, 78).Value +
|
|
164
|
+
'';
|
|
165
|
+
//#endregion
|
|
166
|
+
}
|
|
167
|
+
FillNCCCV3PRequest() {
|
|
168
|
+
this.eCRIndicator = 'I';
|
|
169
|
+
this.tradeType = PayDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.pay];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.PayDataNCCCV3P = PayDataNCCCV3P;
|
|
173
|
+
/**
|
|
174
|
+
* @Deprecated - Please import from HAL
|
|
175
|
+
*/
|
|
176
|
+
class RefundDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
177
|
+
constructor() {
|
|
178
|
+
super();
|
|
179
|
+
}
|
|
180
|
+
transformDataForRequest(data) {
|
|
181
|
+
this.paymentCardType = data.paymentCardType;
|
|
182
|
+
this.totalAmount = data.totalAmount;
|
|
183
|
+
this.transactionId = data.transactionId;
|
|
184
|
+
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
185
|
+
this.targetTradeUnixTime = data.targetTradeUnixTime;
|
|
186
|
+
}
|
|
187
|
+
transformDataForResponse(data) {
|
|
188
|
+
if (!data) {
|
|
189
|
+
this.isSuccess = false;
|
|
190
|
+
this.retry = true;
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
//#region Set fields: NCCC/V3P response to TNect
|
|
194
|
+
// 1-5
|
|
195
|
+
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
196
|
+
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
197
|
+
this.transTypeIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
198
|
+
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
199
|
+
this.StringToTradeType(this.transType);
|
|
200
|
+
this.cUPSmartPayESVCIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
201
|
+
// 6-10
|
|
202
|
+
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
203
|
+
this.StringToPaymentCardType(this.cUPSmartPayESVCIndicator, this.hostId);
|
|
204
|
+
this.receiptNo = new fixed_string_model_1.FixedString().FromLongString(data, 13, 6).TrimmedValue;
|
|
205
|
+
this.cardNo = new fixed_string_model_1.FixedString().FromLongString(data, 19, 19).TrimmedValue;
|
|
206
|
+
this.cardExpireDate = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).TrimmedValue;
|
|
207
|
+
this.totalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
208
|
+
// 11-15
|
|
209
|
+
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
210
|
+
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
211
|
+
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
212
|
+
this.creditCardApprovalNo = new fixed_string_model_1.FixedString().FromLongString(data, 66, 9).TrimmedValue;
|
|
213
|
+
this.waveCardContactlessIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 75, 1).TrimmedValue;
|
|
214
|
+
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
215
|
+
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
216
|
+
// 16-20
|
|
217
|
+
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
218
|
+
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
219
|
+
this.expAmount = new fixed_string_model_1.FixedString().FromLongString(data, 103, 12).TrimmedValue;
|
|
220
|
+
this.storeId = new fixed_string_model_1.FixedString().FromLongString(data, 115, 18).TrimmedValue;
|
|
221
|
+
this.installmentRedeemIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 133, 1).TrimmedValue;
|
|
222
|
+
// 21-25
|
|
223
|
+
this.redeemPaidAmt = new fixed_string_model_1.FixedString().FromLongString(data, 134, 12).TrimmedValue;
|
|
224
|
+
this.redeemPoint = new fixed_string_model_1.FixedString().FromLongString(data, 146, 8).TrimmedValue;
|
|
225
|
+
this.pointsOfBalance = new fixed_string_model_1.FixedString().FromLongString(data, 154, 8).TrimmedValue;
|
|
226
|
+
this.redeemAmt = new fixed_string_model_1.FixedString().FromLongString(data, 162, 12).TrimmedValue;
|
|
227
|
+
this.installmentPeriod = new fixed_string_model_1.FixedString().FromLongString(data, 174, 2).TrimmedValue;
|
|
228
|
+
// 26-30
|
|
229
|
+
this.eTicketBalanceBeforeTrade = new fixed_string_model_1.FixedString().FromLongString(data, 176, 12).ValueAsDouble / 100;
|
|
230
|
+
this.eTicketBalanceAfterTrade = new fixed_string_model_1.FixedString().FromLongString(data, 188, 12).ValueAsDouble / 100;
|
|
231
|
+
this.eTicketChargeAmount = new fixed_string_model_1.FixedString().FromLongString(data, 200, 12).ValueAsDouble / 100;
|
|
232
|
+
this.cardType = new fixed_string_model_1.FixedString().FromLongString(data, 212, 2).TrimmedValue;
|
|
233
|
+
this.StringToPaymentCardDetailedType(this.cardType);
|
|
234
|
+
this.batchNo = new fixed_string_model_1.FixedString().FromLongString(data, 214, 6).TrimmedValue;
|
|
235
|
+
// 31-35
|
|
236
|
+
this.startTransType = new fixed_string_model_1.FixedString().FromLongString(data, 220, 2).TrimmedValue;
|
|
237
|
+
this.mPFlag = new fixed_string_model_1.FixedString().FromLongString(data, 222, 1).TrimmedValue;
|
|
238
|
+
this.sPIssuerId = new fixed_string_model_1.FixedString().FromLongString(data, 223, 8).TrimmedValue;
|
|
239
|
+
this.targetTradeTime = new fixed_string_model_1.FixedString().FromLongString(data, 231, 8).TrimmedValue;
|
|
240
|
+
this.StringToTargetTradeUnixTime(this.targetTradeTime);
|
|
241
|
+
this.aTSETicketTransactionId = new fixed_string_model_1.FixedString().FromLongString(data, 239, 12).TrimmedValue;
|
|
242
|
+
this.StringToTransactionId(this.creditCardApprovalNo, this.aTSETicketTransactionId);
|
|
243
|
+
// 36-40
|
|
244
|
+
this.payItem = new fixed_string_model_1.FixedString().FromLongString(data, 251, 5).TrimmedValue;
|
|
245
|
+
this.cardNoHashValue = new fixed_string_model_1.FixedString().FromLongString(data, 256, 50).TrimmedValue;
|
|
246
|
+
this.mPResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 306, 6).TrimmedValue;
|
|
247
|
+
this.aSMAwardFlag = new fixed_string_model_1.FixedString().FromLongString(data, 312, 1).TrimmedValue;
|
|
248
|
+
this.mCPIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 313, 1).TrimmedValue;
|
|
249
|
+
// 41-43
|
|
250
|
+
this.bankCodeList = new fixed_string_model_1.FixedString().FromLongString(data, 314, 3).TrimmedValue;
|
|
251
|
+
this.reserved5 = new fixed_string_model_1.FixedString().FromLongString(data, 317, 5).TrimmedValue;
|
|
252
|
+
this.hGData = new fixed_string_model_1.FixedString().FromLongString(data, 322, 78).TrimmedValue;
|
|
253
|
+
//#endregion
|
|
254
|
+
}
|
|
255
|
+
ToString() {
|
|
256
|
+
this.FillNCCCV3PRequest();
|
|
257
|
+
//#region Set fields: TNect to NCCC/V3P request
|
|
258
|
+
const totalAmountString = (this.totalAmount * 100).toString().padStart(12, '0');
|
|
259
|
+
this.transType = this.TradeTypeToString();
|
|
260
|
+
this.cUPSmartPayESVCIndicator = this.PaymentCardTypeToStrings(false).cUPSmartPayESVCIndicator;
|
|
261
|
+
this.hostId = this.PaymentCardTypeToStrings(false).hostId;
|
|
262
|
+
this.transDate = RefundDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
263
|
+
this.transTime = RefundDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
264
|
+
this.targetTradeTime = RefundDataNCCCV3P.ToDate(this.targetTradeUnixTime);
|
|
265
|
+
this.creditCardApprovalNo = this.TransactionIdToStrings().creditCardApprovalNo;
|
|
266
|
+
this.aTSETicketTransactionId = this.TransactionIdToStrings().aTSETicketTransactionId;
|
|
267
|
+
this.waveCardContactlessIndicator = null;
|
|
268
|
+
this.cardType = null;
|
|
269
|
+
this.eCRResponseCode = null;
|
|
270
|
+
const eTicketBalanceBeforeTradeString = null;
|
|
271
|
+
const eTicketBalanceAfterTradeString = null;
|
|
272
|
+
const eTicketChargeAmountString = null;
|
|
273
|
+
return '' +
|
|
274
|
+
// 1-5
|
|
275
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
276
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
277
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transTypeIndicator, 1).Value +
|
|
278
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
279
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cUPSmartPayESVCIndicator, 1).Value +
|
|
280
|
+
// 6-10
|
|
281
|
+
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
282
|
+
new fixed_string_model_1.FixedString().FromShortString(this.receiptNo, 6).Value +
|
|
283
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardNo, 19).Value +
|
|
284
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardExpireDate, 4).Value +
|
|
285
|
+
new fixed_string_model_1.FixedString().FromShortString(totalAmountString, 12).Value +
|
|
286
|
+
// 11-15
|
|
287
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
288
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
289
|
+
new fixed_string_model_1.FixedString().FromShortString(this.creditCardApprovalNo, 9).Value +
|
|
290
|
+
new fixed_string_model_1.FixedString().FromShortString(this.waveCardContactlessIndicator, 1).Value +
|
|
291
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
292
|
+
// 16-20
|
|
293
|
+
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
294
|
+
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
295
|
+
new fixed_string_model_1.FixedString().FromShortString(this.expAmount, 12).Value +
|
|
296
|
+
new fixed_string_model_1.FixedString().FromShortString(this.storeId, 18).Value +
|
|
297
|
+
new fixed_string_model_1.FixedString().FromShortString(this.installmentRedeemIndicator, 1).Value +
|
|
298
|
+
// 21-25
|
|
299
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemPaidAmt, 12).Value +
|
|
300
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemPoint, 8).Value +
|
|
301
|
+
new fixed_string_model_1.FixedString().FromShortString(this.pointsOfBalance, 8).Value +
|
|
302
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemAmt, 12).Value +
|
|
303
|
+
new fixed_string_model_1.FixedString().FromShortString(this.installmentPeriod, 2).Value +
|
|
304
|
+
// 26-30
|
|
305
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceBeforeTradeString, 12).Value +
|
|
306
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceAfterTradeString, 12).Value +
|
|
307
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketChargeAmountString, 12).Value +
|
|
308
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardType, 2).Value +
|
|
309
|
+
new fixed_string_model_1.FixedString().FromShortString(this.batchNo, 6).Value +
|
|
310
|
+
// 31-35
|
|
311
|
+
new fixed_string_model_1.FixedString().FromShortString(this.startTransType, 2).Value +
|
|
312
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mPFlag, 1).Value +
|
|
313
|
+
new fixed_string_model_1.FixedString().FromShortString(this.sPIssuerId, 8).Value +
|
|
314
|
+
new fixed_string_model_1.FixedString().FromShortString(this.targetTradeTime, 8).Value +
|
|
315
|
+
new fixed_string_model_1.FixedString().FromShortString(this.aTSETicketTransactionId, 12).Value +
|
|
316
|
+
// 36-40
|
|
317
|
+
new fixed_string_model_1.FixedString().FromShortString(this.payItem, 5).Value +
|
|
318
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardNoHashValue, 50).Value +
|
|
319
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mPResponseCode, 6).Value +
|
|
320
|
+
new fixed_string_model_1.FixedString().FromShortString(this.aSMAwardFlag, 1).Value +
|
|
321
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mCPIndicator, 1).Value +
|
|
322
|
+
// 41-43
|
|
323
|
+
new fixed_string_model_1.FixedString().FromShortString(this.bankCodeList, 3).Value +
|
|
324
|
+
new fixed_string_model_1.FixedString().FromShortString(this.reserved5, 5).Value +
|
|
325
|
+
new fixed_string_model_1.FixedString().FromShortString(this.hGData, 78).Value +
|
|
326
|
+
'';
|
|
327
|
+
//#endregion
|
|
328
|
+
}
|
|
329
|
+
FillNCCCV3PRequest() {
|
|
330
|
+
this.eCRIndicator = 'I';
|
|
331
|
+
this.tradeType = RefundDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.refund];
|
|
332
|
+
this.aSMAwardFlag = ' ';
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
exports.RefundDataNCCCV3P = RefundDataNCCCV3P;
|
|
336
|
+
/**
|
|
337
|
+
* @Deprecated - Please import from HAL
|
|
338
|
+
*/
|
|
339
|
+
class SettlementDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
340
|
+
constructor() {
|
|
341
|
+
super();
|
|
342
|
+
}
|
|
343
|
+
transformDataForRequest(data) {
|
|
344
|
+
this.paymentCardType = data.paymentCardType;
|
|
345
|
+
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
346
|
+
}
|
|
347
|
+
transformDataForResponse(data) {
|
|
348
|
+
if (!data) {
|
|
349
|
+
this.isSuccess = false;
|
|
350
|
+
this.retry = true;
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
//#region Set fields: NCCC/V3P response to TNect
|
|
354
|
+
// 1-5
|
|
355
|
+
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
356
|
+
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
357
|
+
this.reserved1 = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
358
|
+
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
359
|
+
this.StringToTradeType(this.transType);
|
|
360
|
+
this.settlementIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
361
|
+
// 6-10
|
|
362
|
+
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
363
|
+
this.StringToPaymentCardType(this.settlementIndicator, this.hostId);
|
|
364
|
+
this.reserved25 = new fixed_string_model_1.FixedString().FromLongString(data, 13, 25).TrimmedValue;
|
|
365
|
+
this.creditCardTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).ValueAsInt;
|
|
366
|
+
this.creditCardTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
367
|
+
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
368
|
+
// 11-15
|
|
369
|
+
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
370
|
+
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
371
|
+
this.reserved10 = new fixed_string_model_1.FixedString().FromLongString(data, 66, 10).TrimmedValue;
|
|
372
|
+
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
373
|
+
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
374
|
+
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
375
|
+
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
376
|
+
// 16-20
|
|
377
|
+
this.easyCardTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 103, 3).ValueAsInt;
|
|
378
|
+
this.easyCardTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 106, 10).ValueAsDouble / 100;
|
|
379
|
+
this.iPassTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 116, 3).ValueAsInt;
|
|
380
|
+
this.iPassTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 119, 10).ValueAsDouble / 100;
|
|
381
|
+
this.iCashTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 129, 3).ValueAsInt;
|
|
382
|
+
// 21-24
|
|
383
|
+
this.iCashTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 132, 10).ValueAsDouble / 100;
|
|
384
|
+
this.happyCashTotalTradeNumbers = new fixed_string_model_1.FixedString().FromLongString(data, 142, 3).ValueAsInt;
|
|
385
|
+
this.happyCashTotalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 145, 10).ValueAsDouble / 100;
|
|
386
|
+
this.reserved245 = new fixed_string_model_1.FixedString().FromLongString(data, 155, 245).TrimmedValue;
|
|
387
|
+
//#endregion
|
|
388
|
+
}
|
|
389
|
+
ToString() {
|
|
390
|
+
this.FillNCCCV3PRequest();
|
|
391
|
+
//#region Set fields: TNect to NCCC/V3P request
|
|
392
|
+
this.transType = this.TradeTypeToString();
|
|
393
|
+
this.settlementIndicator = this.PaymentCardTypeToStrings(true).cUPSmartPayESVCIndicator;
|
|
394
|
+
this.hostId = this.PaymentCardTypeToStrings(true).hostId;
|
|
395
|
+
this.transDate = SettlementDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
396
|
+
this.transTime = SettlementDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
397
|
+
this.eCRResponseCode = null;
|
|
398
|
+
const creditCardTotalTradeNumbers = null;
|
|
399
|
+
const creditCardTotalAmount = null;
|
|
400
|
+
const easyCardTotalTradeNumbers = null;
|
|
401
|
+
const easyCardTotalAmount = null;
|
|
402
|
+
const iPassTotalTradeNumbers = null;
|
|
403
|
+
const iPassTotalAmount = null;
|
|
404
|
+
const iCashTotalTradeNumbers = null;
|
|
405
|
+
const iCashTotalAmount = null;
|
|
406
|
+
const happyCashTotalTradeNumbers = null;
|
|
407
|
+
const happyCashTotalAmount = null;
|
|
408
|
+
return '' +
|
|
409
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
410
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
411
|
+
new fixed_string_model_1.FixedString().FromShortString(this.reserved1, 1).Value +
|
|
412
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
413
|
+
new fixed_string_model_1.FixedString().FromShortString(this.settlementIndicator, 1).Value +
|
|
414
|
+
// 6-10
|
|
415
|
+
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
416
|
+
new fixed_string_model_1.FixedString().FromShortString(this.reserved25, 25).Value +
|
|
417
|
+
new fixed_string_model_1.FixedString().FromShortString(creditCardTotalTradeNumbers, 4).Value +
|
|
418
|
+
new fixed_string_model_1.FixedString().FromShortString(creditCardTotalAmount, 12).Value +
|
|
419
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
420
|
+
// 11-15
|
|
421
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
422
|
+
new fixed_string_model_1.FixedString().FromShortString(this.reserved10, 10).Value +
|
|
423
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
424
|
+
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
425
|
+
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
426
|
+
// 16-20
|
|
427
|
+
new fixed_string_model_1.FixedString().FromShortString(easyCardTotalTradeNumbers, 3).Value +
|
|
428
|
+
new fixed_string_model_1.FixedString().FromShortString(easyCardTotalAmount, 10).Value +
|
|
429
|
+
new fixed_string_model_1.FixedString().FromShortString(iPassTotalTradeNumbers, 3).Value +
|
|
430
|
+
new fixed_string_model_1.FixedString().FromShortString(iPassTotalAmount, 10).Value +
|
|
431
|
+
new fixed_string_model_1.FixedString().FromShortString(iCashTotalTradeNumbers, 3).Value +
|
|
432
|
+
// 21-24
|
|
433
|
+
new fixed_string_model_1.FixedString().FromShortString(iCashTotalAmount, 10).Value +
|
|
434
|
+
new fixed_string_model_1.FixedString().FromShortString(happyCashTotalTradeNumbers, 3).Value +
|
|
435
|
+
new fixed_string_model_1.FixedString().FromShortString(happyCashTotalAmount, 10).Value +
|
|
436
|
+
new fixed_string_model_1.FixedString().FromShortString(this.reserved245, 245).Value +
|
|
437
|
+
'';
|
|
438
|
+
//#endregion
|
|
439
|
+
}
|
|
440
|
+
FillNCCCV3PRequest() {
|
|
441
|
+
this.eCRIndicator = 'I';
|
|
442
|
+
this.tradeType = SettlementDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.settlement];
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
exports.SettlementDataNCCCV3P = SettlementDataNCCCV3P;
|
|
446
|
+
/**
|
|
447
|
+
* @Deprecated - Please import from HAL
|
|
448
|
+
*/
|
|
449
|
+
class RetryDataNCCCV3P extends payment_machine_union_model_1.PaymentMachineCommunicationModel {
|
|
450
|
+
constructor() {
|
|
451
|
+
super();
|
|
452
|
+
}
|
|
453
|
+
transformDataForRequest(data) {
|
|
454
|
+
// [Pay] fields
|
|
455
|
+
this.paymentCardType = data.paymentCardType;
|
|
456
|
+
this.totalAmount = data.totalAmount;
|
|
457
|
+
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
458
|
+
// [Refund] fields
|
|
459
|
+
this.paymentCardType = data.paymentCardType;
|
|
460
|
+
this.totalAmount = data.totalAmount;
|
|
461
|
+
this.transactionId = data.transactionId;
|
|
462
|
+
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
463
|
+
this.targetTradeUnixTime = data.targetTradeUnixTime;
|
|
464
|
+
// [Settlement] fields
|
|
465
|
+
this.paymentCardType = data.paymentCardType;
|
|
466
|
+
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
467
|
+
// [Retry] fields
|
|
468
|
+
this.retryTradeType = data.retryTradeType;
|
|
469
|
+
this.currentTradeUnixTime = data.currentTradeUnixTime;
|
|
470
|
+
}
|
|
471
|
+
transformDataForResponse(data) {
|
|
472
|
+
if (!data) {
|
|
473
|
+
this.isSuccess = false;
|
|
474
|
+
this.retry = true;
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
//#region Set fields: NCCC/V3P response to TNect
|
|
478
|
+
// 1-5
|
|
479
|
+
this.eCRIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 0, 1).TrimmedValue;
|
|
480
|
+
this.eCRVersion = new fixed_string_model_1.FixedString().FromLongString(data, 1, 6).TrimmedValue;
|
|
481
|
+
this.transTypeIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 7, 1).TrimmedValue;
|
|
482
|
+
this.transType = new fixed_string_model_1.FixedString().FromLongString(data, 8, 2).TrimmedValue;
|
|
483
|
+
this.StringToTradeType(this.transType);
|
|
484
|
+
this.cUPSmartPayESVCIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 10, 1).TrimmedValue;
|
|
485
|
+
// 6-10
|
|
486
|
+
this.hostId = new fixed_string_model_1.FixedString().FromLongString(data, 11, 2).TrimmedValue;
|
|
487
|
+
this.StringToPaymentCardType(this.cUPSmartPayESVCIndicator, this.hostId);
|
|
488
|
+
this.receiptNo = new fixed_string_model_1.FixedString().FromLongString(data, 13, 6).TrimmedValue;
|
|
489
|
+
this.cardNo = new fixed_string_model_1.FixedString().FromLongString(data, 19, 19).TrimmedValue;
|
|
490
|
+
this.cardExpireDate = new fixed_string_model_1.FixedString().FromLongString(data, 38, 4).TrimmedValue;
|
|
491
|
+
this.totalAmount = new fixed_string_model_1.FixedString().FromLongString(data, 42, 12).ValueAsDouble / 100;
|
|
492
|
+
// 11-15
|
|
493
|
+
this.transDate = new fixed_string_model_1.FixedString().FromLongString(data, 54, 6).TrimmedValue;
|
|
494
|
+
this.transTime = new fixed_string_model_1.FixedString().FromLongString(data, 60, 6).TrimmedValue;
|
|
495
|
+
this.StringToCurrentTradeUnixTime(this.transDate, this.transTime);
|
|
496
|
+
this.creditCardApprovalNo = new fixed_string_model_1.FixedString().FromLongString(data, 66, 9).TrimmedValue;
|
|
497
|
+
this.waveCardContactlessIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 75, 1).TrimmedValue;
|
|
498
|
+
this.eCRResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 76, 4).TrimmedValue;
|
|
499
|
+
this.GetNCCCV3PResponseMessage(this.eCRResponseCode);
|
|
500
|
+
// 16-20
|
|
501
|
+
this.merchantId = new fixed_string_model_1.FixedString().FromLongString(data, 80, 15).TrimmedValue;
|
|
502
|
+
this.terminalId = new fixed_string_model_1.FixedString().FromLongString(data, 95, 8).TrimmedValue;
|
|
503
|
+
this.expAmount = new fixed_string_model_1.FixedString().FromLongString(data, 103, 12).TrimmedValue;
|
|
504
|
+
this.storeId = new fixed_string_model_1.FixedString().FromLongString(data, 115, 18).TrimmedValue;
|
|
505
|
+
this.installmentRedeemIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 133, 1).TrimmedValue;
|
|
506
|
+
// 21-25
|
|
507
|
+
this.redeemPaidAmt = new fixed_string_model_1.FixedString().FromLongString(data, 134, 12).TrimmedValue;
|
|
508
|
+
this.redeemPoint = new fixed_string_model_1.FixedString().FromLongString(data, 146, 8).TrimmedValue;
|
|
509
|
+
this.pointsOfBalance = new fixed_string_model_1.FixedString().FromLongString(data, 154, 8).TrimmedValue;
|
|
510
|
+
this.redeemAmt = new fixed_string_model_1.FixedString().FromLongString(data, 162, 12).TrimmedValue;
|
|
511
|
+
this.installmentPeriod = new fixed_string_model_1.FixedString().FromLongString(data, 174, 2).TrimmedValue;
|
|
512
|
+
// 26-30
|
|
513
|
+
this.eTicketBalanceBeforeTrade = new fixed_string_model_1.FixedString().FromLongString(data, 176, 12).ValueAsDouble / 100;
|
|
514
|
+
this.eTicketBalanceAfterTrade = new fixed_string_model_1.FixedString().FromLongString(data, 188, 12).ValueAsDouble / 100;
|
|
515
|
+
this.eTicketChargeAmount = new fixed_string_model_1.FixedString().FromLongString(data, 200, 12).ValueAsDouble / 100;
|
|
516
|
+
this.cardType = new fixed_string_model_1.FixedString().FromLongString(data, 212, 2).TrimmedValue;
|
|
517
|
+
this.StringToPaymentCardDetailedType(this.cardType);
|
|
518
|
+
this.batchNo = new fixed_string_model_1.FixedString().FromLongString(data, 214, 6).TrimmedValue;
|
|
519
|
+
// 31-35
|
|
520
|
+
this.startTransType = new fixed_string_model_1.FixedString().FromLongString(data, 220, 2).TrimmedValue;
|
|
521
|
+
this.StringToRetryTradeType(this.startTransType);
|
|
522
|
+
this.mPFlag = new fixed_string_model_1.FixedString().FromLongString(data, 222, 1).TrimmedValue;
|
|
523
|
+
this.sPIssuerId = new fixed_string_model_1.FixedString().FromLongString(data, 223, 8).TrimmedValue;
|
|
524
|
+
this.targetTradeTime = new fixed_string_model_1.FixedString().FromLongString(data, 231, 8).TrimmedValue;
|
|
525
|
+
this.StringToTargetTradeUnixTime(this.targetTradeTime);
|
|
526
|
+
this.aTSETicketTransactionId = new fixed_string_model_1.FixedString().FromLongString(data, 239, 12).TrimmedValue;
|
|
527
|
+
this.StringToTransactionId(this.creditCardApprovalNo, this.aTSETicketTransactionId);
|
|
528
|
+
// 36-40
|
|
529
|
+
this.payItem = new fixed_string_model_1.FixedString().FromLongString(data, 251, 5).TrimmedValue;
|
|
530
|
+
this.cardNoHashValue = new fixed_string_model_1.FixedString().FromLongString(data, 256, 50).TrimmedValue;
|
|
531
|
+
this.mPResponseCode = new fixed_string_model_1.FixedString().FromLongString(data, 306, 6).TrimmedValue;
|
|
532
|
+
this.aSMAwardFlag = new fixed_string_model_1.FixedString().FromLongString(data, 312, 1).TrimmedValue;
|
|
533
|
+
this.mCPIndicator = new fixed_string_model_1.FixedString().FromLongString(data, 313, 1).TrimmedValue;
|
|
534
|
+
// 41-43
|
|
535
|
+
this.bankCodeList = new fixed_string_model_1.FixedString().FromLongString(data, 314, 3).TrimmedValue;
|
|
536
|
+
this.reserved5 = new fixed_string_model_1.FixedString().FromLongString(data, 317, 5).TrimmedValue;
|
|
537
|
+
this.hGData = new fixed_string_model_1.FixedString().FromLongString(data, 322, 78).TrimmedValue;
|
|
538
|
+
//#endregion
|
|
539
|
+
}
|
|
540
|
+
ToString() {
|
|
541
|
+
this.FillNCCCV3PRequest();
|
|
542
|
+
//#region Set fields: TNect to NCCC/V3P request
|
|
543
|
+
const totalAmountString = (this.totalAmount * 100).toString().padStart(12, '0');
|
|
544
|
+
this.transType = this.TradeTypeToString();
|
|
545
|
+
this.cUPSmartPayESVCIndicator = this.PaymentCardTypeToStrings(false).cUPSmartPayESVCIndicator;
|
|
546
|
+
this.hostId = this.PaymentCardTypeToStrings(false).hostId;
|
|
547
|
+
this.transDate = RetryDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).date;
|
|
548
|
+
this.transTime = RetryDataNCCCV3P.ToDateTime(this.currentTradeUnixTime).time;
|
|
549
|
+
this.targetTradeTime = RetryDataNCCCV3P.ToDate(this.targetTradeUnixTime);
|
|
550
|
+
this.creditCardApprovalNo = this.TransactionIdToStrings().creditCardApprovalNo;
|
|
551
|
+
this.aTSETicketTransactionId = this.TransactionIdToStrings().aTSETicketTransactionId;
|
|
552
|
+
this.waveCardContactlessIndicator = null;
|
|
553
|
+
this.cardType = null;
|
|
554
|
+
this.eCRResponseCode = null;
|
|
555
|
+
const eTicketBalanceBeforeTradeString = null;
|
|
556
|
+
const eTicketBalanceAfterTradeString = null;
|
|
557
|
+
const eTicketChargeAmountString = null;
|
|
558
|
+
this.startTransType = this.RetryTradeTypeToString();
|
|
559
|
+
return '' +
|
|
560
|
+
// 1-5
|
|
561
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRIndicator, 1).Value +
|
|
562
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRVersion, 6).Value +
|
|
563
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transTypeIndicator, 1).Value +
|
|
564
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transType, 2).Value +
|
|
565
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cUPSmartPayESVCIndicator, 1).Value +
|
|
566
|
+
// 6-10
|
|
567
|
+
new fixed_string_model_1.FixedString().FromShortString(this.hostId, 2).Value +
|
|
568
|
+
new fixed_string_model_1.FixedString().FromShortString(this.receiptNo, 6).Value +
|
|
569
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardNo, 19).Value +
|
|
570
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardExpireDate, 4).Value +
|
|
571
|
+
new fixed_string_model_1.FixedString().FromShortString(totalAmountString, 12).Value +
|
|
572
|
+
// 11-15
|
|
573
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transDate, 6).Value +
|
|
574
|
+
new fixed_string_model_1.FixedString().FromShortString(this.transTime, 6).Value +
|
|
575
|
+
new fixed_string_model_1.FixedString().FromShortString(this.creditCardApprovalNo, 9).Value +
|
|
576
|
+
new fixed_string_model_1.FixedString().FromShortString(this.waveCardContactlessIndicator, 1).Value +
|
|
577
|
+
new fixed_string_model_1.FixedString().FromShortString(this.eCRResponseCode, 4).Value +
|
|
578
|
+
// 16-20
|
|
579
|
+
new fixed_string_model_1.FixedString().FromShortString(this.merchantId, 15).Value +
|
|
580
|
+
new fixed_string_model_1.FixedString().FromShortString(this.terminalId, 8).Value +
|
|
581
|
+
new fixed_string_model_1.FixedString().FromShortString(this.expAmount, 12).Value +
|
|
582
|
+
new fixed_string_model_1.FixedString().FromShortString(this.storeId, 18).Value +
|
|
583
|
+
new fixed_string_model_1.FixedString().FromShortString(this.installmentRedeemIndicator, 1).Value +
|
|
584
|
+
// 21-25
|
|
585
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemPaidAmt, 12).Value +
|
|
586
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemPoint, 8).Value +
|
|
587
|
+
new fixed_string_model_1.FixedString().FromShortString(this.pointsOfBalance, 8).Value +
|
|
588
|
+
new fixed_string_model_1.FixedString().FromShortString(this.redeemAmt, 12).Value +
|
|
589
|
+
new fixed_string_model_1.FixedString().FromShortString(this.installmentPeriod, 2).Value +
|
|
590
|
+
// 26-30
|
|
591
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceBeforeTradeString, 12).Value +
|
|
592
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketBalanceAfterTradeString, 12).Value +
|
|
593
|
+
new fixed_string_model_1.FixedString().FromShortString(eTicketChargeAmountString, 12).Value +
|
|
594
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardType, 2).Value +
|
|
595
|
+
new fixed_string_model_1.FixedString().FromShortString(this.batchNo, 6).Value +
|
|
596
|
+
// 31-35
|
|
597
|
+
new fixed_string_model_1.FixedString().FromShortString(this.startTransType, 2).Value +
|
|
598
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mPFlag, 1).Value +
|
|
599
|
+
new fixed_string_model_1.FixedString().FromShortString(this.sPIssuerId, 8).Value +
|
|
600
|
+
new fixed_string_model_1.FixedString().FromShortString(this.targetTradeTime, 8).Value +
|
|
601
|
+
new fixed_string_model_1.FixedString().FromShortString(this.aTSETicketTransactionId, 12).Value +
|
|
602
|
+
// 36-40
|
|
603
|
+
new fixed_string_model_1.FixedString().FromShortString(this.payItem, 5).Value +
|
|
604
|
+
new fixed_string_model_1.FixedString().FromShortString(this.cardNoHashValue, 50).Value +
|
|
605
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mPResponseCode, 6).Value +
|
|
606
|
+
new fixed_string_model_1.FixedString().FromShortString(this.aSMAwardFlag, 1).Value +
|
|
607
|
+
new fixed_string_model_1.FixedString().FromShortString(this.mCPIndicator, 1).Value +
|
|
608
|
+
// 41-43
|
|
609
|
+
new fixed_string_model_1.FixedString().FromShortString(this.bankCodeList, 3).Value +
|
|
610
|
+
new fixed_string_model_1.FixedString().FromShortString(this.reserved5, 5).Value +
|
|
611
|
+
new fixed_string_model_1.FixedString().FromShortString(this.hGData, 78).Value +
|
|
612
|
+
'';
|
|
613
|
+
//#endregion
|
|
614
|
+
}
|
|
615
|
+
FillNCCCV3PRequest() {
|
|
616
|
+
this.eCRIndicator = 'I';
|
|
617
|
+
this.tradeType = RetryDataNCCCV3P.tradeTypeString[payment_machine_1.PaymentMachineActionEnum.retry];
|
|
618
|
+
this.aSMAwardFlag = ' ';
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
exports.RetryDataNCCCV3P = RetryDataNCCCV3P;
|
|
622
622
|
//# sourceMappingURL=payment-machine-v3p.model.js.map
|