Jump to content

CryptoPay PrestaShop 9 March 2022 - Cryptocurrency payment module for PrestaShop


uQs
 Share

Recommended Posts

  • Administrators

image.png

CryptoPay PrestaShop 9 March 2022 - Cryptocurrency payment module for PrestaShop

With CryptoPay PrestaShop, it is now very easy to get paid with cryptocurrencies. Moreover, you can do this directly through cryptocurrency wallets.

What advantages does CryptoPay PrestaShop provide you?
As you know, virtual POS and many other payment methods deduct commission from you. The only commission here is the “gas” fee that blockchain networks charge. So the money will be transferred directly to your account. You can receive payments with all blockchain networks that have the RPC API and support the wallet that the user is currently using, and tokens and native currencies under these networks.

Apart from that, here are the advantages that CryptoPay PrestaShop gives you:
No 3rd party service
No withdrawal limit, fee, date
1-2 business days and no weekend nonsense
The money is in your account and in use on the same day

demo.png

https://codecanyon.net/item/cryptopay-prestashop-cryptocurrency-payment-plugin-for-prestashop/36435172

download.png

CryptoPay - 9 March 2022.zip

  • Like 2
Link to comment
Share on other sites

  • 536
  • 3.5k
  • 188
  • 1 month later...

Sorry for the late answer. The answer is not working with Bitcoin network because it is built on Ethereum network and you give just one wallet address. 
Ethereum, Binance, Polygon and other networks which built on Ethereum you can use them.

Link to comment
Share on other sites

  • 9
  • 22
  • 1

Sorry for the late answer. The answer is not working with Bitcoin network because it is built on Ethereum network and you give just one wallet address. 
Ethereum, Binance, Polygon and other networks which built on Ethereum you can use them.

 

P.S.: I tried this addon but it seems on the payment page it doesn't appear. When I am saving the settings then it is asking for license code. I tried to add different words and combinations but it says the settings are saved without the license code.

When I am tried in the product page to buy a product then in the payment options the CryptoPay doesn't appear. I think without license key the CryptoPay payment will not appear.

I checked also the Payment Settings and the country, carrier, currency have checked the CryptoPay so I don't think it will be problem with the settings.

Link to comment
Share on other sites

  • 9
  • 22
  • 1

Alright. I fixed the issue by the following:

Go to the cryptopay/controllers/admin/ folder and open the settingssave.php with a text editor or with an app which you usually using for coding. Change the content to this and save:

<?php

use Beycan\Response;
use Beycan\EnvatoLicenseChecker;

class SettingsSaveController extends ModuleAdminController
{

    public function initContent()
    {   
        Response::error($this->l('GET method is not allowed!'));
    }

    public function postProcess()
    {
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {

            $message = $this->l("Settings saved successfully!");
            $settings = Tools::getAllValues();


            Configuration::updateValue('cryptoPaySettings', json_encode($settings));

            Response::success($message);
        }
        
    }

}

 

I deleted this part if someone is asking what is the change:

  EnvatoLicenseChecker::setBearerToken('ByCEVCxTrZ4mJPtAS0tAJn1hucs8Koce');
            if (isset($settings['license']) && EnvatoLicenseChecker::check($settings['license']) === false) {
                unset($settings['license']);
                $message = $this->l("License code could not be updated because it was not correct, but other settings were updated successfully! Please enter a valid license code.");
            }

 

  • Like 1
Link to comment
Share on other sites

  • 9
  • 22
  • 1

Sorry for the spam just now I saw that when I am clicking to accept the terms of service doesn't do anything. I am using the PrestaShop 1.7.8.7 version and it seems this addon doesn't recognize if I accept it. I did little change in the following file cryptopay/views/cryptopay/js/app.js file:

Changed this

var e = document.getElementById("conditions-to-approve");
                        if (e) {
                            var t = document.querySelector('input[type="checkbox"]').checked;
                            if (!t) return I.infoPopup(this.$root.config.lang.generalConditions)
                        }

to this:

var e = document.getElementById("conditions_to_approve[terms-and-conditions]");
                        if (e) {
                            var t = e.checked;
                            if (!t) return I.infoPopup(this.$root.config.lang.generalConditions)
                        }

 

Maybe it is just my version of the PrestaShop which not ok with this addon but if someone else have the similar issue just check what is the element id of your terms of service and if it same then just change to the above code. Otherwise here is the full version of that file:

