@evoke-platform/payment 1.0.0-dev.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 System Automation Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the “Software”), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export * from './payment';
2
+ export * from './paymentGateway';
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ // Copyright (c) 2023 System Automation Corporation.
2
+ // This file is licensed under the MIT License.
3
+ export * from './payment';
4
+ export * from './paymentGateway';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,83 @@
1
+ export type PaymentStatus = 'NotStarted' | 'InProgress' | 'Cancelled' | 'Declined' | 'Paid';
2
+ export type PaymentMethod = 'CreditCard' | 'eCheck' | 'Cash' | 'Check';
3
+ export type CreditCardType = 'Visa' | 'Mastercard' | 'Discover' | 'AmericanExpress';
4
+ export type PaymentReference = {
5
+ id: string;
6
+ name: string;
7
+ };
8
+ export interface PaymentItem {
9
+ id: string;
10
+ /**
11
+ * Description of the payment item.
12
+ */
13
+ name: string;
14
+ contextObjectId?: string;
15
+ contextInstanceId?: string;
16
+ quantity: number;
17
+ unitPrice: number;
18
+ sku: string;
19
+ /**
20
+ * Total amount for the item based on the quantity and unit price.
21
+ */
22
+ totalAmount?: number;
23
+ /**
24
+ * Refernce to the payment that this item is associated with.
25
+ */
26
+ payment?: PaymentReference;
27
+ customField1?: string;
28
+ customField2?: string;
29
+ customField3?: string;
30
+ customField4?: string;
31
+ customField5?: string;
32
+ }
33
+ export interface Payment {
34
+ id: string;
35
+ /**
36
+ * Payment number associted with the transaction.
37
+ */
38
+ name: string;
39
+ /**
40
+ * User initiating the payment transaction.
41
+ */
42
+ userId: string;
43
+ status: PaymentStatus;
44
+ contextObjectId?: string;
45
+ contextInstanceId?: string;
46
+ /**
47
+ * Timestamp when the payment transaction was started in ISO date time format.
48
+ */
49
+ transactionStart?: string;
50
+ /**
51
+ * Timestamp when the payment transaction was completed in ISO date time
52
+ * format.
53
+ */
54
+ transactionEnd?: string;
55
+ /**
56
+ * Total fees associated with the payment based on the payment items.
57
+ */
58
+ feeTotal?: number;
59
+ paymentItems?: PaymentItem[];
60
+ successUrl?: string;
61
+ cancelUrl?: string;
62
+ customField1?: string;
63
+ customField2?: string;
64
+ customField3?: string;
65
+ customField4?: string;
66
+ customField5?: string;
67
+ customField6?: string;
68
+ customField7?: string;
69
+ customField8?: string;
70
+ customField9?: string;
71
+ customField10?: string;
72
+ method?: PaymentMethod;
73
+ cardType?: CreditCardType;
74
+ amountPaid?: number;
75
+ /**
76
+ * Name of the person paying for the transaction.
77
+ */
78
+ payer?: string;
79
+ gatewayTransactionId?: string;
80
+ gatewayResultCode?: string;
81
+ gatewayResultMessage?: string;
82
+ authorizationCode?: string;
83
+ }
@@ -0,0 +1,4 @@
1
+ // Copyright (c) 2023 System Automation Corporation.
2
+ // This file is licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=payment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.js","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C"}
@@ -0,0 +1,13 @@
1
+ import { Payment } from './payment';
2
+ export interface ParsedQueryString {
3
+ [key: string]: undefined | string | string[] | ParsedQueryString | ParsedQueryString[];
4
+ }
5
+ export interface TransferData {
6
+ method: 'GET' | 'POST';
7
+ url: string;
8
+ parameters: Record<string, string>;
9
+ }
10
+ export interface PaymentGateway {
11
+ prepare(payment: Payment, returnUrl: string): TransferData | PromiseLike<TransferData>;
12
+ postPaymentResult(payment: Payment, resultData: ParsedQueryString): Payment | null | PromiseLike<Payment | null>;
13
+ }
@@ -0,0 +1,4 @@
1
+ // Copyright (c) 2023 System Automation Corporation.
2
+ // This file is licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=paymentGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentGateway.js","sourceRoot":"","sources":["../src/paymentGateway.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C"}
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@evoke-platform/payment",
3
+ "version": "1.0.0-dev.1",
4
+ "description": "Support for payment gateway integrations in Evoke",
5
+ "homepage": "https://github.com/Evoke-Platform/evoke-sdk/blob/main/packages/payment/README.md",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Evoke-Platform/evoke-sdk",
9
+ "directory": "packages/payment"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/Evoke-Platform/evoke-sdk/issues"
13
+ },
14
+ "main": "dist/index.js",
15
+ "types": "dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "scripts": {
23
+ "build": "tsc",
24
+ "release": "commit-and-tag-version -t payment@ --releaseCommitMessageFormat \"chore(release): payment@{{currentTag}} [skip ci]\"",
25
+ "predeploy": "cp ../../LICENSE .",
26
+ "deploy": "npm publish"
27
+ },
28
+ "author": "System Automation Corp.",
29
+ "license": "MIT",
30
+ "devDependencies": {
31
+ "commit-and-tag-version": "^11.2.2",
32
+ "typescript": "^5.1.6"
33
+ }
34
+ }