cloudcommerce 0.16.4 → 0.18.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/.vscode/settings.json +2 -1
- package/CHANGELOG.md +41 -0
- package/package.json +1 -1
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/events/lib/firebase.js +0 -2
- package/packages/events/lib/firebase.js.map +1 -1
- package/packages/events/package.json +1 -2
- package/packages/events/src/firebase.ts +0 -2
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/lib/config.d.ts +0 -3
- package/packages/firebase/lib/config.js +0 -3
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/firebase/src/config.ts +0 -3
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/call-app-module.js +0 -12
- package/packages/modules/lib/firebase/call-app-module.js.map +1 -1
- package/packages/modules/package.json +1 -2
- package/packages/modules/src/firebase/call-app-module.ts +0 -12
- package/packages/passport/package.json +1 -1
- package/packages/ssr/lib/firebase/serve-storefront.js +144 -45
- package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
- package/packages/ssr/package.json +1 -1
- package/packages/ssr/src/firebase/serve-storefront.ts +153 -49
- package/packages/storefront/.eslintrc.cjs +1 -0
- package/packages/storefront/dist/client/_astro/{Carousel.f39be3c0.js → Carousel.533b4b19.js} +1 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.359c76cc.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.75d2999f.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.bd0d3474.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.83c66e3e.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.f66a56cb.js +4 -0
- package/packages/storefront/dist/client/_astro/_...slug_.b19aabfc.css +1 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.4e6dc3af.js +1 -0
- package/packages/storefront/dist/client/_astro/client.24201f93.js +1 -0
- package/packages/storefront/dist/client/_astro/{img.517fec8e.js → img.22ad29ec.js} +1 -1
- package/packages/storefront/dist/client/_astro/{index.33347cbd.js → index.ddc27a3a.js} +1 -1
- package/packages/storefront/dist/client/_astro/modules-info.d6bd555b.js +1 -0
- package/packages/storefront/dist/client/_astro/{runtime-dom.esm-bundler.00b967e0.js → runtime-dom.esm-bundler.578d6e91.js} +1 -1
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/{_...06f412d0.mjs → _...ed1d4ed7.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/{account@_@astro.d58b2d34.mjs → account@_@astro.97e06bd2.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{endpoint@_@js.ce919661.mjs → endpoint@_@js.e9171d18.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/{fallback@_@astro.6c7c4acd.mjs → fallback@_@astro.4a1f8c08.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/{index@_@astro.f7e2409d.mjs → index@_@astro.7472fe37.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/{index@_@astro.8e359cb4.mjs → index@_@astro.de13f221.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.f0a57b8d.mjs → _...slug_.astro.9e731356.mjs} +279 -133
- package/packages/storefront/dist/server/chunks/pages/{endpoint.js.1d889b2f.mjs → endpoint.js.96a9b7f9.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{fallback.astro.42f81a9a.mjs → fallback.astro.3ebb4e85.mjs} +3 -2
- package/packages/storefront/dist/server/chunks/pages/{index.astro.533679e1.mjs → index.astro.8d786fcb.mjs} +27 -25
- package/packages/storefront/dist/server/entry.mjs +8 -8
- package/packages/storefront/dist/server/renderers.mjs +4 -3
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/lib/components/Drawer.vue +6 -2
- package/packages/storefront/src/lib/components/globals/AImg.vue +2 -1
- package/packages/storefront/src/lib/composables/use-prices.ts +10 -8
- package/packages/storefront/src/lib/composables/use-product-card.ts +15 -15
- package/packages/storefront/src/lib/layouts/BaseBody.astro +3 -3
- package/packages/storefront/src/lib/layouts/main/use-page-sections.ts +5 -0
- package/packages/storefront/src/lib/layouts/{use-page-layout.ts → use-page-header.ts} +24 -4
- package/packages/storefront/src/lib/ssr-context.ts +1 -1
- package/packages/storefront/src/lib/state/modules-info.ts +25 -0
- package/packages/storefront/src/lib/state/shopping-cart.ts +6 -0
- package/packages/types/package.json +1 -1
- package/packages/apps/infinitepay/CHANGELOG.md +0 -1
- package/packages/apps/infinitepay/README.md +0 -1
- package/packages/apps/infinitepay/assets/onload-expression.js +0 -57
- package/packages/apps/infinitepay/lib/functions-lib/add-installments.d.ts +0 -55
- package/packages/apps/infinitepay/lib/functions-lib/add-installments.js +0 -63
- package/packages/apps/infinitepay/lib/functions-lib/add-installments.js.map +0 -1
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-access.d.ts +0 -14
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-access.js +0 -67
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-access.js.map +0 -1
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-axios.d.ts +0 -2
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-axios.js +0 -19
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-axios.js.map +0 -1
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/oauth.d.ts +0 -2
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/oauth.js +0 -25
- package/packages/apps/infinitepay/lib/functions-lib/ip-auth/oauth.js.map +0 -1
- package/packages/apps/infinitepay/lib/functions-lib/utils.d.ts +0 -8
- package/packages/apps/infinitepay/lib/functions-lib/utils.js +0 -17
- package/packages/apps/infinitepay/lib/functions-lib/utils.js.map +0 -1
- package/packages/apps/infinitepay/lib/index.d.ts +0 -1
- package/packages/apps/infinitepay/lib/index.js +0 -3
- package/packages/apps/infinitepay/lib/index.js.map +0 -1
- package/packages/apps/infinitepay/lib/infinitepay.d.ts +0 -80
- package/packages/apps/infinitepay/lib/infinitepay.js +0 -12
- package/packages/apps/infinitepay/lib/infinitepay.js.map +0 -1
- package/packages/apps/infinitepay/lib/ip-create-transaction.d.ts +0 -75
- package/packages/apps/infinitepay/lib/ip-create-transaction.js +0 -324
- package/packages/apps/infinitepay/lib/ip-create-transaction.js.map +0 -1
- package/packages/apps/infinitepay/lib/ip-list-payments.d.ts +0 -7
- package/packages/apps/infinitepay/lib/ip-list-payments.js +0 -146
- package/packages/apps/infinitepay/lib/ip-list-payments.js.map +0 -1
- package/packages/apps/infinitepay/lib/ip-webhook.d.ts +0 -5
- package/packages/apps/infinitepay/lib/ip-webhook.js +0 -152
- package/packages/apps/infinitepay/lib/ip-webhook.js.map +0 -1
- package/packages/apps/infinitepay/package.json +0 -38
- package/packages/apps/infinitepay/scripts/build.sh +0 -4
- package/packages/apps/infinitepay/src/functions-lib/add-installments.ts +0 -78
- package/packages/apps/infinitepay/src/functions-lib/ip-auth/create-access.ts +0 -89
- package/packages/apps/infinitepay/src/functions-lib/ip-auth/create-axios.ts +0 -20
- package/packages/apps/infinitepay/src/functions-lib/ip-auth/oauth.ts +0 -30
- package/packages/apps/infinitepay/src/functions-lib/utils.ts +0 -23
- package/packages/apps/infinitepay/src/index.ts +0 -2
- package/packages/apps/infinitepay/src/infinitepay.ts +0 -12
- package/packages/apps/infinitepay/src/ip-create-transaction.ts +0 -441
- package/packages/apps/infinitepay/src/ip-list-payments.ts +0 -178
- package/packages/apps/infinitepay/src/ip-webhook.ts +0 -183
- package/packages/apps/infinitepay/tsconfig.json +0 -6
- package/packages/apps/infinitepay/webhook.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.3d4a1d1c.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.c53e6d0b.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.de6df3cb.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.f013b3ee.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.c0ba5061.js +0 -4
- package/packages/storefront/dist/client/_astro/_...slug_.45bc69ca.css +0 -1
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.d3aaeb0d.js +0 -1
- package/packages/storefront/dist/client/_astro/client.2d950540.js +0 -1
- package/packages/storefront/dist/client/_astro/format-money.3b884fcb.js +0 -1
- package/packages/storefront/dist/client/_astro/idle-callback.889bf0ea.js +0 -1
- package/packages/storefront/dist/client/_astro/modules-info.ad27b027.js +0 -1
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
(function () {
|
|
3
|
-
window._infiniteHashCard = function (cardClient) {
|
|
4
|
-
return new Promise((resolve, reject) => {
|
|
5
|
-
const elementsForm = `
|
|
6
|
-
<input type="text" data-ip="method" value="credit_card" style="display: none;>
|
|
7
|
-
<input type="text" data-ip="card-cvv" value="${cardClient.cvc}" style="display: none;">
|
|
8
|
-
<input type="text" data-ip="card-number" value="${cardClient.number}" style="display: none;">
|
|
9
|
-
<input type="text" data-ip="card-expiration-month" value="${cardClient.month.toString()}" style="display: none;">
|
|
10
|
-
<input type="text" data-ip="card-expiration-year" value="${cardClient.year.toString()}" style="display: none;">
|
|
11
|
-
<input type="text" data-ip="card-holder-name" value="${cardClient.name}" style="display: none;">
|
|
12
|
-
<input type="text" data-ip="card-holder-document" value="${cardClient.doc}" style="display: none;">`
|
|
13
|
-
|
|
14
|
-
const newForm = document.createElement('form')
|
|
15
|
-
newForm.setAttribute('id', 'formIP')
|
|
16
|
-
newForm.innerHTML = elementsForm
|
|
17
|
-
|
|
18
|
-
document.body.appendChild(newForm)
|
|
19
|
-
|
|
20
|
-
const access_token = window._infiniteJwtTokenCard
|
|
21
|
-
// const sandbox = window._infiniteCardSandbox
|
|
22
|
-
const form = document.querySelector('#formIP')
|
|
23
|
-
const ipay = new IPay({ access_token })
|
|
24
|
-
// console.log('ipay ', ipay)
|
|
25
|
-
ipay.listeners = {
|
|
26
|
-
'result:success': function () {
|
|
27
|
-
// form.submit() // sucesso, continue o pagamento
|
|
28
|
-
console.log('Tokenize OK')
|
|
29
|
-
const token = document.querySelector("[name='ip[token]']").value
|
|
30
|
-
const sessionId = document.querySelector("[name='ip[session_id]']").value
|
|
31
|
-
const card = {
|
|
32
|
-
token,
|
|
33
|
-
cvv: cardClient.cvc,
|
|
34
|
-
card_holder_name: cardClient.name
|
|
35
|
-
}
|
|
36
|
-
const metadata = {
|
|
37
|
-
origin: 'ecomplus',
|
|
38
|
-
store_url: window.location.hostname,
|
|
39
|
-
risk: {
|
|
40
|
-
session_id: sessionId
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const json = JSON.stringify({ card, metadata })
|
|
44
|
-
const data = window.btoa(json)
|
|
45
|
-
resolve(data)
|
|
46
|
-
},
|
|
47
|
-
'result:error': function (errors) {
|
|
48
|
-
console.log('error: ')
|
|
49
|
-
console.log(errors) // erro da tokenização, mostra no console
|
|
50
|
-
reject(errors)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
ipay.generate(form)
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
}())
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { ListPaymentsResponse } from '@cloudcommerce/types';
|
|
2
|
-
type Gateway = ListPaymentsResponse['payment_gateways'][number];
|
|
3
|
-
declare const addInstallments: (total: number | undefined, installments: {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}, gateway: Gateway, response?: ListPaymentsResponse) => {
|
|
6
|
-
response: ListPaymentsResponse | undefined;
|
|
7
|
-
gateway: {
|
|
8
|
-
label: string;
|
|
9
|
-
text?: string | undefined;
|
|
10
|
-
icon?: string | undefined;
|
|
11
|
-
intermediator?: {
|
|
12
|
-
name?: string | undefined;
|
|
13
|
-
link?: string | undefined;
|
|
14
|
-
code: string;
|
|
15
|
-
} | undefined;
|
|
16
|
-
payment_url?: string | undefined;
|
|
17
|
-
type?: "payment" | "recurrence" | undefined;
|
|
18
|
-
payment_method: {
|
|
19
|
-
code: "credit_card" | "banking_billet" | "online_debit" | "account_deposit" | "debit_card" | "balance_on_intermediary" | "loyalty_points" | "other";
|
|
20
|
-
name?: string | undefined;
|
|
21
|
-
};
|
|
22
|
-
discount?: {
|
|
23
|
-
apply_at?: "total" | "subtotal" | "freight" | undefined;
|
|
24
|
-
type?: "fixed" | "percentage" | undefined;
|
|
25
|
-
value?: number | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
card_companies?: string[] | undefined;
|
|
28
|
-
installment_options?: {
|
|
29
|
-
number: number;
|
|
30
|
-
value: number;
|
|
31
|
-
tax?: boolean | undefined;
|
|
32
|
-
}[] | undefined;
|
|
33
|
-
js_client?: {
|
|
34
|
-
script_uri: string;
|
|
35
|
-
fallback_script_uri?: string | undefined;
|
|
36
|
-
onload_expression?: string | undefined;
|
|
37
|
-
container_html?: string | undefined;
|
|
38
|
-
transaction_promise?: string | undefined;
|
|
39
|
-
cc_hash?: {
|
|
40
|
-
function: string;
|
|
41
|
-
is_promise?: boolean | undefined;
|
|
42
|
-
} | undefined;
|
|
43
|
-
cc_installments?: {
|
|
44
|
-
function: string;
|
|
45
|
-
is_promise?: boolean | undefined;
|
|
46
|
-
} | undefined;
|
|
47
|
-
cc_brand?: {
|
|
48
|
-
function: string;
|
|
49
|
-
is_promise?: boolean | undefined;
|
|
50
|
-
} | undefined;
|
|
51
|
-
} | undefined;
|
|
52
|
-
fetch_when_selected?: boolean | undefined;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export default addInstallments;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const standardMonthlyInterest = [
|
|
2
|
-
4.20,
|
|
3
|
-
1.3390,
|
|
4
|
-
1.5041,
|
|
5
|
-
1.5992,
|
|
6
|
-
1.6630,
|
|
7
|
-
1.7057,
|
|
8
|
-
2.3454,
|
|
9
|
-
2.3053,
|
|
10
|
-
2.2755,
|
|
11
|
-
2.2490,
|
|
12
|
-
2.2306,
|
|
13
|
-
2.2111,
|
|
14
|
-
];
|
|
15
|
-
const addInstallments = (total, installments, gateway, response) => {
|
|
16
|
-
const maxInterestFree = installments.max_interest_free;
|
|
17
|
-
const minInstallment = installments.min_installment || 5;
|
|
18
|
-
const qtyPosssibleInstallment = total ? Math.floor((total / minInstallment)) : 12;
|
|
19
|
-
const maxInstallments = installments.max_number
|
|
20
|
-
|| (qtyPosssibleInstallment < 12 ? qtyPosssibleInstallment : 12);
|
|
21
|
-
const monthlyInterest = installments.monthly_interest || 0;
|
|
22
|
-
let monthlyInstallmentInterest = 0;
|
|
23
|
-
if (maxInterestFree <= 1) {
|
|
24
|
-
const IPInterestMonthly = standardMonthlyInterest[maxInstallments - 1];
|
|
25
|
-
monthlyInstallmentInterest = (monthlyInterest > IPInterestMonthly ? monthlyInterest
|
|
26
|
-
: IPInterestMonthly);
|
|
27
|
-
}
|
|
28
|
-
if (maxInstallments > 1) {
|
|
29
|
-
if (response) {
|
|
30
|
-
response.installments_option = {
|
|
31
|
-
min_installment: minInstallment,
|
|
32
|
-
max_number: maxInterestFree > 1 ? maxInterestFree : maxInstallments,
|
|
33
|
-
monthly_interest: monthlyInstallmentInterest,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
// list installment options
|
|
37
|
-
gateway.installment_options = [];
|
|
38
|
-
if (total) {
|
|
39
|
-
for (let number = 2; number <= maxInstallments; number++) {
|
|
40
|
-
const tax = !(maxInterestFree >= number);
|
|
41
|
-
let interest;
|
|
42
|
-
if (tax) {
|
|
43
|
-
const IPMonthInterestRate = standardMonthlyInterest[number - 1];
|
|
44
|
-
interest = (monthlyInterest > IPMonthInterestRate ? monthlyInterest : IPMonthInterestRate)
|
|
45
|
-
/ 100;
|
|
46
|
-
}
|
|
47
|
-
const value = !tax ? (total / number)
|
|
48
|
-
: total * (interest / (1 - (1 + interest) ** -number));
|
|
49
|
-
if (value && value >= 1) {
|
|
50
|
-
gateway.installment_options.push({
|
|
51
|
-
number,
|
|
52
|
-
value,
|
|
53
|
-
tax,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return { response, gateway };
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default addInstallments;
|
|
63
|
-
// # sourceMappingURL=add-installments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-installments.js","sourceRoot":"","sources":["../../src/functions-lib/add-installments.ts"],"names":[],"mappings":"AAEA,MAAM,uBAAuB,GAAG;IAC9B,IAAI;IACJ,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC;AAIF,MAAM,eAAe,GAAG,CACtB,KAAyB,EACzB,YAAoC,EACpC,OAAgB,EAChB,QAA+B,EAC/B,EAAE;IACF,MAAM,eAAe,GAAG,YAAY,CAAC,iBAAiB,CAAC;IACvD,MAAM,cAAc,GAAG,YAAY,CAAC,eAAe,IAAI,CAAC,CAAC;IACzD,MAAM,uBAAuB,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClF,MAAM,eAAe,GAAG,YAAY,CAAC,UAAU;WAC1C,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEnE,MAAM,eAAe,GAAG,YAAY,CAAC,gBAAgB,IAAI,CAAC,CAAC;IAC3D,IAAI,0BAA0B,GAAG,CAAC,CAAC;IAEnC,IAAI,eAAe,IAAI,CAAC,EAAE;QACxB,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;QAEvE,0BAA0B,GAAG,CAAC,eAAe,GAAG,iBAAiB,CAAC,CAAC,CAAC,eAAe;YACjF,CAAC,CAAC,iBAAiB,CAAC,CAAC;KACxB;IAED,IAAI,eAAe,GAAG,CAAC,EAAE;QACvB,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,mBAAmB,GAAG;gBAC7B,eAAe,EAAE,cAAc;gBAC/B,UAAU,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe;gBACnE,gBAAgB,EAAE,0BAA0B;aAC7C,CAAC;SACH;QAED,2BAA2B;QAC3B,OAAO,CAAC,mBAAmB,GAAG,EAAE,CAAC;QACjC,IAAI,KAAK,EAAE;YACT,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,EAAE,EAAE;gBACxD,MAAM,GAAG,GAAG,CAAC,CAAC,eAAe,IAAI,MAAM,CAAC,CAAC;gBACzC,IAAI,QAAQ,CAAC;gBACb,IAAI,GAAG,EAAE;oBACP,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBAChE,QAAQ,GAAG,CAAC,eAAe,GAAG,mBAAmB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC;0BACtF,GAAG,CAAC;iBACT;gBACD,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC;oBACnC,CAAC,CAAC,KAAK,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAEzD,IAAI,KAAK,IAAI,KAAK,IAAI,CAAC,EAAE;oBACvB,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC;wBAC/B,MAAM;wBACN,KAAK;wBACL,GAAG;qBACJ,CAAC,CAAC;iBACJ;aACF;SACF;KACF;IACD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { AxiosInstance } from 'axios';
|
|
2
|
-
type Option = {
|
|
3
|
-
clientId?: string;
|
|
4
|
-
clientSecret?: string;
|
|
5
|
-
typeScope: string;
|
|
6
|
-
isSandbox?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export default class IPAxios {
|
|
9
|
-
preparing: Promise<unknown>;
|
|
10
|
-
axios: AxiosInstance | undefined;
|
|
11
|
-
cardTokenization: string | undefined;
|
|
12
|
-
constructor(options: Option);
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { getFirestore } from 'firebase-admin/firestore';
|
|
2
|
-
import logger from 'firebase-functions/logger';
|
|
3
|
-
import auth from './oauth.js';
|
|
4
|
-
import Axios from './create-axios.js';
|
|
5
|
-
|
|
6
|
-
const firestoreColl = 'infinitepayTokens';
|
|
7
|
-
|
|
8
|
-
export default class IPAxios {
|
|
9
|
-
constructor(options) {
|
|
10
|
-
const {
|
|
11
|
-
clientId, clientSecret, typeScope, isSandbox,
|
|
12
|
-
} = options;
|
|
13
|
-
const self = this;
|
|
14
|
-
let documentRef;
|
|
15
|
-
if (firestoreColl) {
|
|
16
|
-
documentRef = getFirestore()
|
|
17
|
-
.doc(`${firestoreColl}/${typeScope}`);
|
|
18
|
-
}
|
|
19
|
-
this.preparing = new Promise((resolve, reject) => {
|
|
20
|
-
// typeScope === card, if scope card_tokenization
|
|
21
|
-
// typeScope === transaction, if scope for transaction
|
|
22
|
-
let scope = 'transactions';
|
|
23
|
-
if (typeScope === 'card') {
|
|
24
|
-
scope = 'card_tokenization';
|
|
25
|
-
}
|
|
26
|
-
const authenticate = (accessToken) => {
|
|
27
|
-
if (scope === 'transactions') {
|
|
28
|
-
self.axios = Axios(accessToken, isSandbox);
|
|
29
|
-
} else {
|
|
30
|
-
self.cardTokenization = accessToken;
|
|
31
|
-
}
|
|
32
|
-
resolve(self);
|
|
33
|
-
};
|
|
34
|
-
const handleAuth = () => {
|
|
35
|
-
logger.log('>(App: InfinitePay) Auth ');
|
|
36
|
-
if (clientId && clientSecret) {
|
|
37
|
-
auth(clientId, clientSecret, scope, isSandbox)
|
|
38
|
-
.then((resp) => {
|
|
39
|
-
authenticate(resp.access_token);
|
|
40
|
-
if (documentRef) {
|
|
41
|
-
documentRef.set({ ...resp, isSandbox }).catch(logger.error);
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
.catch(reject);
|
|
45
|
-
} else {
|
|
46
|
-
reject(new Error('InfinitePay credentials unset'));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
if (documentRef) {
|
|
50
|
-
documentRef.get()
|
|
51
|
-
.then((documentSnapshot) => {
|
|
52
|
-
const data = documentSnapshot.data() || null;
|
|
53
|
-
if (documentSnapshot.exists && data && data.expires_in
|
|
54
|
-
&& new Date(data.expires_in).getTime() > Date.now()) {
|
|
55
|
-
authenticate(data.access_token);
|
|
56
|
-
} else {
|
|
57
|
-
handleAuth();
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
.catch(logger.error);
|
|
61
|
-
} else {
|
|
62
|
-
handleAuth();
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// # sourceMappingURL=create-access.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-access.js","sourceRoot":"","sources":["../../../src/functions-lib/ip-auth/create-access.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAEnC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAS1C,MAAM,CAAC,OAAO,OAAO,OAAO;IAK1B,YAAY,OAAe;QACzB,MAAM,EACJ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,SAAS,GACV,GAAG,OAAO,CAAC;QAEZ,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,WAAW,CAAC;QAChB,IAAI,aAAa,EAAE;YACjB,WAAW,GAAG,YAAY,EAAE;iBACzB,GAAG,CAAC,GAAG,aAAa,IAAI,SAAS,EAAE,CAAC,CAAC;SACzC;QAED,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC/C,kDAAkD;YAClD,sDAAsD;YAEtD,IAAI,KAAK,GAAG,cAAc,CAAC;YAC3B,IAAI,SAAS,KAAK,MAAM,EAAE;gBACxB,KAAK,GAAG,mBAAmB,CAAC;aAC7B;YAED,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;gBAC3C,IAAI,KAAK,KAAK,cAAc,EAAE;oBAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;iBAC5C;qBAAM;oBACL,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC;iBACrC;gBACD,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,CAAC;YAEF,MAAM,UAAU,GAAG,GAAG,EAAE;gBACtB,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;gBAExC,IAAI,QAAQ,IAAI,YAAY,EAAE;oBAC5B,IAAI,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,CAAC;yBAC3C,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE;wBAClB,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;wBAChC,IAAI,WAAW,EAAE;4BACf,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;yBAC7D;oBACH,CAAC,CAAC;yBACD,KAAK,CAAC,MAAM,CAAC,CAAC;iBAClB;qBAAM;oBACL,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC;iBACpD;YACH,CAAC,CAAC;YAEF,IAAI,WAAW,EAAE;gBACf,WAAW,CAAC,GAAG,EAAE;qBACd,IAAI,CAAC,CAAC,gBAAgB,EAAE,EAAE;oBACzB,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC;oBAC7C,IAAI,gBAAgB,CAAC,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU;2BACjD,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE;wBACrD,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;qBACjC;yBAAM;wBACL,UAAU,EAAE,CAAC;qBACd;gBACH,CAAC,CAAC;qBACD,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACxB;iBAAM;gBACL,UAAU,EAAE,CAAC;aACd;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
|
|
3
|
-
export default (accessToken, isSandbox) => {
|
|
4
|
-
// https://github.com/ecomplus/app-infinitepay/issues/77#issuecomment-1189795488
|
|
5
|
-
const headers = {
|
|
6
|
-
'Content-Type': 'application/json',
|
|
7
|
-
};
|
|
8
|
-
if (accessToken) {
|
|
9
|
-
// logger.log('> token ', accessToken);
|
|
10
|
-
Object.assign(headers, {
|
|
11
|
-
Authorization: `Bearer ${accessToken}`,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return axios.create({
|
|
15
|
-
baseURL: `https://api${isSandbox ? '-staging' : ''}.infinitepay.io`,
|
|
16
|
-
headers,
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
// # sourceMappingURL=create-axios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-axios.js","sourceRoot":"","sources":["../../../src/functions-lib/ip-auth/create-axios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAe,CAAC,WAA0B,EAAE,SAAmB,EAAE,EAAE;IACjE,gFAAgF;IAEhF,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,kBAAkB;KACnC,CAAC;IACF,IAAI,WAAW,EAAE;QACf,uCAAuC;QACvC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;YACrB,aAAa,EAAE,UAAU,WAAW,EAAE;SACvC,CAAC,CAAC;KACJ;IAED,OAAO,KAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,cAAc,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,iBAAiB;QACnE,OAAO;KACR,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import logger from 'firebase-functions/logger';
|
|
2
|
-
import Axios from './create-axios.js';
|
|
3
|
-
|
|
4
|
-
export default (clienId, clientSecret, scope, isSandbox) => new Promise((resolve, reject) => {
|
|
5
|
-
// https://github.com/ecomplus/app-infinitepay/issues/77#issuecomment-1189795488
|
|
6
|
-
const axios = Axios(null, isSandbox);
|
|
7
|
-
const request = (isRetry) => {
|
|
8
|
-
logger.log(`>>(App: InfinitePay) Auth ${scope} ${isSandbox ? 'Sandbox' : ''}`);
|
|
9
|
-
axios.post('/v2/oauth/token', {
|
|
10
|
-
grant_type: 'client_credentials',
|
|
11
|
-
client_id: clienId,
|
|
12
|
-
client_secret: clientSecret,
|
|
13
|
-
scope,
|
|
14
|
-
})
|
|
15
|
-
.then(({ data }) => resolve(data))
|
|
16
|
-
.catch((err) => {
|
|
17
|
-
if (!isRetry && err.response && err.response.status >= 429) {
|
|
18
|
-
setTimeout(() => request(true), 7000);
|
|
19
|
-
}
|
|
20
|
-
reject(err);
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
request();
|
|
24
|
-
});
|
|
25
|
-
// # sourceMappingURL=oauth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/functions-lib/ip-auth/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAEnC,eAAe,CACb,OAAe,EACf,YAAoB,EACpB,KAAa,EACb,SAAmB,EACnB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACnC,iFAAiF;IACjF,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAErC,MAAM,OAAO,GAAG,CAAC,OAAiB,EAAE,EAAE;QACpC,MAAM,CAAC,GAAG,CAAC,6BAA6B,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/E,KAAK,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC5B,UAAU,EAAE,oBAAoB;YAChC,SAAS,EAAE,OAAO;YAClB,aAAa,EAAE,YAAY;YAC3B,KAAK;SACN,CAAC;aACC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aACjC,KAAK,CAAC,CAAC,GAAQ,EAAE,EAAE;YAClB,IAAI,CAAC,OAAO,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;gBAC1D,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;aACvC;YACD,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IACF,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const readFile: (path: string) => string;
|
|
2
|
-
declare const responseError: (status: number | null, error: string, message: string) => {
|
|
3
|
-
status: number;
|
|
4
|
-
error: string;
|
|
5
|
-
message: string;
|
|
6
|
-
};
|
|
7
|
-
declare const isSandbox = false;
|
|
8
|
-
export { readFile, responseError, isSandbox, };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
|
-
import url from 'node:url';
|
|
3
|
-
import { join as joinPath } from 'node:path';
|
|
4
|
-
|
|
5
|
-
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
6
|
-
const readFile = (path) => fs.readFileSync(joinPath(__dirname, path), 'utf8');
|
|
7
|
-
const responseError = (status, error, message) => {
|
|
8
|
-
return {
|
|
9
|
-
status: status || 409,
|
|
10
|
-
error,
|
|
11
|
-
message: `${message} (shopkeeper must configure the application)`,
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
const isSandbox = false; // TODO: false
|
|
15
|
-
|
|
16
|
-
export { readFile, responseError, isSandbox };
|
|
17
|
-
// # sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/functions-lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEnE,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEtF,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAE,KAAa,EAAE,OAAe,EAAE,EAAE;IAC9E,OAAO;QACL,MAAM,EAAE,MAAM,IAAI,GAAG;QACrB,KAAK;QACL,OAAO,EAAE,GAAG,OAAO,8CAA8C;KAClE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,cAAc;AAEvC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,SAAS,GACV,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './infinitepay';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,cAAc,eAAe,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { AppModuleBody } from '@cloudcommerce/types';
|
|
2
|
-
import '@cloudcommerce/firebase/lib/init';
|
|
3
|
-
export declare const listPayments: (modBody: AppModuleBody) => Promise<import("@cloudcommerce/types").ListPaymentsResponse | {
|
|
4
|
-
status: number;
|
|
5
|
-
error: string;
|
|
6
|
-
message: string;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const createTransaction: (modBody: AppModuleBody) => Promise<{
|
|
9
|
-
status: number;
|
|
10
|
-
error: string;
|
|
11
|
-
message: string;
|
|
12
|
-
} | {
|
|
13
|
-
redirect_to_payment: boolean;
|
|
14
|
-
transaction: {
|
|
15
|
-
payment_link?: string | undefined;
|
|
16
|
-
payment_instructions?: string | undefined;
|
|
17
|
-
intermediator?: {
|
|
18
|
-
transaction_id?: string | undefined;
|
|
19
|
-
transaction_code?: string | undefined;
|
|
20
|
-
transaction_reference?: string | undefined;
|
|
21
|
-
payment_method?: {
|
|
22
|
-
code: string;
|
|
23
|
-
name?: string | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
buyer_id?: string | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
credit_card?: {
|
|
28
|
-
holder_name?: string | undefined;
|
|
29
|
-
avs_result_code?: string | null | undefined;
|
|
30
|
-
cvv_result_code?: string | null | undefined;
|
|
31
|
-
bin?: number | undefined;
|
|
32
|
-
company?: string | undefined;
|
|
33
|
-
last_digits?: string | undefined;
|
|
34
|
-
token?: string | undefined;
|
|
35
|
-
error_code?: "incorrect_number" | "invalid_number" | "invalid_expiry_date" | "invalid_cvc" | "expired_card" | "incorrect_cvc" | "incorrect_zip" | "incorrect_address" | "card_declined" | "processing_error" | "call_issuer" | "pick_up_card" | undefined;
|
|
36
|
-
} | undefined;
|
|
37
|
-
banking_billet?: {
|
|
38
|
-
code?: string | undefined;
|
|
39
|
-
valid_thru?: string | undefined;
|
|
40
|
-
text_lines?: string[] | undefined;
|
|
41
|
-
link?: string | undefined;
|
|
42
|
-
} | undefined;
|
|
43
|
-
loyalty_points?: {
|
|
44
|
-
name?: string | undefined;
|
|
45
|
-
program_id: string;
|
|
46
|
-
points_value: number;
|
|
47
|
-
ratio?: number | undefined;
|
|
48
|
-
} | undefined;
|
|
49
|
-
account_deposit?: {
|
|
50
|
-
valid_thru?: string | undefined;
|
|
51
|
-
text_lines?: string[] | undefined;
|
|
52
|
-
} | undefined;
|
|
53
|
-
currency_id?: string | undefined;
|
|
54
|
-
currency_symbol?: string | undefined;
|
|
55
|
-
discount?: number | undefined;
|
|
56
|
-
amount: number;
|
|
57
|
-
installments?: {
|
|
58
|
-
number: number;
|
|
59
|
-
value?: number | undefined;
|
|
60
|
-
tax?: boolean | undefined;
|
|
61
|
-
total?: number | undefined;
|
|
62
|
-
} | undefined;
|
|
63
|
-
creditor_fees?: {
|
|
64
|
-
installment?: number | undefined;
|
|
65
|
-
operational?: number | undefined;
|
|
66
|
-
intermediation?: number | undefined;
|
|
67
|
-
other?: number | undefined;
|
|
68
|
-
} | undefined;
|
|
69
|
-
status?: {
|
|
70
|
-
updated_at?: string | undefined;
|
|
71
|
-
current: "pending" | "under_analysis" | "authorized" | "unauthorized" | "paid" | "in_dispute" | "refunded" | "voided" | "unknown";
|
|
72
|
-
} | undefined;
|
|
73
|
-
flags?: string[] | undefined;
|
|
74
|
-
custom_fields?: {
|
|
75
|
-
field: string;
|
|
76
|
-
value: string;
|
|
77
|
-
}[] | undefined;
|
|
78
|
-
notes?: string | undefined;
|
|
79
|
-
};
|
|
80
|
-
}>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import '@cloudcommerce/firebase/lib/init';
|
|
2
|
-
import handleListPayments from './ip-list-payments.js';
|
|
3
|
-
import handleCreateTransaction from './ip-create-transaction.js';
|
|
4
|
-
|
|
5
|
-
export const listPayments = async (modBody) => {
|
|
6
|
-
return handleListPayments(modBody);
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const createTransaction = async (modBody) => {
|
|
10
|
-
return handleCreateTransaction(modBody);
|
|
11
|
-
};
|
|
12
|
-
// # sourceMappingURL=infinitepay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infinitepay.js","sourceRoot":"","sources":["../src/infinitepay.ts"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kBAAkB,MAAM,oBAAoB,CAAC;AACpD,OAAO,uBAAuB,MAAM,yBAAyB,CAAC;AAE9D,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,OAAsB,EAAE,EAAE;IAC3D,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAsB,EAAE,EAAE;IAChE,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { AppModuleBody } from '@cloudcommerce/types';
|
|
2
|
-
declare const _default: (appData: AppModuleBody) => Promise<{
|
|
3
|
-
status: number;
|
|
4
|
-
error: string;
|
|
5
|
-
message: string;
|
|
6
|
-
} | {
|
|
7
|
-
redirect_to_payment: boolean;
|
|
8
|
-
transaction: {
|
|
9
|
-
payment_link?: string | undefined;
|
|
10
|
-
payment_instructions?: string | undefined;
|
|
11
|
-
intermediator?: {
|
|
12
|
-
transaction_id?: string | undefined;
|
|
13
|
-
transaction_code?: string | undefined;
|
|
14
|
-
transaction_reference?: string | undefined;
|
|
15
|
-
payment_method?: {
|
|
16
|
-
code: string;
|
|
17
|
-
name?: string | undefined;
|
|
18
|
-
} | undefined;
|
|
19
|
-
buyer_id?: string | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
credit_card?: {
|
|
22
|
-
holder_name?: string | undefined;
|
|
23
|
-
avs_result_code?: string | null | undefined;
|
|
24
|
-
cvv_result_code?: string | null | undefined;
|
|
25
|
-
bin?: number | undefined;
|
|
26
|
-
company?: string | undefined;
|
|
27
|
-
last_digits?: string | undefined;
|
|
28
|
-
token?: string | undefined;
|
|
29
|
-
error_code?: "incorrect_number" | "invalid_number" | "invalid_expiry_date" | "invalid_cvc" | "expired_card" | "incorrect_cvc" | "incorrect_zip" | "incorrect_address" | "card_declined" | "processing_error" | "call_issuer" | "pick_up_card" | undefined;
|
|
30
|
-
} | undefined;
|
|
31
|
-
banking_billet?: {
|
|
32
|
-
code?: string | undefined;
|
|
33
|
-
valid_thru?: string | undefined;
|
|
34
|
-
text_lines?: string[] | undefined;
|
|
35
|
-
link?: string | undefined;
|
|
36
|
-
} | undefined;
|
|
37
|
-
loyalty_points?: {
|
|
38
|
-
name?: string | undefined;
|
|
39
|
-
program_id: string;
|
|
40
|
-
points_value: number;
|
|
41
|
-
ratio?: number | undefined;
|
|
42
|
-
} | undefined;
|
|
43
|
-
account_deposit?: {
|
|
44
|
-
valid_thru?: string | undefined;
|
|
45
|
-
text_lines?: string[] | undefined;
|
|
46
|
-
} | undefined;
|
|
47
|
-
currency_id?: string | undefined;
|
|
48
|
-
currency_symbol?: string | undefined;
|
|
49
|
-
discount?: number | undefined;
|
|
50
|
-
amount: number;
|
|
51
|
-
installments?: {
|
|
52
|
-
number: number;
|
|
53
|
-
value?: number | undefined;
|
|
54
|
-
tax?: boolean | undefined;
|
|
55
|
-
total?: number | undefined;
|
|
56
|
-
} | undefined;
|
|
57
|
-
creditor_fees?: {
|
|
58
|
-
installment?: number | undefined;
|
|
59
|
-
operational?: number | undefined;
|
|
60
|
-
intermediation?: number | undefined;
|
|
61
|
-
other?: number | undefined;
|
|
62
|
-
} | undefined;
|
|
63
|
-
status?: {
|
|
64
|
-
updated_at?: string | undefined;
|
|
65
|
-
current: "pending" | "under_analysis" | "authorized" | "unauthorized" | "paid" | "in_dispute" | "refunded" | "voided" | "unknown";
|
|
66
|
-
} | undefined;
|
|
67
|
-
flags?: string[] | undefined;
|
|
68
|
-
custom_fields?: {
|
|
69
|
-
field: string;
|
|
70
|
-
value: string;
|
|
71
|
-
}[] | undefined;
|
|
72
|
-
notes?: string | undefined;
|
|
73
|
-
};
|
|
74
|
-
}>;
|
|
75
|
-
export default _default;
|