!function(e){function n(n){for(var a,r,s=n[0],i=n[1],d=n[2],u=0,l=[];u<s.length;u++)r=s[u],Object.prototype.hasOwnProperty.call(o,r)&&o[r]&&l.push(o[r][0]),o[r]=0;for(a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a]);for(p&&p(n);l.length;)l.shift()();return c.push.apply(c,d||[]),t()}function t(){for(var e,n=0;n<c.length;n++){for(var t=c[n],a=!0,s=1;s<t.length;s++)0!==o[t[s]]&&(a=!1);a&&(c.splice(n--,1),e=r(r.s=t[0]))}return e}var a={},o={app:0},c=[];function r(n){if(a[n])return a[n].exports;var t=a[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=e,r.c=a,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n||4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)r.d(t,a,(function(n){return e[n]}).bind(null,a));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="";var s=window.webpackJsonp=window.webpackJsonp||[],i=s.push.bind(s);s.push=n,s=s.slice();for(var d=0;d<s.length;d++)n(s[d]);var p=i;c.push([0,"chunk-vendors"]),t()}({0:function(e,n,t){e.exports=t("56d7")},4065:function(e,n,t){"use strict";t("f5f0")},"56d7":function(e,n,t){"use strict";t.r(n),t("e260"),t("e6cf"),t("cca6"),t("a79d"),t("d3b7"),t("159b"),t("4fad"),t("e9c4"),t("8a79");var a=t("f2bf"),o={key:1};t("b0c0");var c={class:"connect"},r={class:"connector-modal",ref:"modal"},s={class:"cp-modal-content"},i={key:0,class:"wallets"},d=["onClick"],p={class:"wallet-icon"},u=["src","alt"],l={class:"wallet-name"},f=t("3835"),m=t("53ca"),y=t("1da1"),g=(t("96cf"),t("3d20")),h=t.n(g);function $(){var e=document.createElement("div");e.className+="overlay",e.style.backgroundColor="#EFEFEF",e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.zIndex="999999999999999",e.style.top="0px",e.style.left="0px",e.style.opacity=".5",document.body.appendChild(e)}var b={Swal:h.a,infoPopup:function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return h.a.fire({title:n,html:t,icon:"info",didOpen:function(){h.a.hideLoading()}})},errorPopup:function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return h.a.fire({title:n,html:t,icon:"error",didOpen:function(){h.a.hideLoading()}})},successPopup:function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return h.a.fire({title:n,html:t,icon:"success",didOpen:function(){h.a.hideLoading()}})},waitingPopup:function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;h.a.fire({title:n,html:t,allowOutsideClick:!1,didOpen:function(){h.a.showLoading()}})},afterPayment:function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;n&&void 0!==n.redirect&&($(),"reload"==n.redirect?location.reload():location.href=n.redirect)},disableScreen:$,ongoingProcess:function e(){window.onbeforeunload=function(){return"There is an ongoing process, please do not close the browser."}},ongoingProcessEnded:function e(){window.onbeforeunload=!1}},_=(t("4065"),t("6b0d")),v=t.n(_);let C=v()({name:"Connector",emits:["connected"],data:function(){return{acceptedWallets:null,isShow:!1}},mounted:function(){var e=this;this.$nextTick(function(){window.addEventListener("click",function(n){n.target==e.$refs.modal&&(e.isShow=!1)}),localStorage.removeItem("walletconnect")})},methods:{showModal:function(){var e=document.getElementById("conditions_to_approve[terms-and-conditions]");if(e&&!e.checked)return b.infoPopup(this.$root.config.lang.generalConditions);this.isShow=!0},connect:function(e){var n=this;return Object(y.a)(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:"walletconnect"!=e&&b.waitingPopup(n.$root.config.lang.conditionsOfSale),n.$root.multiChain.connect(e).then(Object(y.a)(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n.$root.multiChain.connector.chainChanged(function(){window.location.reload()}),n.$root.multiChain.connector.accountsChanged(function(){window.location.reload()}),n.$root.multiChain.connector.disconnectEvent(function(){window.location.reload()}),h.a.close(),n.$emit("connected");case 5:case"end":return e.stop()}},e)}))).catch(function(e){n.errorMessages(e)});case 2:case"end":return t.stop()}},t)}))()},errorMessages:function(e){if("object"===Object(m.a)(e))4001==e.code||"An unexpected error occurred"==e.message?b.infoPopup(this.$root.config.lang.connectionRefused):"User closed modal"!=e.message&&b.errorPopup(e.message);else if("not-accepted-chain"==e){var n="",t=this.$root.multiChain.acceptedChains,a=this.$root.config.lang.notSupportedChain;if(void 0!==t&&0!=Object.entries(t).length){n+="<h4>".concat(this.$root.config.lang.supportedNetworks,"</h4>");for(var o=0,c=Object.entries(t);o<c.length;o++){var r=Object(f.a)(c[o],2);n+=(r[0],r[1]).name+"<br>"}}else a=this.$root.config.lang.notFoundAcceptedChains;b.infoPopup(a,n)}else"connection-failed"==e?b.errorPopup(this.$root.config.lang.connectionFailed):"wallet-not-detected"==e?b.infoPopup(this.$root.config.lang.notDetected):"not-found-infura-id"==e?b.infoPopup(this.$root.config.lang.notFoundInfuraId):"already-processing"==e?b.infoPopup(this.$root.config.lang.alreadyProcessing):b.errorPopup(e.message)}}},[["render",function e(n,t,o,f,m,y){return Object(a.i)(),Object(a.e)(a.a,null,[Object(a.f)("div",c,[Object(a.f)("button",{class:"cp-btn",onClick:t[0]||(t[0]=function(){return y.showModal&&y.showModal.apply(y,arguments)})},Object(a.n)(n.$root.config.lang.connect),1)]),Object(a.p)(Object(a.f)("div",r,[Object(a.f)("div",s,[0!=n.$root.multiChain.acceptedWallets.length?(Object(a.i)(),Object(a.e)("ul",i,[(Object(a.i)(!0),Object(a.e)(a.a,null,Object(a.l)(n.$root.multiChain.acceptedWallets,function(e){return Object(a.i)(),Object(a.e)("li",{class:"wallet",key:e,onClick:function(n){return y.connect(e)}},[Object(a.f)("div",p,[Object(a.f)("img",{src:n.$root.config.imagesUrl+"/".concat(e,".png"),alt:e},null,8,u)]),Object(a.f)("div",l,Object(a.n)(n.$root.multiChain.wallets[e].name),1)],8,d)}),128))])):Object(a.d)("",!0)])],512),[[a.o,n.isShow]])],64)}],["__scopeId","data-v-a204d0b8"]]);var x={class:"cp-modal",ref:"modal"},P={class:"cp-modal-content"},w={class:"content-group"},k={class:"title"},I={class:"content"},D={class:"content-group"},A={class:"title"},E={class:"content overflow"},T={class:"content-group"},B={class:"title"},U={class:"content overflow"},S={class:"content-group"},F={class:"title"},M={class:"content"},O={class:"content-group w-100"},W={class:"title"},N={class:"content"},R={class:"currencies",ref:"currencies"},H=["onClick"],L=["src","alt"],j={key:0,class:"currency-symbol"},V={class:"payment"},X=["disabled"];t("b680"),t("ac1f"),t("5319");var J=t("d4ec"),z=t("bee2"),G=(t("99af"),function(){function e(n){Object(J.a)(this,e),this.vue=n,this.formData=new FormData}return Object(z.a)(e,[{key:"updatePayload",value:function(){this.payload=Object.assign({senderAddress:this.vue.$root.multiChain.connectedAccount,usedChain:this.vue.$root.multiChain.activeChain,usedWallet:this.vue.$root.multiChain.connectedWallet.name},this.payload,this.vue.paymentInfo),this.formData.set("paymentInfo",JSON.stringify(this.payload))}},{key:"payment",value:function(){var e=this;this.updatePayload(),this.checkPayment().then(function(n){var t;e.payload.paymentPrice=n.paymentPrice,e.payload.receiver=n.receiver,e.startPay().then((t=Object(y.a)(regeneratorRuntime.mark(function n(t){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e.payload.transactionId=t.getId(),n.next=3,e.saveTransaction();case 3:e.verifyPayment();case 4:case"end":return n.stop()}},n)})),function(e){return t.apply(this,arguments)}))})}},{key:"startPay",value:function(){var e=this;return b.ongoingProcess(),b.waitingPopup(this.vue.$root.config.lang.confirmWithWallet),new Promise(function(n,t){var a=e.vue.paymentInfo.selectedCurrency.address;e.vue.$root.multiChain.transfer(e.payload.receiver,e.payload.paymentPrice,a).then(function(e){b.ongoingProcessEnded(),n(e)}).catch(function(n){b.ongoingProcessEnded(),"insufficient-balance"==n?b.infoPopup(e.vue.$root.config.lang.insufficientBalance):"chain-changed"==n?b.infoPopup(e.vue.$root.config.lang.chainChanged).then(function(){b.disableScreen(),location.reload()}):"transfer-amount-error"==n?b.infoPopup(e.vue.$root.config.lang.transferAmount):4001==n.code||"Rejected by user"==n.error||"cancelled"==n.message||"User canceled"==n.message||"User rejected the transaction"==n.message||n.message.indexOf("User")>-1||n.message.indexOf("Rejected")>-1||n.message.indexOf("cancelled")>-1||n.message.indexOf("canceled")>-1||n.message.indexOf("rejected")>-1?b.infoPopup(e.vue.$root.config.lang.paymentRejected):-32603==n.code?b.infoPopup(e.vue.$root.config.lang.intrinsicGasTooLow):"transaction underpriced"==n.message?b.infoPopup(e.vue.$root.config.lang.unexpectedError).then(function(){location.reload()}):b.infoPopup(e.vue.$root.config.lang.unexpectedError),t(n)})})}},{key:"checkPayment",value:function(){var e=this;return b.ongoingProcess(),b.waitingPopup(this.vue.$root.config.lang.pleaseWait),new Promise(function(n){e.vue.axios.post("/check-payment",e.formData).then(function(e){e.data.success?n(e.data.data):(b.ongoingProcessEnded(),b.errorPopup(e.data.message).then(function(){b.afterPayment(e.data.data)}))}).catch(function(n){b.ongoingProcessEnded(),void 0!==n.response?b.errorPopup(n.response.data.message).then(function(){b.afterPayment(n.response.data.data)}):b.errorPopup(e.vue.$root.config.lang.unexpectedError)})})}},{key:"verifyPayment",value:function(){var e=this;try{var n=this.vue.$root.multiChain.transaction(this.payload.transactionId);b.ongoingProcess(),b.waitingPopup(this.vue.$root.config.lang.verifyTransaction,"".concat(this.vue.$root.config.lang.transactionId,' <a href="').concat(n.getTransactionUrl(),'" target="_blank">').concat(n.getId(),"</a>"));var t=this.vue.paymentInfo.selectedCurrency.address;n.verifyWithData(this.payload.receiver,this.payload.paymentPrice,t).then(function(){e.paymentFinished("verified")}).catch(function(){e.paymentFinished("failed")}).finally(function(){b.ongoingProcessEnded()})}catch(a){b.errorPopup(a.message)}}},{key:"paymentFinished",value:function(e){var n=this;b.ongoingProcess(),this.payload.status=e,this.updatePayload(),this.vue.axios.post("/payment-finished",this.formData).then(function(e){e.data.success?b.successPopup(e.data.message).then(function(){b.afterPayment(e.data.data)}):b.errorPopup(e.data.message).then(function(){b.afterPayment(e.data.data)})}).catch(function(e){void 0!==e.response?b.errorPopup(e.response.data.message).then(function(){b.afterPayment(e.response.data.data)}):b.errorPopup(n.vue.$root.config.lang.paymentFailed).then(function(){b.afterPayment({redirect:"reload"})})}).then(function(){b.ongoingProcessEnded()})}},{key:"saveTransaction",value:function(){return this.updatePayload(),this.vue.axios.post("/save-transaction",this.formData)}}]),e}()),q=t("bc3a"),K=t.n(q);t("7552");let Q=v()({name:"Payment",emits:["disconnect"],data:function(){return{converting:!1,paymentInfo:{},selectedCurrency:null,paymentButtonText:!1,activeChain:{},Payment:null}},created:function(){this.Payment=new G(this),this.paymentInfo.order=this.$root.config.order,this.paymentButtonText=this.$root.config.lang.notCurrencySelected,this.activeChain=this.$root.config.acceptedChains[this.$root.multiChain.activeChain.hexId],this.axios=K.a},methods:{disconnect:function(){this.$emit("disconnect"),this.paymentInfo.paymentPrice=void 0},changeSelectedCurrency:function(e){var n=this;return Object(y.a)(regeneratorRuntime.mark(function t(){var a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.converting){t.next=2;break}return t.abrupt("return");case 2:return n.selectedCurrency=e,n.paymentInfo.selectedCurrency=e,n.$refs.payment.setAttribute("disabled","disabled"),n.paymentButtonText=n.$root.config.lang.pleaseWait,n.converting=!0,t.next=9,n.calculatePaymentPrice(e);case 9:!1===(a=t.sent)?(b.errorPopup(n.$root.config.lang.problemConvertingCurrency),n.paymentButtonText=n.$root.config.lang.notCurrencySelected):("object"==Object(m.a)(a)?(n.paymentInfo.paymentPrice=a.discountPrice,n.paymentInfo.realPrice=a.realPrice):n.paymentInfo.paymentPrice=a,n.paymentInfo.paymentCurrency=e.symbol,n.$refs.payment.removeAttribute("disabled"),n.paymentButtonText=n.$root.config.lang.payWith+" "+n.paymentInfo.paymentPrice+" "+n.paymentInfo.paymentCurrency,n.setSelectedCurrencyDecimals()),n.converting=!1;case 12:case"end":return t.stop()}},t)}))()},setSelectedCurrencyDecimals:function(){var e=this;return Object(y.a)(regeneratorRuntime.mark(function n(){var t,a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if((t=e.paymentInfo.selectedCurrency).address!=e.$root.multiChain.activeChain.nativeCurrency.symbol){n.next=5;break}a=e.$root.multiChain.coin().getDecimals(),n.next=8;break;case 5:return n.next=7,e.$root.multiChain.token(t.address).getDecimals();case 7:a=n.sent;case 8:e.paymentInfo.selectedCurrency.decimals=a;case 9:case"end":return n.stop()}},n)}))()},calculatePaymentPrice:function(e){var n=this;return Object(y.a)(regeneratorRuntime.mark(function t(){var a,o,c,r,s,i,d;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n.$root.config.order.currency,o=n.$root.config.order.price,void 0===n.$root.config.customTokens||!n.$root.config.customTokens[e.symbol]){t.next=12;break}if(!(r=n.$root.config.customTokens[e.symbol])[a]){t.next=9;break}c=parseFloat((c=o*r[a]).toFixed(6)),t.next=10;break;case 9:return t.abrupt("return",!1);case 10:case 19:t.next=26;break;case 12:if("cryptocompare"!=n.$root.config.converter){t.next=21;break}return s=new MultiChain.currencyConverter(n.$root.config.converter),t.next=16,s.convert(a,e.symbol,o);case 16:if(c=t.sent){t.next=19;break}return t.abrupt("return",!1);case 21:return t.next=23,n.getPaymentPrice(a,e.symbol,o);case 23:if(c=t.sent){t.next=26;break}return t.abrupt("return",!1);case 26:if(void 0===n.$root.config.tokenDiscounts||!n.$root.config.tokenDiscounts[e.symbol]){t.next=37;break}return i=n.$root.config.tokenDiscounts[e.symbol],"cryptocompare"!=n.$root.config.converter&&(c=100*c/(100-i)),d=(c=parseFloat(c))*i/100,d=parseFloat((c-d).toFixed(6)),n.paymentInfo.discountRate=i,n.paymentInfo.realPrice=c,t.abrupt("return",{realPrice:c.toFixed(6),discountPrice:d});case 37:delete n.paymentInfo.discountRate,delete n.paymentInfo.realPrice;case 39:return t.abrupt("return",parseFloat(c.toFixed(6)));case 40:case"end":return t.stop()}},t)}))()},getPaymentPrice:function(){var e=this,n=new FormData;return n.set("paymentInfo",JSON.stringify(this.paymentInfo)),new Promise(function(t){e.axios.post("/currency-converter",n).then(function(e){e.data.success?t(e.data.data.paymentPrice):b.infoPopup(e.data.message).then(function(){"NOOR"==e.data.errorCode&&(b.disableScreen(),location.reload())})}).catch(function(e){b.infoPopup(e.response.data.message).then(function(){b.disableScreen(),location.reload()})})})},payment:function(){var e=this;void 0==this.paymentInfo.paymentCurrency?b.infoPopup(this.$root.config.lang.notCurrencySelectedPay):b.Swal.fire({title:this.$root.config.lang.confirmPayment,html:this.getConfirmInfo(),icon:"info",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$root.config.lang.confirm,cancelButtonText:this.$root.config.lang.cancel}).then(function(n){n.isConfirmed&&e.Payment.payment()})},getConfirmInfo:function(){var e=this.paymentInfo.paymentPrice+" "+this.paymentInfo.paymentCurrency;if(void 0!==this.$root.config.tokenDiscounts&&this.$root.config.tokenDiscounts[this.paymentInfo.paymentCurrency]){var n=this.$root.config.tokenDiscounts[this.paymentInfo.paymentCurrency],t=this.paymentInfo.realPrice+" "+this.paymentInfo.paymentCurrency;e='<span class="real-price">'.concat(t,"</span> ")+e+"<br><br>"+this.$root.config.lang.discountRate.replace("{discountRate}",n)}return e}}},[["render",function e(n,t,o,c,r,s){return Object(a.i)(),Object(a.e)("div",x,[Object(a.f)("div",P,[Object(a.f)("div",w,[Object(a.f)("div",k,Object(a.n)(n.$root.config.lang.connectedWallet),1),Object(a.f)("div",I,Object(a.n)(n.$root.multiChain.connectedWallet.name),1)]),Object(a.f)("div",D,[Object(a.f)("div",A,Object(a.n)(n.$root.config.lang.connectedAccount),1),Object(a.f)("div",E,Object(a.n)(n.$root.multiChain.connectedAccount),1)]),Object(a.f)("div",T,[Object(a.f)("div",B,Object(a.n)(n.$root.config.lang.activeChain),1),Object(a.f)("div",U,Object(a.n)(n.$root.multiChain.activeChain.name),1)]),Object(a.f)("div",S,[Object(a.f)("div",F,Object(a.n)(n.$root.config.lang.orderPrice),1),Object(a.f)("div",M,Object(a.n)(n.$root.config.order.price)+" "+Object(a.n)(n.$root.config.order.currency),1)]),Object(a.f)("div",O,[Object(a.f)("div",W,Object(a.n)(n.$root.config.lang.paymentCurrency),1),Object(a.f)("div",N,[Object(a.f)("ul",R,[(Object(a.i)(!0),Object(a.e)(a.a,null,Object(a.l)(n.activeChain.currencies,function(e){return Object(a.i)(),Object(a.e)("li",{class:Object(a.h)(n.selectedCurrency&&n.selectedCurrency.address==e.address?"selected":""),key:e.address,onClick:function(n){return s.changeSelectedCurrency(e)}},[Object(a.f)("img",{src:e.image,alt:e.symbol},null,8,L),n.$root.config.viewSymbol?(Object(a.i)(),Object(a.e)("div",j,Object(a.n)(e.symbol),1)):Object(a.d)("",!0)],10,H)}),128))],512)])]),Object(a.f)("div",V,[Object(a.f)("button",{class:"cp-btn",ref:"payment",onClick:t[0]||(t[0]=function(){return s.payment&&s.payment.apply(s,arguments)}),disabled:!n.paymentInfo.paymentCurrency},Object(a.n)(n.paymentButtonText),9,X)]),Object(a.f)("button",{class:"cp-btn disconnect",ref:"disconnect",onClick:t[1]||(t[1]=function(){return s.disconnect&&s.disconnect.apply(s,arguments)})},Object(a.n)(n.$root.config.lang.disconnect),513)])],512)}],["__scopeId","data-v-251e3ebd"]]);t("8a27");let Y=v()({name:"App",data:function(){return{isConnected:!1}},components:{Connector:C,Payment:Q},methods:{connected:function(){this.isConnected=!0},disconnect:function(){this.isConnected=!1}}},[["render",function e(n,t,c,r,s,i){var d=Object(a.m)("Connector"),p=Object(a.m)("Payment");return Object(a.i)(),Object(a.e)(a.a,null,[n.isConnected?Object(a.d)("",!0):(Object(a.i)(),Object(a.c)(d,{key:0,onConnected:i.connected},null,8,["onConnected"])),n.isConnected?(Object(a.i)(),Object(a.e)("div",o,[Object(a.g)(p,{onDisconnect:i.disconnect},null,8,["onDisconnect"])])):Object(a.d)("",!0)],64)}]]);var Z=Y,ee=t("77ac"),en=t("a3e9");window.initCryptoPay=function(e,n){void 0!==n.testnets&&1==n.testnets&&(n.acceptedChains=ee),void 0!==n.mainnets&&1==n.mainnets&&(n.acceptedChains=en),window.ethereum&&window.ethereum.isTrust&&(n.acceptedChains=en);var t={};Object.entries(n.acceptedChains).forEach(function(e){var n={};Object.entries(e[1].currencies).forEach(function(e){MultiChain.utils.isAddress(e[1].address)?(e[1].address=e[1].address.toLowerCase(),n[e[0].toLowerCase()]=e[1]):n[e[0]]=e[1]}),t[e[0]]=Object.assign(e[1],{currencies:n})}),n.acceptedChains=t;var o=new MultiChain({acceptedWallets:n.acceptedWallets,acceptedChains:function e(n){if(void 0!==n){n=JSON.parse(n);var t={};return void 0!==n?Object.entries(n).forEach(function(e){var n=[];Object.entries(e[1].currencies).forEach(function(e){n.push(e[0])}),t[e[0]]=Object.assign(e[1],{currencies:n})}):t=n,t}}(JSON.stringify(n.acceptedChains)),infuraId:n.infuraId});K.a.defaults.baseURL=n.apiUrl.endsWith("/")?n.apiUrl:n.apiUrl+"/",Z.mixins=[{data:function(){return{multiChain:o,config:n,id:"#"+e}}}],Object(a.b)(Z).mount("#"+e)}},7552:function(e,n,t){"use strict";t("7b21")},"77ac":function(e){e.exports=JSON.parse('{"0x4":{"id":4,"hexId":"0x4","name":"Ethereum Rinkeby Testnet","rpcUrl":"https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161","explorerUrl":"https://rinkeby.etherscan.io/","nativeCurrency":{"symbol":"ETH","decimals":18},"currencies":{"ETH":{"symbol":"ETH","address":"ETH","image":"https://cryptopay-woocommerce.beycanpress.com/images/eth.png"},"0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02":{"symbol":"USDT","address":"0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"},"0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b":{"symbol":"USDC","address":"0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdc.png"},"0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa":{"symbol":"DAI","address":"0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa","image":"https://cryptopay-woocommerce.beycanpress.com/images/dai.png"}}},"0x61":{"id":97,"hexId":"0x61","name":"Binance Smart Chain Testnet","rpcUrl":"https://data-seed-prebsc-1-s1.binance.org:8545/","explorerUrl":"https://testnet.bscscan.com/","nativeCurrency":{"symbol":"BNB","decimals":18},"currencies":{"BNB":{"symbol":"BNB","address":"BNB","image":"https://cryptopay-woocommerce.beycanpress.com/images/bnb.png"},"0xba6670261a05b8504e8ab9c45d97a8ed42573822":{"symbol":"USDT","address":"0xba6670261a05b8504e8ab9c45d97a8ed42573822","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"},"0x64544969ed7EBf5f083679233325356EbE738930":{"symbol":"USDC","address":"0x64544969ed7EBf5f083679233325356EbE738930","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdc.png"},"0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee":{"symbol":"BUSD","address":"0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee","image":"https://beycanpress.com/images/busd.png"},"0xd66c6b4f0be8ce5b39d52e0fd1344c389929b378":{"symbol":"ETH","address":"0xd66c6b4f0be8ce5b39d52e0fd1344c389929b378","image":"https://cryptopay-woocommerce.beycanpress.com/images/eth.png"}}},"0xa869":{"id":43113,"hexId":"0xa869","name":"Avalanche FUJI C-Chain Testnet","rpcUrl":"https://api.avax-test.network/ext/bc/C/rpc","explorerUrl":"https://cchain.explorer.avax-test.network","nativeCurrency":{"symbol":"AVAX","decimals":18},"currencies":{"AVAX":{"symbol":"AVAX","address":"AVAX","image":"https://cryptopay-woocommerce.beycanpress.com/images/avax.png"},"0xFe143522938e253e5Feef14DB0732e9d96221D72":{"symbol":"USDT","address":"0xFe143522938e253e5Feef14DB0732e9d96221D72","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"}}},"0x13881":{"id":80001,"hexId":"0x13881","name":"Polygon Mumbai Testnet","rpcUrl":"https://rpc-mumbai.maticvigil.com/","explorerUrl":"https://mumbai.polygonscan.com/","nativeCurrency":{"symbol":"MATIC","decimals":18},"currencies":{"MATIC":{"symbol":"MATIC","address":"MATIC","image":"https://cryptopay-woocommerce.beycanpress.com/images/matic.png"},"0xa02f6adc7926efebbd59fd43a84f4e0c0c91e832":{"symbol":"USDT","address":"0xa02f6adc7926efebbd59fd43a84f4e0c0c91e832","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"}}}}')},"7b21":function(e,n,t){},"8a27":function(e,n,t){"use strict";t("ee88")},a3e9:function(e){e.exports=JSON.parse('{"0x1":{"id":1,"hexId":"0x1","name":"Main Ethereum Network","rpcUrl":"https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161","explorerUrl":"https://etherscan.io/","nativeCurrency":{"symbol":"ETH","decimals":18},"currencies":{"ETH":{"symbol":"ETH","address":"ETH","image":"https://cryptopay-woocommerce.beycanpress.com/images/eth.png"},"0xdac17f958d2ee523a2206206994597c13d831ec7":{"symbol":"USDT","address":"0xdac17f958d2ee523a2206206994597c13d831ec7","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"},"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48":{"symbol":"USDC","address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdc.png"},"0x4Fabb145d64652a948d72533023f6E7A623C7C53":{"symbol":"BUSD","address":"0x4Fabb145d64652a948d72533023f6E7A623C7C53","image":"https://cryptopay-woocommerce.beycanpress.com/images/busd.png"},"0x6b175474e89094c44da98b954eedeac495271d0f":{"symbol":"DAI","address":"0x6b175474e89094c44da98b954eedeac495271d0f","image":"https://cryptopay-woocommerce.beycanpress.com/images/dai.png"}}},"0x38":{"id":56,"hexId":"0x38","name":"Binance Smart Chain","rpcUrl":"https://bsc-dataseed.binance.org/","explorerUrl":"https://bscscan.com/","nativeCurrency":{"symbol":"BNB","decimals":18},"currencies":{"BNB":{"symbol":"BNB","address":"BNB","image":"https://cryptopay-woocommerce.beycanpress.com/images/bnb.png"},"0xe9e7cea3dedca5984780bafc599bd69add087d56":{"symbol":"BUSD","address":"0xe9e7cea3dedca5984780bafc599bd69add087d56","image":"https://cryptopay-woocommerce.beycanpress.com/images/busd.png"},"0x55d398326f99059ff775485246999027b3197955":{"symbol":"USDT","address":"0x55d398326f99059ff775485246999027b3197955","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"},"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d":{"symbol":"USDC","address":"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdc.png"},"0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3":{"symbol":"DAI","address":"0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3","image":"https://cryptopay-woocommerce.beycanpress.com/images/dai.png"}}},"0xa86a":{"id":43114,"hexId":"0xa86a","name":"Avalanche Network","rpcUrl":"https://api.avax.network/ext/bc/C/rpc","explorerUrl":"https://cchain.explorer.avax.network/","nativeCurrency":{"symbol":"AVAX","decimals":18},"currencies":{"AVAX":{"symbol":"AVAX","address":"AVAX","image":"https://cryptopay-woocommerce.beycanpress.com/images/avax.png"},"0xde3a24028580884448a5397872046a019649b084":{"symbol":"USDT","address":"0xde3a24028580884448a5397872046a019649b084","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"},"0xba7deebbfc5fa1100fb055a87773e1e99cd3507a":{"symbol":"DAI","address":"0xba7deebbfc5fa1100fb055a87773e1e99cd3507a","image":"https://cryptopay-woocommerce.beycanpress.com/images/dai.png"},"0xf20d962a6c8f70c731bd838a3a388D7d48fA6e15":{"symbol":"ETH","address":"0xf20d962a6c8f70c731bd838a3a388D7d48fA6e15","image":"https://cryptopay-woocommerce.beycanpress.com/images/eth.png"}}},"0x89":{"id":137,"hexId":"0x89","name":"Polygon Mainnet","rpcUrl":"https://rpc-mainnet.matic.network","explorerUrl":"https://polygonscan.com/","nativeCurrency":{"symbol":"MATIC","decimals":18},"currencies":{"MATIC":{"symbol":"MATIC","address":"MATIC","image":"https://cryptopay-woocommerce.beycanpress.com/images/matic.png"},"0xc2132d05d31c914a87c6611c10748aeb04b58e8f":{"symbol":"USDT","address":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdt.png"},"0x2791bca1f2de4661ed88a30c99a7a9449aa84174":{"symbol":"USDC","address":"0x2791bca1f2de4661ed88a30c99a7a9449aa84174","image":"https://cryptopay-woocommerce.beycanpress.com/images/usdc.png"},"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063":{"symbol":"DAI","address":"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063","image":"https://cryptopay-woocommerce.beycanpress.com/images/dai.png"}}}}')},ee88:function(e,n,t){},f5f0:function(e,n,t){}});

 

Link to comment
Share on other sites

  • 9
  • 22
  • 1
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...