File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -389,30 +389,32 @@ <h3>Find out more</h3>
389389 input = $ ( inputs [ i ] ) ;
390390
391391 if ( input . val ( ) ) {
392- data [ input . attr ( 'name' ) ] = input . val ( ) ;
392+ data [ input . attr ( 'name' ) ] = {
393+ value : input . val ( )
394+ } ;
393395 }
394396 }
395397
396398 // Create a script tag to use as the HTML
397399 el = document . createElement ( 'script' ) ;
398400
399- if ( data . button === 'cart' ) {
400- el . src = 'paypal-button-minicart.js?merchant=' + data . business ;
401+ if ( data . button . value === 'cart' ) {
402+ el . src = 'paypal-button-minicart.js?merchant=' + data . business . value ;
401403 } else {
402- el . src = 'paypal-button.js?merchant=' + data . business ;
404+ el . src = 'paypal-button.js?merchant=' + data . business . value ;
403405 }
404406
405407 for ( key in data ) {
406408 if ( key !== 'business' ) {
407- el . setAttribute ( 'data-' + key , data [ key ] ) ;
409+ el . setAttribute ( 'data-' + key , data [ key ] . value ) ;
408410 }
409411 }
410412
411413 code . text ( el . outerHTML . replace ( / d a t a - / g, "\n data-" ) . replace ( "></" + "script>" , "\n></" + "script>" ) ) ;
412414
413415 // Update the button
414416 tryit . empty ( ) ;
415- PAYPAL . apps . ButtonFactory . create ( data , data . button , tryit [ 0 ] ) ;
417+ PAYPAL . apps . ButtonFactory . create ( data . business . value , data , data . button , tryit [ 0 ] ) ;
416418 } ) ;
417419
418420 </ script >
You can’t perform that action at this time.
0 commit comments