@@ -58,6 +58,7 @@ module.exports = baseVw.extend({
5858 'blur .js-transactionDiscussionSendText' : 'blurInput' ,
5959 'blur input' : 'validateInput' ,
6060 'blur textarea' : 'validateInput' ,
61+ 'click #BuyWizardQRDetailsInput' : 'toggleQRDetails' ,
6162 'keydown #transactionDiscussionSendText' : 'onKeydownDiscussion' ,
6263 'keyup #transactionDiscussionSendText' : 'onKeyupDiscussion'
6364 } ,
@@ -166,6 +167,9 @@ module.exports = baseVw.extend({
166167 self . getDiscussion ( ) ;
167168 self . discussionScroller = self . $ ( '.js-discussionScroller' ) ;
168169 self . moderatorPercentage = self . model . get ( 'displayModerator' ) . feeDecimal ;
170+ //set the QR details checkbox
171+ var QRtoggleVal = localStorage . getItem ( 'AdditionalPaymentData' ) != "false" ? true : false ;
172+ self . $ ( '#BuyWizardQRDetailsInput' ) . prop ( 'checked' , QRtoggleVal ) ;
169173 } ) ;
170174 } ,
171175
@@ -205,12 +209,24 @@ module.exports = baseVw.extend({
205209 }
206210 } ,
207211
212+ toggleQRDetails : function ( ) {
213+ var toggleInput = this . $ ( '#BuyWizardQRDetailsInput' ) ,
214+ toggleVal = toggleInput . prop ( 'checked' ) ;
215+ localStorage . setItem ( 'AdditionalPaymentData' , toggleVal ) ;
216+ this . showPayment ( ) ;
217+ } ,
218+
208219 showPayment : function ( ) {
209220 var totalBTCPrice = 0 ,
210221 payHREF ,
211222 dataURI ;
212223 if ( this . model . get ( 'buyer_order' ) ) {
213- payHREF = "bitcoin:" + this . model . get ( 'buyer_order' ) . order . payment . address + "?amount=" + this . model . get ( 'buyer_order' ) . order . payment . amount + "&message=" + this . model . get ( 'vendor_offer' ) . listing . item . title . substring ( 0 , 20 ) ;
224+ payHREF = "bitcoin:" + this . model . get ( 'buyer_order' ) . order . payment . address + "?amount=" + this . model . get ( 'buyer_order' ) . order . payment . amount ;
225+
226+ if ( localStorage . getItem ( 'AdditionalPaymentData' ) != "false" ) {
227+ payHREF += "&message=" + this . model . get ( 'vendor_offer' ) . listing . item . title . substring ( 0 , 20 ) + " " + this . orderID ;
228+ }
229+
214230 dataURI = qr ( payHREF , { type : 10 , size : 10 , level : 'M' } ) ;
215231 this . $el . find ( '.js-transactionPayQRCode' ) . attr ( 'src' , dataURI ) ;
216232 } else {
0 commit comments