rebill 1.0.27 → 1.1.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/README.md +61 -0
- package/npm-package/rebill/index.js +1 -0
- package/package.json +42 -7
- package/index.js +0 -1
- package/{sdk → npm-package/rebill/sdk}/index.d.ts +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Rebill SDK :rocket:
|
|
2
|
+
|
|
3
|
+
As we previously mentioned, this repository contains all the logic attributed to the SDK. Its main function is the initialization of the new SDK instance and sending messages to the iframe.
|
|
4
|
+
|
|
5
|
+
Its action is fundamental since **it allows the client to interact with the iframe without necessarily manipulating it.** The communication follows this flow: `client → sdk → iframe` (we will detail the responsibilities of this iframe in **[rebill-elements-v3](https://github.com/rebillto/rebill-elements-v3)**).
|
|
6
|
+
|
|
7
|
+
The V3 project is made with **Typescript** and built with **Webpack**. The resulting minified JS file is hosted in the AWS bucket named `rebill-sdk-demo-[env]`, with *env* taking the value associated with its environment (stg or prod).
|
|
8
|
+
|
|
9
|
+
In the same repository, the infrastructure necessary for the **npm package** named **`rebill`** is hosted, which gathers and makes all this logic available. The package is deployed on npm through an action configured in the project.
|
|
10
|
+
|
|
11
|
+
## Project Structure
|
|
12
|
+
|
|
13
|
+
Let's review directory by directory.
|
|
14
|
+
|
|
15
|
+
Outside of any folder in the project root, we have all the configuration files:
|
|
16
|
+
|
|
17
|
+
- package.json
|
|
18
|
+
- tsconfig.json
|
|
19
|
+
- webpack.prod.js: responsible for building the code for deployment on **AWS**
|
|
20
|
+
- webpack.config.js: responsible for building the code for the **NPM** package
|
|
21
|
+
|
|
22
|
+
Within `/src` live both the SDK V2 project, named as `panthon-sdk`, and also the V3 project simply called `sdk`.
|
|
23
|
+
|
|
24
|
+
We will not discuss the internal structure of the `panthon-sdk` directory since we no longer maintain this version, but we will detail the `sdk` folder associated with V3:
|
|
25
|
+
|
|
26
|
+
- index.ts: is the SDK's entry point, and all the methods later made available to the client are defined in it.
|
|
27
|
+
- constants.js: simply constants.
|
|
28
|
+
- services: services consumed in the application.
|
|
29
|
+
- schemas: type and interface definitions.
|
|
30
|
+
|
|
31
|
+
In the shared directory, there are common declarations for both SDK V2 and V3.
|
|
32
|
+
|
|
33
|
+
In `npm-package`, you'll find the structure associated with the NPM package. The `rebill` directory has the code that is later published as a downloadable package from NPM. The package allows the user to interact with all the functionality provided by the SDK, **without the need to manually add a script tag to their HTML**, but simply by downloading the library with their package manager. The `test` directory serves only to locally test the package before publishing it.
|
|
34
|
+
|
|
35
|
+
In `dist` is the **js minified** file that is later uploaded to the S3 bucket and is made available to clients as an option to consume the SDK.
|
|
36
|
+
|
|
37
|
+
In `demo`, examples of the SDK use cases are hosted for **local** testing.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
To use the project locally, simply add a `script tag` to the HTML in which you want to work and start using the methods exposed in the index.ts file of the `sdk` directory, as shown in the demos hosted in the `demo` directory.
|
|
42
|
+
|
|
43
|
+
To see the changes made in the code reflected, you need to rebuild the entire project with the `build` command, described in the package.json. After a build, the `/dist/v3/rebill.min.js` and `/npm-package/rebill/` files are created.
|
|
44
|
+
|
|
45
|
+
## env file
|
|
46
|
+
|
|
47
|
+
To use the project locally, you need the following environment variable configuration file:
|
|
48
|
+
```
|
|
49
|
+
LOCAL_ELEMENT=http://localhost:3006/v3/
|
|
50
|
+
API_BASE=http://localhost:8000
|
|
51
|
+
SDK_REBILL_GATEWAY=https://secure.rebill.dev
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
With `LOCAL_ELEMENT` being the variable associated with the iframe URL. If running locally, in conjunction with [Rebill Elements](https://www.notion.so/SDK-V3-Docs-interna-11435ba296a04ebaa6c30c72005694c8?pvs=21), the value set in the previous code snippet should be used. `API_BASE` refers to the URL associated with the backend where requests will be made, and lastly, `SDK_REBILL_GATEWAY` is the parameter associated with the anti-fraud engine that runs with each transaction.
|
|
55
|
+
|
|
56
|
+
## Build and Workflows
|
|
57
|
+
|
|
58
|
+
The project has two workflows that run upon making a push to the main branch:
|
|
59
|
+
|
|
60
|
+
- **deployment.yaml:** responsible for deploying to the S3 bucket. Both for stg and for
|
|
61
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Rebill=t():e.Rebill=t()}(this,(()=>(()=>{"use strict";var e={986:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.skeletonOptions=t.skeletonLight=t.skeletonDark=t.currencyByCountry=t.CONSTANTS=void 0,t.CONSTANTS={IFRAME_READY:"IFRAME_READY",ON_SUCCESS:"ON_SUCCESS",ON_ERROR:"ON_ERROR",SET_TEXT:"SET_TEXT",SET_REQUEST:"SET_REQUEST",SET_CARDHOLDER:"SET_CARDHOLDER",SET_STYLES:"SET_STYLES",SET_CURRENCY:"SET_CURRENCY",TRANSACTION_USE_CASE:"TRANSACTION_USE_CASE",SET_PRICE:"SET_PRICE",RENEW_CARD_USE_CASE:"RENEW_CARD_USE_CASE",ADD_CARD_USE_CASE:"ADD_CARD_USE_CASE",SET_CONFIG_OPTIONS:"SET_CONFIG_OPTIONS",SET_CUSTOMER:"SET_CUSTOMER",SET_HEIGHT:"SET_HEIGHT",SUBMIT_ACTION:"SUBMIT_ACTION",SET_DISABLED:"SET_DISABLED",SET_LOADING:"SET_LOADING"},t.currencyByCountry={AR:"ARS",BO:"BOB",CL:"CLP",UY:"UYU",MX:"MXN",CO:"COP",PE:"PEN",BR:"BRL",USD:"USD",INDIFFERENT:"USD"},t.skeletonDark=' <div\n style="\n width: 100%;\n height: 450px;\n margin-left: auto;\n margin-right: auto;\n overflow: hidden;\n "\n >\n <div\n id="1"\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n style="\n display: flex;\n gap: 1rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 25%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 75%; border-radius: 0.375rem"\n ></div>\n </div>\n <div\n class="skeleton"\n style="\n height: 3.5rem;\n width: 100%;\n border-radius: 0.375rem;\n margin-top: 1rem;\n "\n ></div>\n <div\n class="skeleton"\n style="\n height: 0.7rem;\n width: 30%;\n margin: 0 auto;\n border-radius: 0.2rem;\n margin-top: 2rem;\n "\n ></div>\n <div\n style="\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 2rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n </div>\n </div>\n <style>\n @keyframes pulse {\n 0% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: -100% 50%;\n }\n }\n\n .skeleton {\n background: #121212; /* Darker background for skeleton */\n background-image: linear-gradient(\n 90deg,\n #121212 25%,\n #1c1c1c 50%,\n #121212 75%\n );\n background-size: 200% 100%;\n background-position: 100% 50%;\n animation: pulse 1.5s infinite ease-in-out;\n }\n </style>',t.skeletonLight=' <div\n style="\n width: 100%;\n height: 450px;\n margin-left: auto;\n margin-right: auto;\n overflow: hidden;\n "\n >\n <div\n id="1"\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n style="\n display: flex;\n gap: 1rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 25%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 75%; border-radius: 0.375rem"\n ></div>\n </div>\n <div\n class="skeleton"\n style="\n height: 3.5rem;\n width: 100%;\n border-radius: 0.375rem;\n margin-top: 1rem;\n "\n ></div>\n <div\n class="skeleton"\n style="\n height: 0.7rem;\n width: 30%;\n margin: 0 auto;\n border-radius: 0.2rem;\n margin-top: 2rem;\n "\n ></div>\n <div\n style="\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 2rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n </div>\n </div>\n <style>\n @keyframes pulse {\n 0% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: -100% 50%;\n }\n }\n\n .skeleton {\n background: #cccccc;\n background-image: linear-gradient(\n 90deg,\n #cccccc 25%,\n #e2e2e2 50%,\n #cccccc 75%\n );\n background-size: 200% 100%;\n background-position: 100% 50%;\n animation: pulse 1.5s infinite ease-in-out;\n }\n </style>',t.skeletonOptions={dark:t.skeletonDark,light:t.skeletonLight,DEFAULT:t.skeletonLight}},815:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._propertyOrder=t.getValidPaymentMethodsStructure=t._GroupByPaymentMethod=void 0;const i=n(686);t._GroupByPaymentMethod=e=>{const t={};return e.forEach((e=>{const{type:n,metadata:i}=e;t[n]||(t[n]=[]),t[n].push(i)})),t};t.getValidPaymentMethodsStructure=e=>{if(!e)return{};const n={},i=(0,t._GroupByPaymentMethod)(e);return t._propertyOrder.forEach((e=>{i.hasOwnProperty(e)&&(n[e]=i[e])})),n||{}},t._propertyOrder=[i.PaymentMethodType.CARD,i.PaymentMethodType.TRANSFER,i.PaymentMethodType.CASH]},607:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},o=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(s,r){function o(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getCountryCodes=t.getCountries=t.getStatesBy=t.getIdentificationBy=t.setSdk=void 0;const a=r(n(160)),d=n(986),c=r(n(815)),l="https://sdk-iframe.rebill.to/v3/index.html";let h;t.setSdk=class{constructor(e){this.api_key=e,this.enableSync=!1,this.onSuccess=()=>{},this.onError=()=>{},this.onDisabled=()=>{},this.onLoading=()=>{},this.metadataObject={},this.styles={},this.gateway={},this.iframeHeight="450px",this.submitTransaction=!1,this.disabled=!1,window.addEventListener("message",(({data:e})=>{const{type:t,detail:n}=e;switch(t){case d.CONSTANTS.ON_SUCCESS:this.onSuccess(n);break;case d.CONSTANTS.ON_ERROR:this.onError(n);break;case d.CONSTANTS.SET_HEIGHT:const e=document.getElementById(this.html_id||"");e&&n&&(e.style.height=n);break;case d.CONSTANTS.SET_LOADING:this.onLoading(n);break;case d.CONSTANTS.SET_DISABLED:this.onDisabled(n)}}),!1),window.addEventListener(d.CONSTANTS.IFRAME_READY,(()=>{var e,t,n;const{rebill_elements:i}=window.frames;this.enableSync=!0,i.postMessage({type:d.CONSTANTS.TRANSACTION_USE_CASE,detail:this.paymentMethods},l),i.postMessage({type:d.CONSTANTS.ADD_CARD_USE_CASE,detail:this.customerId},l),i.postMessage({type:d.CONSTANTS.RENEW_CARD_USE_CASE,detail:this.subscriptionId},l),i.postMessage({type:d.CONSTANTS.SET_REQUEST,detail:this.getRequest()},l),i.postMessage({type:d.CONSTANTS.SET_CURRENCY,detail:null===(e=this.priceData)||void 0===e?void 0:e.price.currency},l),i.postMessage({type:d.CONSTANTS.SET_PRICE,detail:{id:null===(t=this.priceData)||void 0===t?void 0:t.price.id,quantity:null===(n=this.priceData)||void 0===n?void 0:n.quantity}},l),i.postMessage({type:d.CONSTANTS.SET_CONFIG_OPTIONS,detail:this.config},l),i.postMessage({type:d.CONSTANTS.SET_TEXT,detail:this.text},l),i.postMessage({type:d.CONSTANTS.SET_STYLES,detail:this.styles},l),i.postMessage({type:d.CONSTANTS.SET_CARDHOLDER,detail:this.cardHolder},l),i.postMessage({type:d.CONSTANTS.SET_CUSTOMER,detail:this.customer},l),i.postMessage({type:d.CONSTANTS.SUBMIT_ACTION,detail:this.submitTransaction},l)}))}setUpdate(){const{rebill_elements:e}=window.frames;e.postMessage({type:d.CONSTANTS.SET_REQUEST,detail:this.getRequest()},l)}getRequest(){return{PAYLOAD:Object.assign(Object.assign({metadataObject:this.metadataObject},this.transaction),{priceData:this.priceData,gateway:{type:this.gateway.type,country:this.gateway.country}}),REBILL_DEVICE_ID:h,API_KEY:this.api_key}}setCustomer(e){this.customer=e}renewCard(e){return o(this,void 0,void 0,(function*(){this.subscriptionId=e,this.setIframe()}))}addCard(e){return o(this,void 0,void 0,(function*(){this.customerId=e,this.setIframe()}))}setTransaction(e){return o(this,void 0,void 0,(function*(){var t;const{id:n,currency:i,quantity:s}=e,r=this.api_key,o=s||1;let l=i;if(l||(l=yield a.getCurrencyByCustomerLocation()),this.enableSync&&this.setUpdate(),this.html_id){const e=document.getElementById(this.html_id);if(e){const n=null===(t=this.styles)||void 0===t?void 0:t.rebill_skeleton_theme,i=d.skeletonOptions[n]||d.skeletonOptions.DEFAULT;e.innerHTML=i}}const h=yield a.getItemData(n,l,r),u=yield a.getOrganizationData(r);if(!u)throw new Error("The organization attached to this API key doesn't exist");if(!h)throw new Error("Neither product nor plan found with the given ID.");const{priceSetting:y,gateway:p}=h.price,S=y.paymentMethods;this.paymentMethods=c.getValidPaymentMethodsStructure(S);const m=u.alias.toUpperCase().includes("SANDBOX"),E=document.createElement("script");return E.src=m?`https://secure.rebill.dev/v1/Scripts/Antifraud.js?key=${p.publicKey}`:`https://secure.rebill.com/v1/Scripts/Antifraud.js?key=${p.publicKey}`,E.type="text/javascript",document.head.appendChild(E),this.priceData=Object.assign(Object.assign({},h),{quantity:o}),this.gateway={type:p.type,country:p.country},this.setIframe(),this.paymentMethods}))}setCallbacks(e){(null==e?void 0:e.onSuccess)&&(this.onSuccess=e.onSuccess),(null==e?void 0:e.onError)&&(this.onError=e.onError),(null==e?void 0:e.onLoading)&&(this.onLoading=e.onLoading),(null==e?void 0:e.onDisabled)&&(this.onDisabled=e.onDisabled)}setText(e){this.text=e,this.enableSync&&this.setUpdate()}setStyles(e){this.styles=e}setElements(e){var t;this.html_id=e;const n=document.getElementById(e);if(n){const e=null===(t=this.styles)||void 0===t?void 0:t.rebill_skeleton_theme,i=d.skeletonOptions[e]||d.skeletonOptions.DEFAULT;n.innerHTML=i}}setIframe(){const e=this.html_id;if(!e)throw new Error("Missing element id");setTimeout((()=>{var t;h=null===(t=null===window||void 0===window?void 0:window.fingerPrintModel)||void 0===t?void 0:t.sessionid;const n=document.getElementById(e);if(!n)throw new Error("HTMLElement invalid.");window.setReady=()=>{dispatchEvent(new CustomEvent(d.CONSTANTS.IFRAME_READY))};const i=`\n <iframe\n id="rebill_elements"\n title="rebill_elements"\n name="rebill_elements"\n src="${l}"\n onLoad="setReady()"\n style="height: 100%; width: 100%; border: unset; overflow: visible;"\n allow="clipboard-read; clipboard-write"\n />\n `;n.innerHTML=i}),1500)}setMetadata(e={}){const t=Object.assign(Object.assign({},this.metadataObject),e);this.metadataObject=t,this.enableSync&&this.setUpdate()}setConfigOptions(e){this.config=e,this.enableSync&&this.setUpdate()}setCardHolder(e){this.cardHolder=e,this.enableSync&&this.setUpdate()}submitPaymentWithCard(){return o(this,void 0,void 0,(function*(){this.submitTransaction=!0;const{rebill_elements:e}=window.frames;e.postMessage({type:d.CONSTANTS.SUBMIT_ACTION,detail:this.submitTransaction},l)}))}},t.getIdentificationBy=function(e){return o(this,void 0,void 0,(function*(){const t=yield fetch(`https://api.rebill.com/v2/data/identification/${e}`);if(!t.ok)throw new Error(`Error fetching identification data: ${t.status}`);return yield t.json()}))},t.getStatesBy=function(e){return o(this,void 0,void 0,(function*(){const t=yield fetch(`https://api.rebill.com/v2/data/states/${e}`);if(!t.ok)throw new Error(`Error fetching states data: ${t.status}`);return yield t.json()}))},t.getCountries=function(){return o(this,void 0,void 0,(function*(){const e=yield fetch("https://api.rebill.com/v2/data/countries");if(!e.ok)throw new Error(`Error fetching countries data: ${e.status}`);return yield e.json()}))},t.getCountryCodes=function(){return o(this,void 0,void 0,(function*(){const e=yield fetch("https://api.rebill.com/v2/data/countrycode");if(!e.ok)throw new Error(`Error fetching countries code data: ${e.status}`);return yield e.json()}))}},686:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethodType=void 0,function(e){e.CARD="CARD",e.CASH="CASH",e.TRANSFER="TRANSFER",e.WALLET="WALLET"}(n||(t.PaymentMethodType=n={}))},160:function(e,t,n){var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(s,r){function o(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrencyByCustomerLocation=t.getOrganizationData=t.getItemData=void 0;const s=n(986);t.getItemData=function(e,t,n){return i(this,void 0,void 0,(function*(){const i={itemId:e,currency:t},s=yield fetch("https://api.rebill.com/v2/item/checkout",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(i)});if(!s.ok)throw new Error("Network response was not ok");return yield s.json()}))},t.getOrganizationData=function(e){return i(this,void 0,void 0,(function*(){const t=yield fetch("https://api.rebill.com/v2/organization/",{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});if(!t.ok)throw new Error("Network response was not ok");return yield t.json()}))},t.getCurrencyByCustomerLocation=function(){return i(this,void 0,void 0,(function*(){try{const e=yield fetch("https://api.ipify.org/?format=json"),t=yield e.json(),n=yield fetch(`https://ipapi.co/${t.ip}/country_code/`),i=yield n.text();return s.currencyByCountry[i]||s.currencyByCountry.INDIFFERENT}catch(e){return console.error(e),s.currencyByCountry.INDIFFERENT}}))}}},t={};var n=function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}(607);return n})()));
|
package/package.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rebill",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A Pure JavaScript SDK to integrate Rebill into your web or ecosystem",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"repository": "https://github.com/rebillto/rebill",
|
|
6
|
+
"main": "./npm-package/rebill/index.js",
|
|
7
|
+
"types": "./npm-package/rebill/sdk/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
|
-
"index.js",
|
|
9
|
-
"sdk/index.d.ts"
|
|
9
|
+
"./npm-package/rebill/index.js",
|
|
10
|
+
"./npm-package/rebill/sdk/index.d.ts"
|
|
10
11
|
],
|
|
11
|
-
"scripts": {
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "webpack --watch --config ./webpack.prod.js",
|
|
14
|
+
"commit": "cz",
|
|
15
|
+
"build": "tsc --emitDeclarationOnly && webpack --config ./webpack.prod.js && webpack --config ./webpack.config.js",
|
|
16
|
+
"semantic-release": "semantic-release --branches main"
|
|
17
|
+
},
|
|
12
18
|
"keywords": [
|
|
13
19
|
"rebill",
|
|
14
20
|
"sdk",
|
|
@@ -16,5 +22,34 @@
|
|
|
16
22
|
"javascript",
|
|
17
23
|
"typescript"
|
|
18
24
|
],
|
|
19
|
-
"author": "Alejo Rojas"
|
|
25
|
+
"author": "Alejo Rojas",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.14.6",
|
|
29
|
+
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
30
|
+
"@babel/preset-env": "^7.14.7",
|
|
31
|
+
"@types/node": "^20.11.19",
|
|
32
|
+
"babel-loader": "^8.2.2",
|
|
33
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
34
|
+
"dotenv": "^16.4.5",
|
|
35
|
+
"dotenv-webpack": "^7.1.0",
|
|
36
|
+
"eslint": "^8.10.0",
|
|
37
|
+
"rollup": "^4.13.0",
|
|
38
|
+
"semantic-release": "^23.0.8",
|
|
39
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
40
|
+
"ts-loader": "^9.5.1",
|
|
41
|
+
"typescript": "^5.4.3",
|
|
42
|
+
"webpack": "^5.90.3",
|
|
43
|
+
"webpack-bundle-analyzer": "^4.10.1",
|
|
44
|
+
"webpack-cli": "^4.10.0",
|
|
45
|
+
"webpack-dev-server": "^4.6.0"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"@rebill-bindings:registry": "https://npm.pkg.github.com"
|
|
49
|
+
},
|
|
50
|
+
"config": {
|
|
51
|
+
"commitizen": {
|
|
52
|
+
"path": "./node_modules/cz-conventional-changelog"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
20
55
|
}
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Rebill=e():t.Rebill=e()}(this,(()=>(()=>{"use strict";var t={986:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.skeletonOptions=e.skeletonLight=e.skeletonDark=e.currencyByCountry=e.CONSTANTS=void 0,e.CONSTANTS={IFRAME_READY:"IFRAME_READY",ON_SUCCESS:"ON_SUCCESS",ON_ERROR:"ON_ERROR",SET_TEXT:"SET_TEXT",SET_REQUEST:"SET_REQUEST",SET_CARDHOLDER:"SET_CARDHOLDER",SET_STYLES:"SET_STYLES",SET_CURRENCY:"SET_CURRENCY",TRANSACTION_USE_CASE:"TRANSACTION_USE_CASE",SET_PRICE:"SET_PRICE",RENEW_CARD_USE_CASE:"RENEW_CARD_USE_CASE",ADD_CARD_USE_CASE:"ADD_CARD_USE_CASE",SET_CONFIG_OPTIONS:"SET_CONFIG_OPTIONS",SET_CUSTOMER:"SET_CUSTOMER",SET_HEIGHT:"SET_HEIGHT",SUBMIT_ACTION:"SUBMIT_ACTION",SET_DISABLED:"SET_DISABLED",SET_LOADING:"SET_LOADING"},e.currencyByCountry={AR:"ARS",BO:"BOB",CL:"CLP",UY:"UYU",MX:"MXN",CO:"COP",PE:"PEN",BR:"BRL",USD:"USD",INDIFFERENT:"USD"},e.skeletonDark=' <div\n style="\n width: 100%;\n height: 450px;\n margin-left: auto;\n margin-right: auto;\n overflow: hidden;\n "\n >\n <div\n id="1"\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n style="\n display: flex;\n gap: 1rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 25%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 75%; border-radius: 0.375rem"\n ></div>\n </div>\n <div\n class="skeleton"\n style="\n height: 3.5rem;\n width: 100%;\n border-radius: 0.375rem;\n margin-top: 1rem;\n "\n ></div>\n <div\n class="skeleton"\n style="\n height: 0.7rem;\n width: 30%;\n margin: 0 auto;\n border-radius: 0.2rem;\n margin-top: 2rem;\n "\n ></div>\n <div\n style="\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 2rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n </div>\n </div>\n <style>\n @keyframes pulse {\n 0% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: -100% 50%;\n }\n }\n\n .skeleton {\n background: #121212; /* Darker background for skeleton */\n background-image: linear-gradient(\n 90deg,\n #121212 25%,\n #1c1c1c 50%,\n #121212 75%\n );\n background-size: 200% 100%;\n background-position: 100% 50%;\n animation: pulse 1.5s infinite ease-in-out;\n }\n </style>',e.skeletonLight=' <div\n style="\n width: 100%;\n height: 450px;\n margin-left: auto;\n margin-right: auto;\n overflow: hidden;\n "\n >\n <div\n id="1"\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n style="\n display: flex;\n gap: 1rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 25%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 75%; border-radius: 0.375rem"\n ></div>\n </div>\n <div\n class="skeleton"\n style="\n height: 3.5rem;\n width: 100%;\n border-radius: 0.375rem;\n margin-top: 1rem;\n "\n ></div>\n <div\n class="skeleton"\n style="\n height: 0.7rem;\n width: 30%;\n margin: 0 auto;\n border-radius: 0.2rem;\n margin-top: 2rem;\n "\n ></div>\n <div\n style="\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 2rem;\n align-items: center;\n margin-top: 1rem;\n "\n >\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n <div\n class="skeleton"\n style="height: 3rem; width: 100%; border-radius: 0.375rem"\n ></div>\n </div>\n </div>\n <style>\n @keyframes pulse {\n 0% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: -100% 50%;\n }\n }\n\n .skeleton {\n background: #cccccc;\n background-image: linear-gradient(\n 90deg,\n #cccccc 25%,\n #e2e2e2 50%,\n #cccccc 75%\n );\n background-size: 200% 100%;\n background-position: 100% 50%;\n animation: pulse 1.5s infinite ease-in-out;\n }\n </style>',e.skeletonOptions={dark:e.skeletonDark,light:e.skeletonLight,DEFAULT:e.skeletonLight}},815:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e._propertyOrder=e.getValidPaymentMethodsStructure=e._GroupByPaymentMethod=void 0;var r=n(686);e._GroupByPaymentMethod=function(t){var e={};return t.forEach((function(t){var n=t.type,r=t.metadata;e[n]||(e[n]=[]),e[n].push(r)})),e};e.getValidPaymentMethodsStructure=function(t){if(!t)return{};var n={},r=(0,e._GroupByPaymentMethod)(t);return e._propertyOrder.forEach((function(t){r.hasOwnProperty(t)&&(n[t]=r[t])})),n||{}},e._propertyOrder=[r.PaymentMethodType.CARD,r.PaymentMethodType.TRANSFER,r.PaymentMethodType.CASH]},607:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},c=this&&this.__generator||function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getCountryCodes=e.getCountries=e.getStatesBy=e.getIdentificationBy=e.setSdk=void 0;var u,d=s(n(160)),l=n(986),h=s(n(815)),p="https://sdk-iframe.rebill.to/v3/index.html",y=function(){function t(t){var e=this;this.api_key=t,this.enableSync=!1,this.onSuccess=function(){},this.onError=function(){},this.onDisabled=function(){},this.onLoading=function(){},this.metadataObject={},this.styles={},this.gateway={},this.iframeHeight="450px",this.submitTransaction=!1,this.disabled=!1,window.addEventListener("message",(function(t){var n=t.data,r=n.type,i=n.detail;switch(r){case l.CONSTANTS.ON_SUCCESS:e.onSuccess(i);break;case l.CONSTANTS.ON_ERROR:e.onError(i);break;case l.CONSTANTS.SET_HEIGHT:var o=document.getElementById(e.html_id||"");o&&i&&(o.style.height=i);break;case l.CONSTANTS.SET_LOADING:e.onLoading(i);break;case l.CONSTANTS.SET_DISABLED:e.onDisabled(i)}}),!1),window.addEventListener(l.CONSTANTS.IFRAME_READY,(function(){var t,n,r,i=window.frames.rebill_elements;e.enableSync=!0,i.postMessage({type:l.CONSTANTS.TRANSACTION_USE_CASE,detail:e.paymentMethods},p),i.postMessage({type:l.CONSTANTS.ADD_CARD_USE_CASE,detail:e.customerId},p),i.postMessage({type:l.CONSTANTS.RENEW_CARD_USE_CASE,detail:e.subscriptionId},p),i.postMessage({type:l.CONSTANTS.SET_REQUEST,detail:e.getRequest()},p),i.postMessage({type:l.CONSTANTS.SET_CURRENCY,detail:null===(t=e.priceData)||void 0===t?void 0:t.price.currency},p),i.postMessage({type:l.CONSTANTS.SET_PRICE,detail:{id:null===(n=e.priceData)||void 0===n?void 0:n.price.id,quantity:null===(r=e.priceData)||void 0===r?void 0:r.quantity}},p),i.postMessage({type:l.CONSTANTS.SET_CONFIG_OPTIONS,detail:e.config},p),i.postMessage({type:l.CONSTANTS.SET_TEXT,detail:e.text},p),i.postMessage({type:l.CONSTANTS.SET_STYLES,detail:e.styles},p),i.postMessage({type:l.CONSTANTS.SET_CARDHOLDER,detail:e.cardHolder},p),i.postMessage({type:l.CONSTANTS.SET_CUSTOMER,detail:e.customer},p),i.postMessage({type:l.CONSTANTS.SUBMIT_ACTION,detail:e.submitTransaction},p)}))}return t.prototype.setUpdate=function(){window.frames.rebill_elements.postMessage({type:l.CONSTANTS.SET_REQUEST,detail:this.getRequest()},p)},t.prototype.getRequest=function(){return{PAYLOAD:r(r({metadataObject:this.metadataObject},this.transaction),{priceData:this.priceData,gateway:{type:this.gateway.type,country:this.gateway.country}}),REBILL_DEVICE_ID:u,API_KEY:this.api_key}},t.prototype.setCustomer=function(t){this.customer=t},t.prototype.renewCard=function(t){return a(this,void 0,void 0,(function(){return c(this,(function(e){return this.subscriptionId=t,this.setIframe(),[2]}))}))},t.prototype.addCard=function(t){return a(this,void 0,void 0,(function(){return c(this,(function(e){return this.customerId=t,this.setIframe(),[2]}))}))},t.prototype.setTransaction=function(t){return a(this,void 0,void 0,(function(){var e,n,i,o,s,a,u,p,y,f,S,m,v,E,g,T,b,_;return c(this,(function(c){switch(c.label){case 0:return e=t.id,n=t.currency,i=t.quantity,o=this.api_key,s=i||1,(a=n)?[3,2]:[4,d.getCurrencyByCustomerLocation()];case 1:a=c.sent(),c.label=2;case 2:return this.enableSync&&this.setUpdate(),this.html_id&&(u=document.getElementById(this.html_id))&&(p=null===(_=this.styles)||void 0===_?void 0:_.rebill_skeleton_theme,y=l.skeletonOptions[p]||l.skeletonOptions.DEFAULT,u.innerHTML=y),[4,d.getItemData(e,a,o)];case 3:return f=c.sent(),[4,d.getOrganizationData(o)];case 4:if(!(S=c.sent()))throw new Error("The organization attached to this API key doesn't exist");if(!f)throw new Error("Neither product nor plan found with the given ID.");return m=f.price,v=m.priceSetting,E=m.gateway,g=v.paymentMethods,this.paymentMethods=h.getValidPaymentMethodsStructure(g),T=S.alias.toUpperCase().includes("SANDBOX"),(b=document.createElement("script")).src=T?"https://secure.rebill.dev/v1/Scripts/Antifraud.js?key=".concat(E.publicKey):"".concat("https://secure.rebill.com","/v1/Scripts/Antifraud.js?key=").concat(E.publicKey),b.type="text/javascript",document.head.appendChild(b),this.priceData=r(r({},f),{quantity:s}),this.gateway={type:E.type,country:E.country},this.setIframe(),[2,this.paymentMethods]}}))}))},t.prototype.setCallbacks=function(t){(null==t?void 0:t.onSuccess)&&(this.onSuccess=t.onSuccess),(null==t?void 0:t.onError)&&(this.onError=t.onError),(null==t?void 0:t.onLoading)&&(this.onLoading=t.onLoading),(null==t?void 0:t.onDisabled)&&(this.onDisabled=t.onDisabled)},t.prototype.setText=function(t){this.text=t,this.enableSync&&this.setUpdate()},t.prototype.setStyles=function(t){this.styles=t},t.prototype.setElements=function(t){var e;this.html_id=t;var n=document.getElementById(t);if(n){var r=null===(e=this.styles)||void 0===e?void 0:e.rebill_skeleton_theme,i=l.skeletonOptions[r]||l.skeletonOptions.DEFAULT;n.innerHTML=i}},t.prototype.setIframe=function(){var t=this.html_id;if(!t)throw new Error("Missing element id");setTimeout((function(){var e;u=null===(e=null===window||void 0===window?void 0:window.fingerPrintModel)||void 0===e?void 0:e.sessionid;var n=document.getElementById(t);if(!n)throw new Error("HTMLElement invalid.");window.setReady=function(){dispatchEvent(new CustomEvent(l.CONSTANTS.IFRAME_READY))};var r='\n <iframe\n id="rebill_elements"\n title="rebill_elements"\n name="rebill_elements"\n src="'.concat(p,'"\n onLoad="setReady()"\n style="height: 100%; width: 100%; border: unset; overflow: visible;"\n allow="clipboard-read; clipboard-write"\n />\n ');n.innerHTML=r}),1500)},t.prototype.setMetadata=function(t){void 0===t&&(t={});var e=r(r({},this.metadataObject),t);this.metadataObject=e,this.enableSync&&this.setUpdate()},t.prototype.setConfigOptions=function(t){this.config=t,this.enableSync&&this.setUpdate()},t.prototype.setCardHolder=function(t){this.cardHolder=t,this.enableSync&&this.setUpdate()},t.prototype.submitPaymentWithCard=function(){return a(this,void 0,void 0,(function(){return c(this,(function(t){return this.submitTransaction=!0,window.frames.rebill_elements.postMessage({type:l.CONSTANTS.SUBMIT_ACTION,detail:this.submitTransaction},p),[2]}))}))},t}();e.setSdk=y,e.getIdentificationBy=function(t){return a(this,void 0,void 0,(function(){var e;return c(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat("https://api.rebill.com","/v2/data/identification/").concat(t))];case 1:if(!(e=n.sent()).ok)throw new Error("Error fetching identification data: ".concat(e.status));return[4,e.json()];case 2:return[2,n.sent()]}}))}))},e.getStatesBy=function(t){return a(this,void 0,void 0,(function(){var e;return c(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat("https://api.rebill.com","/v2/data/states/").concat(t))];case 1:if(!(e=n.sent()).ok)throw new Error("Error fetching states data: ".concat(e.status));return[4,e.json()];case 2:return[2,n.sent()]}}))}))},e.getCountries=function(){return a(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:return[4,fetch("".concat("https://api.rebill.com","/v2/data/countries"))];case 1:if(!(t=e.sent()).ok)throw new Error("Error fetching countries data: ".concat(t.status));return[4,t.json()];case 2:return[2,e.sent()]}}))}))},e.getCountryCodes=function(){return a(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:return[4,fetch("".concat("https://api.rebill.com","/v2/data/countrycode"))];case 1:if(!(t=e.sent()).ok)throw new Error("Error fetching countries code data: ".concat(t.status));return[4,t.json()];case 2:return[2,e.sent()]}}))}))}},686:(t,e)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.PaymentMethodType=void 0,function(t){t.CARD="CARD",t.CASH="CASH",t.TRANSFER="TRANSFER",t.WALLET="WALLET"}(n||(e.PaymentMethodType=n={}))},160:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getCurrencyByCustomerLocation=e.getOrganizationData=e.getItemData=void 0;var o=n(986);e.getItemData=function(t,e,n){return r(this,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return r={itemId:t,currency:e},[4,fetch("".concat("https://api.rebill.com","/v2/item/checkout"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(r)})];case 1:if(!(o=i.sent()).ok)throw new Error("Network response was not ok");return[4,o.json()];case 2:return[2,i.sent()]}}))}))},e.getOrganizationData=function(t){return r(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat("https://api.rebill.com","/v2/organization/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}})];case 1:if(!(e=n.sent()).ok)throw new Error("Network response was not ok");return[4,e.json()];case 2:return[2,n.sent()]}}))}))},e.getCurrencyByCustomerLocation=function(){return r(this,void 0,void 0,(function(){var t,e,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,fetch("https://api.ipify.org/?format=json")];case 1:return[4,r.sent().json()];case 2:return t=r.sent(),[4,fetch("https://ipapi.co/".concat(t.ip,"/country_code/"))];case 3:return[4,r.sent().text()];case 4:return e=r.sent(),[2,o.currencyByCountry[e]||o.currencyByCountry.INDIFFERENT];case 5:return n=r.sent(),console.error(n),[2,o.currencyByCountry.INDIFFERENT];case 6:return[2]}}))}))}}},e={};var n=function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}(607);return n})()));
|
|
@@ -35,8 +35,8 @@ export declare class setSdk {
|
|
|
35
35
|
iframeHeight: string;
|
|
36
36
|
config?: Config;
|
|
37
37
|
submitTransaction: boolean;
|
|
38
|
-
disabled: boolean;
|
|
39
38
|
paymentMethods?: Partial<PaymentMethodsByType>;
|
|
39
|
+
disabled: boolean;
|
|
40
40
|
constructor(apiKey: string);
|
|
41
41
|
setUpdate(): void;
|
|
42
42
|
getRequest(): {
|