@bloque/payments-core 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/dist/index.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
@@ -0,0 +1,5 @@
1
+ export type { CardPaymentFormData } from './types/card-payment';
2
+ export type { CashPaymentFormData } from './types/cash-payment';
3
+ export type { CreatePaymentParams, PaymentMethodType, PaymentResponse, } from './types/payment';
4
+ export type { PaymentSubmitPayload } from './types/payment-submit';
5
+ export type { PSEPaymentFormData } from './types/pse-payment';
package/dist/index.js ADDED
File without changes
@@ -0,0 +1,8 @@
1
+ export interface CardPaymentFormData {
2
+ cardNumber: string;
3
+ cardholderName: string;
4
+ expiryMonth: string;
5
+ expiryYear: string;
6
+ cvv: string;
7
+ email: string;
8
+ }
@@ -0,0 +1,6 @@
1
+ export interface CashPaymentFormData {
2
+ email: string;
3
+ documentType: string;
4
+ documentNumber: string;
5
+ fullName: string;
6
+ }
@@ -0,0 +1,15 @@
1
+ import type { CardPaymentFormData } from './card-payment';
2
+ import type { CashPaymentFormData } from './cash-payment';
3
+ import type { PSEPaymentFormData } from './pse-payment';
4
+ type PaymentFormDataMap = {
5
+ card: CardPaymentFormData;
6
+ pse: PSEPaymentFormData;
7
+ cash: CashPaymentFormData;
8
+ };
9
+ export type PaymentSubmitPayload = {
10
+ [K in keyof PaymentFormDataMap]: {
11
+ type: K;
12
+ data: PaymentFormDataMap[K];
13
+ };
14
+ }[keyof PaymentFormDataMap];
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { PaymentSubmitPayload } from './payment-submit';
2
+ export type PaymentMethodType = 'card' | 'pse' | 'cash';
3
+ export interface CreatePaymentParams {
4
+ checkoutId?: string;
5
+ payment: PaymentSubmitPayload;
6
+ }
7
+ export interface PaymentResponse {
8
+ id: string;
9
+ object: 'payment';
10
+ status: 'pending' | 'processing' | 'completed' | 'failed';
11
+ amount: number;
12
+ currency: string;
13
+ created_at: string;
14
+ updated_at: string;
15
+ }
@@ -0,0 +1,7 @@
1
+ export interface PSEPaymentFormData {
2
+ personType: 'natural' | 'juridica';
3
+ documentType: string;
4
+ documentNumber: string;
5
+ bankCode: string;
6
+ email: string;
7
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@bloque/payments-core",
3
+ "version": "0.0.2",
4
+ "description": "Core utilities and types for Bloque Payments.",
5
+ "type": "module",
6
+ "keywords": [
7
+ "bloque",
8
+ "payments",
9
+ "core",
10
+ "utilities"
11
+ ],
12
+ "author": "Nestor Cortina <nexckycort@gmail.com>",
13
+ "license": "MIT",
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "provenance": true
17
+ },
18
+ "homepage": "git+https://github.com/bloque-app/payments.git#readme",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/bloque-app/payments.git",
22
+ "directory": "packages/payments-core"
23
+ },
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js",
28
+ "require": "./dist/index.cjs"
29
+ }
30
+ },
31
+ "main": "./dist/index.cjs",
32
+ "types": "./dist/index.d.ts",
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "engines": {
37
+ "node": ">=22"
38
+ },
39
+ "scripts": {
40
+ "build": "rslib build",
41
+ "dev": "rslib build --watch",
42
+ "clean": "rm -rf node_modules && rm -rf dist",
43
+ "check": "biome check --write",
44
+ "typecheck": "tsgo --noEmit"
45
+ },
46
+ "devDependencies": {
47
+ "@rslib/core": "catalog:",
48
+ "@types/node": "catalog:",
49
+ "@typescript/native-preview": "catalog:",
50
+ "typescript": "catalog:"
51
+ }
52
+ }