@amboras-dev/airwallex 0.2.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/dist/index.d.mts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +38 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Public config returned by GET /store/airwallex-connect */
|
|
2
|
+
interface AirwallexConfig {
|
|
3
|
+
store_environment_id: string;
|
|
4
|
+
/** Airwallex environment the Drop-in SDK should initialize against. */
|
|
5
|
+
environment: 'sandbox' | 'live' | null;
|
|
6
|
+
payment_ready: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Per-session data Medusa returns from initiatePaymentSession for the Airwallex
|
|
10
|
+
* provider. The Drop-in element confirms the intent client-side using these.
|
|
11
|
+
*/
|
|
12
|
+
interface AirwallexSessionData {
|
|
13
|
+
intent_id: string;
|
|
14
|
+
client_secret: string;
|
|
15
|
+
currency_code: string;
|
|
16
|
+
}
|
|
17
|
+
/** Maps the platform environment to the Airwallex SDK's `env` option. */
|
|
18
|
+
type AirwallexSdkEnv = 'demo' | 'prod';
|
|
19
|
+
declare function toAirwallexSdkEnv(environment: AirwallexConfig['environment']): AirwallexSdkEnv;
|
|
20
|
+
/** Drop-in element success event shape (subset we consume). */
|
|
21
|
+
interface AirwallexPaymentResult {
|
|
22
|
+
intent: {
|
|
23
|
+
id: string;
|
|
24
|
+
status: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { type AirwallexConfig, type AirwallexPaymentResult, type AirwallexSdkEnv, type AirwallexSessionData, toAirwallexSdkEnv };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Public config returned by GET /store/airwallex-connect */
|
|
2
|
+
interface AirwallexConfig {
|
|
3
|
+
store_environment_id: string;
|
|
4
|
+
/** Airwallex environment the Drop-in SDK should initialize against. */
|
|
5
|
+
environment: 'sandbox' | 'live' | null;
|
|
6
|
+
payment_ready: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Per-session data Medusa returns from initiatePaymentSession for the Airwallex
|
|
10
|
+
* provider. The Drop-in element confirms the intent client-side using these.
|
|
11
|
+
*/
|
|
12
|
+
interface AirwallexSessionData {
|
|
13
|
+
intent_id: string;
|
|
14
|
+
client_secret: string;
|
|
15
|
+
currency_code: string;
|
|
16
|
+
}
|
|
17
|
+
/** Maps the platform environment to the Airwallex SDK's `env` option. */
|
|
18
|
+
type AirwallexSdkEnv = 'demo' | 'prod';
|
|
19
|
+
declare function toAirwallexSdkEnv(environment: AirwallexConfig['environment']): AirwallexSdkEnv;
|
|
20
|
+
/** Drop-in element success event shape (subset we consume). */
|
|
21
|
+
interface AirwallexPaymentResult {
|
|
22
|
+
intent: {
|
|
23
|
+
id: string;
|
|
24
|
+
status: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { type AirwallexConfig, type AirwallexPaymentResult, type AirwallexSdkEnv, type AirwallexSessionData, toAirwallexSdkEnv };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
toAirwallexSdkEnv: () => toAirwallexSdkEnv
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
|
|
27
|
+
// src/types.ts
|
|
28
|
+
function toAirwallexSdkEnv(environment) {
|
|
29
|
+
return environment === "live" ? "prod" : "demo";
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
toAirwallexSdkEnv
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types.ts"],"sourcesContent":["export type {\n AirwallexConfig,\n AirwallexSessionData,\n AirwallexSdkEnv,\n AirwallexPaymentResult,\n} from './types'\nexport { toAirwallexSdkEnv } from './types'\n","/** Public config returned by GET /store/airwallex-connect */\nexport interface AirwallexConfig {\n store_environment_id: string\n /** Airwallex environment the Drop-in SDK should initialize against. */\n environment: 'sandbox' | 'live' | null\n payment_ready: boolean\n}\n\n/**\n * Per-session data Medusa returns from initiatePaymentSession for the Airwallex\n * provider. The Drop-in element confirms the intent client-side using these.\n */\nexport interface AirwallexSessionData {\n intent_id: string\n client_secret: string\n currency_code: string\n}\n\n/** Maps the platform environment to the Airwallex SDK's `env` option. */\nexport type AirwallexSdkEnv = 'demo' | 'prod'\n\nexport function toAirwallexSdkEnv(environment: AirwallexConfig['environment']): AirwallexSdkEnv {\n return environment === 'live' ? 'prod' : 'demo'\n}\n\n/** Drop-in element success event shape (subset we consume). */\nexport interface AirwallexPaymentResult {\n intent: {\n id: string\n status: string\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqBO,SAAS,kBAAkB,aAA8D;AAC9F,SAAO,gBAAgB,SAAS,SAAS;AAC3C;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["/** Public config returned by GET /store/airwallex-connect */\nexport interface AirwallexConfig {\n store_environment_id: string\n /** Airwallex environment the Drop-in SDK should initialize against. */\n environment: 'sandbox' | 'live' | null\n payment_ready: boolean\n}\n\n/**\n * Per-session data Medusa returns from initiatePaymentSession for the Airwallex\n * provider. The Drop-in element confirms the intent client-side using these.\n */\nexport interface AirwallexSessionData {\n intent_id: string\n client_secret: string\n currency_code: string\n}\n\n/** Maps the platform environment to the Airwallex SDK's `env` option. */\nexport type AirwallexSdkEnv = 'demo' | 'prod'\n\nexport function toAirwallexSdkEnv(environment: AirwallexConfig['environment']): AirwallexSdkEnv {\n return environment === 'live' ? 'prod' : 'demo'\n}\n\n/** Drop-in element success event shape (subset we consume). */\nexport interface AirwallexPaymentResult {\n intent: {\n id: string\n status: string\n }\n}\n"],"mappings":";AAqBO,SAAS,kBAAkB,aAA8D;AAC9F,SAAO,gBAAgB,SAAS,SAAS;AAC3C;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amboras-dev/airwallex",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Airwallex payment provider UI for Amboras storefronts",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@airwallex/components-sdk": "^1.16.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^20.0.0",
|
|
27
|
+
"@types/react": "^18.0.0",
|
|
28
|
+
"tsup": "^8.0.0",
|
|
29
|
+
"typescript": "^5.0.0"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsup",
|
|
36
|
+
"typecheck": "tsc --noEmit"
|
|
37
|
+
}
|
|
38
|
+
}
|