skipcash-reactnative 0.0.2
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 +20 -0
- package/README.md +334 -0
- package/android/build.gradle +183 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/skipcashreactnative/ModalActivity.java +128 -0
- package/android/src/main/java/com/skipcashreactnative/SkipcashReactnativeModule.java +361 -0
- package/android/src/main/java/com/skipcashreactnative/SkipcashReactnativePackage.kt +18 -0
- package/android/src/main/res/layout/activity_modal.xml +59 -0
- package/ios/Resource/main.storyboard +45 -0
- package/ios/SkipcashReactnative-Bridging-Header.h +2 -0
- package/ios/SkipcashReactnative.mm +18 -0
- package/ios/SkipcashReactnative.swift +994 -0
- package/lib/commonjs/index.js +367 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/index.js +355 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +142 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/index.d.ts +142 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +187 -0
- package/skipcash-reactnative.podspec +43 -0
- package/src/index.tsx +445 -0
package/package.json
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skipcash-reactnative",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "integrate skipcash in react native app.",
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"module": "./lib/module/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"lib",
|
|
23
|
+
"android",
|
|
24
|
+
"ios",
|
|
25
|
+
"cpp",
|
|
26
|
+
"*.podspec",
|
|
27
|
+
"!ios/build",
|
|
28
|
+
"!android/build",
|
|
29
|
+
"!android/gradle",
|
|
30
|
+
"!android/gradlew",
|
|
31
|
+
"!android/gradlew.bat",
|
|
32
|
+
"!android/local.properties",
|
|
33
|
+
"!**/__tests__",
|
|
34
|
+
"!**/__fixtures__",
|
|
35
|
+
"!**/__mocks__",
|
|
36
|
+
"!**/.*"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"example": "yarn workspace skipcash-reactnative-example",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"typecheck": "tsc",
|
|
42
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
43
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
44
|
+
"prepare": "bob build",
|
|
45
|
+
"release": "release-it"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"react-native",
|
|
49
|
+
"ios",
|
|
50
|
+
"android"
|
|
51
|
+
],
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/SkipCash/skipcash-reactnative.git"
|
|
55
|
+
},
|
|
56
|
+
"author": "SkipCash <support@skipcash.com> (https://skipcash.app/)",
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/SkipCash/skipcash-reactnative/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/SkipCash/skipcash-reactnative#readme",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"registry": "https://registry.npmjs.org/"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
67
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
68
|
+
"@react-native/eslint-config": "^0.73.1",
|
|
69
|
+
"@release-it/conventional-changelog": "^5.0.0",
|
|
70
|
+
"@types/jest": "^29.5.5",
|
|
71
|
+
"@types/react": "^18.2.44",
|
|
72
|
+
"commitlint": "^17.0.2",
|
|
73
|
+
"del-cli": "^5.1.0",
|
|
74
|
+
"eslint": "^8.51.0",
|
|
75
|
+
"eslint-config-prettier": "^9.0.0",
|
|
76
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
77
|
+
"jest": "^29.7.0",
|
|
78
|
+
"prettier": "^3.0.3",
|
|
79
|
+
"react": "18.3.1",
|
|
80
|
+
"react-native": "0.75.2",
|
|
81
|
+
"react-native-builder-bob": "^0.30.0",
|
|
82
|
+
"release-it": "^15.0.0",
|
|
83
|
+
"turbo": "^1.10.7",
|
|
84
|
+
"typescript": "^5.2.2"
|
|
85
|
+
},
|
|
86
|
+
"resolutions": {
|
|
87
|
+
"@types/react": "^18.2.44"
|
|
88
|
+
},
|
|
89
|
+
"peerDependencies": {
|
|
90
|
+
"react": "*",
|
|
91
|
+
"react-native": "*"
|
|
92
|
+
},
|
|
93
|
+
"workspaces": [
|
|
94
|
+
"example"
|
|
95
|
+
],
|
|
96
|
+
"packageManager": "yarn@3.6.1",
|
|
97
|
+
"jest": {
|
|
98
|
+
"preset": "react-native",
|
|
99
|
+
"modulePathIgnorePatterns": [
|
|
100
|
+
"<rootDir>/example/node_modules",
|
|
101
|
+
"<rootDir>/lib/"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"commitlint": {
|
|
105
|
+
"extends": [
|
|
106
|
+
"@commitlint/config-conventional"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"release-it": {
|
|
110
|
+
"git": {
|
|
111
|
+
"commitMessage": "chore: release ${version}",
|
|
112
|
+
"tagName": "v${version}"
|
|
113
|
+
},
|
|
114
|
+
"npm": {
|
|
115
|
+
"publish": true
|
|
116
|
+
},
|
|
117
|
+
"github": {
|
|
118
|
+
"release": true
|
|
119
|
+
},
|
|
120
|
+
"plugins": {
|
|
121
|
+
"@release-it/conventional-changelog": {
|
|
122
|
+
"preset": "angular"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"eslintConfig": {
|
|
127
|
+
"root": true,
|
|
128
|
+
"extends": [
|
|
129
|
+
"@react-native",
|
|
130
|
+
"prettier"
|
|
131
|
+
],
|
|
132
|
+
"rules": {
|
|
133
|
+
"react/react-in-jsx-scope": "off",
|
|
134
|
+
"prettier/prettier": [
|
|
135
|
+
"error",
|
|
136
|
+
{
|
|
137
|
+
"quoteProps": "consistent",
|
|
138
|
+
"singleQuote": true,
|
|
139
|
+
"tabWidth": 2,
|
|
140
|
+
"trailingComma": "es5",
|
|
141
|
+
"useTabs": false
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"eslintIgnore": [
|
|
147
|
+
"node_modules/",
|
|
148
|
+
"lib/"
|
|
149
|
+
],
|
|
150
|
+
"prettier": {
|
|
151
|
+
"quoteProps": "consistent",
|
|
152
|
+
"singleQuote": true,
|
|
153
|
+
"tabWidth": 2,
|
|
154
|
+
"trailingComma": "es5",
|
|
155
|
+
"useTabs": false
|
|
156
|
+
},
|
|
157
|
+
"react-native-builder-bob": {
|
|
158
|
+
"source": "src",
|
|
159
|
+
"output": "lib",
|
|
160
|
+
"targets": [
|
|
161
|
+
[
|
|
162
|
+
"commonjs",
|
|
163
|
+
{
|
|
164
|
+
"esm": true
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
[
|
|
168
|
+
"module",
|
|
169
|
+
{
|
|
170
|
+
"esm": true
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
"typescript",
|
|
175
|
+
{
|
|
176
|
+
"project": "tsconfig.build.json",
|
|
177
|
+
"esm": true
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"create-react-native-library": {
|
|
183
|
+
"type": "module-legacy",
|
|
184
|
+
"languages": "kotlin-swift",
|
|
185
|
+
"version": "0.41.0"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |s|
|
|
7
|
+
s.name = "skipcash-reactnative"
|
|
8
|
+
s.version = package["version"]
|
|
9
|
+
s.summary = package["description"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.authors = package["author"]
|
|
13
|
+
|
|
14
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
15
|
+
s.source = { :git => "https://github.com/SkipCash/skipcash-reactnative.git", :tag => "#{s.version}" }
|
|
16
|
+
|
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm,swift,xcframework}"
|
|
18
|
+
# s.frameworks = 'SkipCashSDK'
|
|
19
|
+
# s.vendored_frameworks = 'ios/Frameworks/SkipCashSDK.xcframework'
|
|
20
|
+
|
|
21
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
22
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
23
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
24
|
+
install_modules_dependencies(s)
|
|
25
|
+
else
|
|
26
|
+
s.dependency "React-Core"
|
|
27
|
+
|
|
28
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
29
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
30
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
31
|
+
s.pod_target_xcconfig = {
|
|
32
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
33
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
34
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
35
|
+
}
|
|
36
|
+
s.dependency "React-Codegen"
|
|
37
|
+
s.dependency "RCT-Folly"
|
|
38
|
+
s.dependency "RCTRequired"
|
|
39
|
+
s.dependency "RCTTypeSafety"
|
|
40
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LINKING_ERROR =
|
|
4
|
+
`The package 'skipcash-reactnative' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
+
'- You rebuilt the app after installing the package\n' +
|
|
7
|
+
'- You are not using Expo Go\n';
|
|
8
|
+
|
|
9
|
+
export const SkipcashReactnative = NativeModules.SkipcashReactnative
|
|
10
|
+
? NativeModules.SkipcashReactnative
|
|
11
|
+
: new Proxy(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
get() {
|
|
15
|
+
throw new Error(LINKING_ERROR);
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export function isWalletHasCards(): Promise<boolean> {
|
|
21
|
+
if(Platform.OS === 'ios'){
|
|
22
|
+
return SkipcashReactnative.isWalletHasCards();
|
|
23
|
+
}else{
|
|
24
|
+
console.log(`Method is not implemented for ${Platform.OS} `)
|
|
25
|
+
return Promise.reject(new Error(`Method is not implemented for ${Platform.OS}`))
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function setupNewCard(){
|
|
30
|
+
if(Platform.OS === 'ios'){
|
|
31
|
+
SkipcashReactnative.setupNewCard();
|
|
32
|
+
}else{
|
|
33
|
+
console.log(`Method is not implemented for ${Platform.OS} `)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function initiateApplePay(paymentData: string){
|
|
38
|
+
if(Platform.OS === 'ios'){
|
|
39
|
+
SkipcashReactnative.initiateApplePay(paymentData);
|
|
40
|
+
}else{
|
|
41
|
+
console.log(`Method is not implemented for ${Platform.OS} `)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export function initiatePaymentModel(paymentData: PaymentData){
|
|
47
|
+
|
|
48
|
+
if (Platform.OS === 'android') {
|
|
49
|
+
|
|
50
|
+
const _paymentData_ = {
|
|
51
|
+
"authorizationHeader": paymentData.getAuthorizationHeader(),
|
|
52
|
+
"createPaymentEndpoint": paymentData.getPaymentLinkEndPoint(),
|
|
53
|
+
"returnURL": paymentData.getReturnUrl(),
|
|
54
|
+
"paymentData": {
|
|
55
|
+
"amount": paymentData.getAmount(),
|
|
56
|
+
"firstName": paymentData.getFirstName(),
|
|
57
|
+
"lastName": paymentData.getLastName(),
|
|
58
|
+
"phone": paymentData.getPhone(),
|
|
59
|
+
"email": paymentData.getEmail(),
|
|
60
|
+
"transactionId": paymentData.getTransactionId(),
|
|
61
|
+
"webhookUrl": paymentData.getWebhookUrl(),
|
|
62
|
+
"custom1": paymentData.getCustom1(),
|
|
63
|
+
"custom2": paymentData.getCustom2(),
|
|
64
|
+
"custom3": paymentData.getCustom3(),
|
|
65
|
+
"custom4": paymentData.getCustom4(),
|
|
66
|
+
"custom5": paymentData.getCustom5(),
|
|
67
|
+
"custom6": paymentData.getCustom6(),
|
|
68
|
+
"custom7": paymentData.getCustom7(),
|
|
69
|
+
"custom8": paymentData.getCustom8(),
|
|
70
|
+
"custom9": paymentData.getCustom9(),
|
|
71
|
+
"custom10": paymentData.getCustom10(),
|
|
72
|
+
"description": paymentData.getDescription(),
|
|
73
|
+
"subject": paymentData.getSubject(),
|
|
74
|
+
"merchantName": paymentData.getMerchantName(),
|
|
75
|
+
"headerBackgroundColour": paymentData.getHeaderBackgroundColour(),
|
|
76
|
+
"paymentModalTitle": paymentData.getPaymentModalTitle(),
|
|
77
|
+
"headerTitleColour": paymentData.getHeaderTitleColour(),
|
|
78
|
+
"cancelColour": paymentData.getCancelBtnColour()
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const paymentData_string = JSON.stringify(_paymentData_);
|
|
82
|
+
SkipcashReactnative.initiatePaymentModel(paymentData_string);
|
|
83
|
+
}else if (Platform.OS === 'ios'){
|
|
84
|
+
const paymentData_string = JSON.stringify(paymentData);
|
|
85
|
+
SkipcashReactnative.initiatePaymentModel(paymentData_string);
|
|
86
|
+
}else{
|
|
87
|
+
console.log(`Method is not implemented for ${Platform.OS} `)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface PaymentDataInerface {
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
summaryItems: { [key: string]: string };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export class PaymentData implements PaymentDataInerface {
|
|
97
|
+
private merchantIdentifier: string = '';
|
|
98
|
+
private countryCode: string = 'QA';
|
|
99
|
+
private currencyCode: string = 'QAR';
|
|
100
|
+
private createPaymentLinkEndPoint: string = '';
|
|
101
|
+
private authorizationHeader: string = '';
|
|
102
|
+
private firstName: string = '';
|
|
103
|
+
private lastName: string = '';
|
|
104
|
+
private amount: string = '';
|
|
105
|
+
private phone: string = '';
|
|
106
|
+
private email: string = '';
|
|
107
|
+
private transactionId: string = '';
|
|
108
|
+
private webhookUrl: string = '';
|
|
109
|
+
|
|
110
|
+
private returnUrl: string = '';
|
|
111
|
+
private custom1: string = '';
|
|
112
|
+
private custom2: string = '';
|
|
113
|
+
private custom3: string = '';
|
|
114
|
+
private custom4: string = '';
|
|
115
|
+
private custom5: string = '';
|
|
116
|
+
private custom6: string = '';
|
|
117
|
+
private custom7: string = '';
|
|
118
|
+
private custom8: string = '';
|
|
119
|
+
private custom9: string = '';
|
|
120
|
+
private custom10: string = '';
|
|
121
|
+
private subject: string = '';
|
|
122
|
+
private description: string = '';
|
|
123
|
+
private paymentModalTitle: string = '';
|
|
124
|
+
private headerBackgroundColour: string = '#FFFFFF'; // android
|
|
125
|
+
private headerTitleColour: string = '#000000'; // android
|
|
126
|
+
private cancelColour: string = "#000000"; // android
|
|
127
|
+
|
|
128
|
+
private merchantName: string = "You're Business Name";
|
|
129
|
+
|
|
130
|
+
summaryItems: {[key: string]: string} = {};
|
|
131
|
+
|
|
132
|
+
getCurrencyCode(): string{
|
|
133
|
+
return this.currencyCode;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
getCountryCode(): string{
|
|
137
|
+
return this.countryCode;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setSummaryItem(item: string, amount: string){
|
|
141
|
+
this.summaryItems[`${item}`] = amount;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
getSummaryItem(item: string): any{
|
|
145
|
+
return this.summaryItems[item];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
getAllSummaryItems(): any{
|
|
149
|
+
return this.summaryItems;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
clearSummaryItems(){
|
|
153
|
+
this.summaryItems = {};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
setMerchantIdentifier(mid: string){
|
|
157
|
+
this.merchantIdentifier = mid;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
getMerchantIdentifier(): string{
|
|
161
|
+
return this.merchantIdentifier;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
setPaymentLinkEndPoint(ple: string){
|
|
165
|
+
this.createPaymentLinkEndPoint = ple;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
getPaymentLinkEndPoint(): string{
|
|
169
|
+
return this.createPaymentLinkEndPoint;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
setAuthorizationHeader(authH: string){
|
|
173
|
+
this.authorizationHeader = authH;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
getAuthorizationHeader(): string {
|
|
177
|
+
return this.authorizationHeader;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
setFirstName(fname: string){
|
|
181
|
+
this.firstName = fname;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
getFirstName(): string {
|
|
185
|
+
return this.firstName;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
setLastName(lname: string){
|
|
189
|
+
this.lastName = lname;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
getLastName(): string{
|
|
193
|
+
return this.lastName;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
setAmount(am: string){
|
|
197
|
+
this.amount = am;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
getAmount(): string{
|
|
201
|
+
return this.amount;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
setPhone(p: string){
|
|
205
|
+
this.phone = p;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
getPhone(): string{
|
|
209
|
+
return this.phone;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
setEmail(e: string){
|
|
213
|
+
this.email = e;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
getEmail(): string{
|
|
217
|
+
return this.email;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
setTransactionId(t: string){
|
|
221
|
+
this.transactionId = t;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
getTransactionId(){
|
|
225
|
+
return this.transactionId;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
setWebhookUrl(wh: string){
|
|
229
|
+
this.webhookUrl = wh;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
getWebhookUrl(){
|
|
233
|
+
return this.webhookUrl;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
setCustom1(c: string){
|
|
237
|
+
this.custom1 = c;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
getCustom1(){
|
|
241
|
+
return this.custom1;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
setCustom2(c: string){
|
|
245
|
+
this.custom2 = c;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
getCustom2(){
|
|
249
|
+
return this.custom2;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
setCustom3(c: string){
|
|
253
|
+
this.custom3 = c;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
getCustom3(){
|
|
257
|
+
return this.custom3;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
setCustom4(c: string){
|
|
261
|
+
this.custom4 = c;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
getCustom4(){
|
|
265
|
+
return this.custom4;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
setCustom5(c: string){
|
|
269
|
+
this.custom5 = c;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
getCustom5(){
|
|
273
|
+
return this.custom5;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
setCustom6(c: string){
|
|
277
|
+
this.custom6 = c;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
getCustom6(){
|
|
281
|
+
return this.custom6;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
setCustom7(c: string){
|
|
285
|
+
this.custom7 = c;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
getCustom7(){
|
|
289
|
+
return this.custom7;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
setCustom8(c: string){
|
|
293
|
+
this.custom8 = c;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
getCustom8(){
|
|
297
|
+
return this.custom8;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
setCustom9(c: string){
|
|
301
|
+
this.custom9 = c;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
getCustom9(){
|
|
305
|
+
return this.custom9;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
setCustom10(c: string){
|
|
309
|
+
this.custom10 = c;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
getCustom10(){
|
|
313
|
+
return this.custom10;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
setSubject(sub: string){
|
|
317
|
+
this.subject = sub;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
getSubject(){
|
|
321
|
+
return this.subject;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
setDescription(des: string){
|
|
325
|
+
this.description = des;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
getDescription(){
|
|
329
|
+
return this.description;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
setPaymentModalTitle(title: string){
|
|
333
|
+
this.paymentModalTitle = title;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
getPaymentModalTitle(){
|
|
337
|
+
return this.paymentModalTitle;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
setReturnUrl(url: string){
|
|
341
|
+
this.returnUrl = url
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
getReturnUrl(){
|
|
345
|
+
return this.returnUrl;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
setHeaderBackgroundColour(hbg: string){
|
|
349
|
+
this.headerBackgroundColour = hbg;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
getHeaderBackgroundColour(){
|
|
353
|
+
return this.headerBackgroundColour;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
setHeaderTitleColour(htc: string){
|
|
357
|
+
this.headerTitleColour = htc;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
getHeaderTitleColour(){
|
|
361
|
+
return this.headerTitleColour;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
setCancelBtnColour(cbc: string){
|
|
365
|
+
this.cancelColour = cbc;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
getCancelBtnColour(){
|
|
369
|
+
return this.cancelColour;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
setMerchantName(mn: string){
|
|
373
|
+
this.merchantName = mn;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
getMerchantName(){
|
|
377
|
+
return this.merchantName;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export class PaymentResponse {
|
|
383
|
+
transactionId: String;
|
|
384
|
+
paymentId: String;
|
|
385
|
+
isSuccess: Boolean;
|
|
386
|
+
token: String;
|
|
387
|
+
returnCode: number;
|
|
388
|
+
errorMessage: String;
|
|
389
|
+
|
|
390
|
+
constructor(transactionId: String, paymentId: String, isSuccess: Boolean, token: String, returnCode: number, errorMessage: String) {
|
|
391
|
+
this.transactionId = transactionId;
|
|
392
|
+
this.paymentId = paymentId;
|
|
393
|
+
this.isSuccess = isSuccess;
|
|
394
|
+
this.token = token;
|
|
395
|
+
this.returnCode = returnCode;
|
|
396
|
+
this.errorMessage = errorMessage;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
static fromJson(json: any) {
|
|
400
|
+
const { transactionId, paymentId, isSuccess, token, returnCode, errorMessage } = json;
|
|
401
|
+
return new PaymentResponse(transactionId, paymentId, isSuccess, token, returnCode, errorMessage);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
toJson() {
|
|
405
|
+
return {
|
|
406
|
+
paymentId: this.paymentId,
|
|
407
|
+
isSuccess: this.isSuccess,
|
|
408
|
+
token: this.token,
|
|
409
|
+
returnCode: this.returnCode,
|
|
410
|
+
errorMessage: this.errorMessage,
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
export class scPaymentResponse {
|
|
417
|
+
id: String;
|
|
418
|
+
statusId: String;
|
|
419
|
+
status: String;
|
|
420
|
+
transId: String;
|
|
421
|
+
custom1: String;
|
|
422
|
+
|
|
423
|
+
constructor(id: String, statusId: String, status: String, transId: String, custom1: String) {
|
|
424
|
+
this.id = id;
|
|
425
|
+
this.statusId = statusId;
|
|
426
|
+
this.status = status;
|
|
427
|
+
this.transId = transId;
|
|
428
|
+
this.custom1 = custom1;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
static fromJson(json: any) {
|
|
432
|
+
const { id, statusId, status, transId, custom1 } = json;
|
|
433
|
+
return new scPaymentResponse(id, statusId, status, transId, custom1);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
toJson() {
|
|
437
|
+
return {
|
|
438
|
+
id: this.id,
|
|
439
|
+
statusId: this.statusId,
|
|
440
|
+
status: this.status,
|
|
441
|
+
transId: this.transId,
|
|
442
|
+
custom1: this.custom1
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
}
|