@@ -70,6 +70,7 @@ module.exports = baseModal.extend({
7070 this . model . set ( 'selectedModerator' , "" ) ;
7171 this . model . updateAttributes ( ) ;
7272 this . cachePayData = "" ;
73+ this . totalBTCPrice = 0 ;
7374 this . partialPaymentAmount = 0 ;
7475
7576 //create the country select list
@@ -578,18 +579,17 @@ module.exports = baseModal.extend({
578579 throw new Error ( 'Data must be provided to the showPayAddress function' ) ;
579580 }
580581
581- var totalBTCPrice = 0 ,
582- storeName = encodeURI ( this . model . get ( 'page' ) . profile . name ) ,
582+ var storeName = encodeURI ( this . model . get ( 'page' ) . profile . name ) ,
583583 message = encodeURI ( this . model . get ( 'vendor_offer' ) . listing . item . title . substring ( 0 , 20 ) + " " + data . order_id ) ,
584584 payHREF = "" ,
585585 dataURI ;
586586 this . $el . find ( '.js-buyWizardSpinner' ) . addClass ( 'hide' ) ;
587587 this . orderID = data . order_id ;
588- totalBTCPrice = data . amount - this . partialPaymentAmount ;
589- this . $el . find ( '.js-buyWizardDetailsTotalBTC' ) . text ( templateHelpers . intlNumFormat ( totalBTCPrice , 8 ) ) ;
588+ this . totalBTCPrice = data . amount - this . partialPaymentAmount ;
589+ this . $el . find ( '.js-buyWizardDetailsTotalBTC' ) . text ( templateHelpers . intlNumFormat ( this . totalBTCPrice , 8 ) ) ;
590590 this . payURL = data . payment_address ;
591591
592- payHREF = "bitcoin:" + data . payment_address + "?amount=" + totalBTCPrice ;
592+ payHREF = "bitcoin:" + data . payment_address + "?amount=" + this . totalBTCPrice ;
593593 if ( localStorage . getItem ( 'AdditionalPaymentData' ) != "false" ) {
594594 payHREF += "&label=" + storeName + "&message=" + message ;
595595 }
@@ -599,15 +599,12 @@ module.exports = baseModal.extend({
599599 dataURI = qr ( payHREF , { type : 10 , size : 10 , level : 'M' } ) ;
600600 this . $el . find ( '.js-buyWizardPayQRCode' ) . attr ( 'src' , dataURI ) ;
601601 this . $el . find ( '.js-buyWizardPayPrice' ) . text ( ) ;
602- this . $el . find ( '.js-buyWizardPayURL' ) . text ( data . payment_address ) ;
602+ this . $el . find ( '.js-buyWizardPayURL' ) . text ( this . payURL ) ;
603603 this . $el . find ( '.js-buyWizardPayLink' ) . attr ( 'href' , payHREF ) ;
604- console . log ( electron ) ;
605604 } ,
606605
607606 openShapeshiftURL : function ( ) {
608- var totalBTCPrice = this . buyDetailsView . model . attributes . totalBTCDisplayPrice ;
609- var paymentAddress = this . buyRequest . responseJSON . payment_address ;
610- var shapeshiftURL = 'https://shapeshift.io/shifty.html?destination=' + paymentAddress + '&output=BTC&apiKey=24ad734e196c948de4608e00472ab8a4b956a298c52abc20fda74114d6cebcb632714a9c5a0f38f46cef0bc974dfd41c34488432128d65acc099b3892f92d602&amount=' + totalBTCPrice ;
607+ var shapeshiftURL = 'https://shapeshift.io/shifty.html?destination=' + this . payURL + '&output=BTC&apiKey=24ad734e196c948de4608e00472ab8a4b956a298c52abc20fda74114d6cebcb632714a9c5a0f38f46cef0bc974dfd41c34488432128d65acc099b3892f92d602&amount=' + this . totalBTCPrice ;
611608 var shapeshiftWin = new BrowserWindow ( { width : 700 , height : 500 , frame : true } ) ;
612609 shapeshiftWin . loadURL ( shapeshiftURL ) ;
613610 } ,
0 commit comments