Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/RapidHtmlResources.php |
— | — | @@ -131,7 +131,22 @@ |
132 | 132 | 'localBasePath' => dirname( __FILE__ ).'/../../globalcollect_gateway/forms', |
133 | 133 | 'remoteExtPath' => $wgGlobalCollectRapidHtmlRemoteExtPath, |
134 | 134 | ); |
| 135 | +$wgResourceModules[ 'gc.form.rapidhtml.cc' ] = array( |
| 136 | + 'styles' => 'css/gc.cc.css', |
| 137 | + 'scripts' => array( |
| 138 | + 'js/gc.cc.js', |
| 139 | + 'js/gc.js' |
| 140 | + ), |
| 141 | + 'dependencies' => array( 'di.form.core.validate' ), |
| 142 | + 'localBasePath' => dirname( __FILE__ ).'/../../globalcollect_gateway/forms', |
| 143 | + 'remoteExtPath' => $wgGlobalCollectRapidHtmlRemoteExtPath, |
| 144 | +); |
135 | 145 | |
| 146 | + |
| 147 | +/************************************************************* |
| 148 | + ************************************************************* |
| 149 | + *************************************************************/ |
| 150 | + |
136 | 151 | // PayflowPro |
137 | 152 | $wgResourceModules[ 'pfp.form.rapidhtml.webitects' ] = array( |
138 | 153 | 'styles' => '', |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/cc/cc-US.html |
— | — | @@ -0,0 +1,137 @@ |
| 2 | +<script type="text/javascript"> |
| 3 | + mw.loader.load('gc.form.rapidhtml.cc'); |
| 4 | + // these must go through RapidHTML and thus are inline |
| 5 | + var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape']; |
| 6 | + var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape']; |
| 7 | + var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape']; |
| 8 | + var actionURL = "@action"; |
| 9 | + var scriptPath = "@script_path"; |
| 10 | +</script> |
| 11 | + |
| 12 | +<table width="100%" cellspacing="0" cellpadding="0" border="0"> |
| 13 | + <tbody> |
| 14 | + <tr> |
| 15 | + <td id="appeal" valign="top"> |
| 16 | + {{LanguageSwitch|2011FR/@appeal/text|@language}} |
| 17 | + </td> |
| 18 | + <td id="donate" valign="top"> |
| 19 | + <div id="greenBackground" class=""> |
| 20 | + <noscript> |
| 21 | + <div id="noscript"> |
| 22 | + <p id="noscript-msg">It appears that you do not have JavaScript enabled, or your browser does not support it. In order to provide a safe, secure and pleasant experience, our donation form requires JavaScript.</p><p id="noscript-redirect-msg">If you cannot or do not wish to enable JavaScript, you may still contribute by visiting:</p><p id="noscript-redirect-link"><a href="http://wikimediafoundation.org/wiki/DonateNonJS/en">http://wikimediafoundation.org/wiki/DonateNonJS/en</a></p> |
| 23 | + </div> |
| 24 | + </noscript> |
| 25 | + <p id="topError" class="creditcard-error-msg"></p> |
| 26 | + |
| 27 | + <form name="payment" method="post" action="@action"> |
| 28 | + <div id="payflowpro_gateway-personal-info"> |
| 29 | + <table id="payflow-table-donor"> |
| 30 | + <tbody> |
| 31 | + <tr> |
| 32 | + <td colspan="2"> |
| 33 | + <div id="step1header"> |
| 34 | + <h3 class="amount_header">Donation amount: <span id="selected-amount">$@amount</span></h3> |
| 35 | + </div> |
| 36 | + </td> |
| 37 | + </tr> |
| 38 | + <tr> |
| 39 | + <td colspan="2"><h3 class="cc_header">Billing information<img src="@script_path/extensions/DonationInterface/gateway_forms/includes/padlock.gif" style="vertical-align:baseline;margin-left:8px;"></h3></td> |
| 40 | + </tr> |
| 41 | + <tr> |
| 42 | + <td colspan="2"><input name="fname" value="@fname" type="text" placeholder="First name" id="fname"><input name="lname" value="@lname" type="text" placeholder="Last name" id="lname"></td> |
| 43 | + </tr> |
| 44 | + <tr> |
| 45 | + <td colspan="2"><span class="creditcard-error-msg"></span></td> |
| 46 | + </tr> |
| 47 | + <tr> |
| 48 | + <td colspan="2"><input name="street" value="@street" type="text" placeholder="Street" id="street"></td> |
| 49 | + </tr> |
| 50 | + <tr> |
| 51 | + <td colspan="2"><span class="creditcard-error-msg"></span></td> |
| 52 | + </tr> |
| 53 | + <tr> |
| 54 | + <td colspan="2"><input name="city" value="@city" type="text" placeholder="City" id="city"> |
| 55 | + <select id="state" name="state" value="@state" > |
| 56 | + <option value=""></option> |
| 57 | + <option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="PR">PR</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option><option value="AA">AA</option><option value="AE">AE</option><option value="AP">AP</option> |
| 58 | + </select> |
| 59 | + <input name="zip" value="@zip" type="text" placeholder="Zip code" id="zip"> |
| 60 | + </td> |
| 61 | + </tr> |
| 62 | + <tr> |
| 63 | + <td colspan="2"><input name="emailAdd" value="@emailAdd" type="text" placeholder="Email address" id="emailAdd"></td> |
| 64 | + </tr> |
| 65 | + <tr> |
| 66 | + <td> |
| 67 | + <dl class=""> |
| 68 | + <dd class="field" style="margin-bottom: 0; margin-left: 10px;"> |
| 69 | + <ul class="options-h" id="cards" style="margin: 0;"> |
| 70 | + <li><input id="cc-visa" name="cardtype" type="radio" value="visa" class="cardradio" /> <label for="cc-visa"><img alt="Visa" src="@script_path/extensions/DonationInterface/gateway_forms/includes/card-visa.png" /></label></li> |
| 71 | + <li><input id="cc-mastercard" name="cardtype" type="radio" value="mastercard" class="cardradio" /> <label for="cc-mastercard"><img alt="MasterCard" src="@script_path/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" /></label></li> |
| 72 | + <li><input id="cc-amex" name="cardtype" type="radio" value="american" class="cardradio" /> <label for="cc-amex"><img alt="American Express" src="@script_path/extensions/DonationInterface/gateway_forms/includes/card-amex.png" /></label></li> |
| 73 | + <li><input id="cc-discover" name="cardtype" type="radio" value="discover" class="cardradio" /> <label for="cc-discover"><img alt="Discover" src="@script_path/extensions/DonationInterface/gateway_forms/includes/card-discover.png" /></label></li> |
| 74 | + </ul> |
| 75 | + <div id="paymentContinue" style="margin-top: 10px; display: none;"> <input class="btn" id="paymentContinueBtn" type="button" value="%donate_interface-continue%" /></div> |
| 76 | + </dd> |
| 77 | + </dl> |
| 78 | + </td> |
| 79 | + </tr> |
| 80 | + <tr> |
| 81 | + <td> |
| 82 | + <div id="payment" class="gainlayout" style="height:0px;text-align:center;"></div> |
| 83 | + </td> |
| 84 | + </tr> |
| 85 | + <tr> |
| 86 | + <td> |
| 87 | + <div class="mw-donate-submessage" id="payflowpro_gateway-donate-submessage"> |
| 88 | + <img src="@script_path/extensions/DonationInterface/gateway_forms/includes/padlock.gif" style="vertical-align:baseline;margin-right:4px;">Your credit / debit card will be securely processed. |
| 89 | + </div> |
| 90 | + </td> |
| 91 | + </tr> |
| 92 | + </tbody> |
| 93 | + </table> |
| 94 | + </div> |
| 95 | + <input type="hidden" name="gateway" value="payflowpro" id="gateway" /> |
| 96 | + <input type="hidden" name="returnto" value="Thank_You/en" /> |
| 97 | + <input type="hidden" value="0" name="PaypalRedirect" id="PaypalRedirect"> |
| 98 | + <input type="hidden" value="@amount" name="amount"> |
| 99 | + <input type="hidden" value="US" name="country" id="country" /> |
| 100 | + <input type="hidden" value="@expiration" name="expiration" id="expiration"/> |
| 101 | + <input type="hidden" value="USD" name="currency_code" /> |
| 102 | + <input type="hidden" value="@utm_source" name="utm_source"/> |
| 103 | + <input type="hidden" value="@utm_medium" name="utm_medium"/> |
| 104 | + <input type="hidden" value="@utm_campaign" name="utm_campaign"/> |
| 105 | + <input type="hidden" value="@language" name="language"/> |
| 106 | + <input type="hidden" value="@referrer" name="referrer"/> |
| 107 | + <input type="hidden" value="@comment" name="comment"/> |
| 108 | + <input type="hidden" value="@comment-option" name="comment-option"/> |
| 109 | + <input type="hidden" value="1" name="email-opt"/> |
| 110 | + <input type="hidden" value="@token" name="token"/> |
| 111 | + <input type="hidden" value="@order_id" name="order_id"/> |
| 112 | + <input type="hidden" value="@numAttempt" name="numAttempt"/> |
| 113 | + <input type="hidden" value="@contribution_tracking_id" name="contribution_tracking_id"/> |
| 114 | + <input type="hidden" value="@data_hash" name="data_hash"/> |
| 115 | + <input type="hidden" value="@owa_session" name="owa_session"/> |
| 116 | + <input type="hidden" value="@owa_ref" name="owa_ref"/> |
| 117 | + <input type="hidden" value="@gateway" name="gateway"/> |
| 118 | + <input type="hidden" value="cc" name="payment_method"/> |
| 119 | + </form> |
| 120 | + </div> |
| 121 | + <p id="informationsharing">%donate_interface-informationsharing|url%</p> |
| 122 | + <table> |
| 123 | + <tr> |
| 124 | + <td> |
| 125 | + <ul id="moreinfolinks"> |
| 126 | + <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Monthly_donations&language=@language&uselang=@language&country=@country">%donate_interface-monthly-donation%</a></li> |
| 127 | + <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&language=@language&uselang=@language&country=@country">%donate_interface-otherways-short%</a></li> |
| 128 | + <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&language=@language&uselang=@language&country=@country">%donate_interface-faqs%</a></li> |
| 129 | + <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Tax_Deductibility&language=@language&uselang=@language&country=@country">%donate_interface-tax-info%</a></li> |
| 130 | + </ul> |
| 131 | + </td> |
| 132 | + <td>@verisign_logo</td> |
| 133 | + </tr> |
| 134 | + </table> |
| 135 | + </td> |
| 136 | + </tr> |
| 137 | + </tbody> |
| 138 | +</table> |
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/cc/cc-US.html |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 139 | + native |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/css/gc.cc.css |
— | — | @@ -0,0 +1,197 @@ |
| 2 | +table#donation_amount { |
| 3 | + background-color:transparent; |
| 4 | + border:1px solid #AAAAAA; |
| 5 | + border-collapse:collapse; |
| 6 | + width: 394px; |
| 7 | +} |
| 8 | +table#donation_amount td { |
| 9 | + border:1px solid #AAAAAA; |
| 10 | +} |
| 11 | +table#donation_amount td.amount_header { |
| 12 | + background-color:#eef2f7; |
| 13 | + font-size:90%; |
| 14 | +} |
| 15 | +table#donation_amount td.amount_data { |
| 16 | + background-color:#daf2db; |
| 17 | +} |
| 18 | +h3.cc_header { |
| 19 | + padding-bottom: 0; |
| 20 | + margin-bottom: 0; |
| 21 | + font-weight: normal; |
| 22 | +} |
| 23 | +div#payflowpro_gateway-donate-addl-info-text { |
| 24 | + font-size: 90%; |
| 25 | + line-height: 120%; |
| 26 | + padding-top: 12px; |
| 27 | +} |
| 28 | +div#payflowpro_gateway-donate-submessage { |
| 29 | + font-size: 90%; |
| 30 | + line-height: 120%; |
| 31 | +} |
| 32 | +#payflow-table-donor td.label, #payflow-table-comment td.label, #payflow-table-cc td.label { |
| 33 | + white-space: nowrap; |
| 34 | + display: block; |
| 35 | + padding-right: 1em; |
| 36 | + text-align: right; |
| 37 | + width: 94px; |
| 38 | +} |
| 39 | + |
| 40 | + |
| 41 | +.payflow-cc-form-section { |
| 42 | + float: none; |
| 43 | + margin-right: 0em; |
| 44 | + margin-bottom: 1em; |
| 45 | +} |
| 46 | + |
| 47 | +#payflowpro_gateway-cc_form_container { |
| 48 | + width: 100%; |
| 49 | +} |
| 50 | + |
| 51 | +#payflowpro_gateway-cc_form_form { |
| 52 | + width: 475px; |
| 53 | + float: right; |
| 54 | + margin-left: 2em; |
| 55 | + padding-left: 2em; |
| 56 | + border-left: 1px solid #BBBBBB; |
| 57 | +} |
| 58 | + |
| 59 | +#payflowpro_gateway-cc_form_letter { |
| 60 | + height: 100%; |
| 61 | +} |
| 62 | + |
| 63 | +#payflowpro_gateway-cc_form_letter p { |
| 64 | + font-size: 1.125em; |
| 65 | + margin-bottom: 1.2em; |
| 66 | +} |
| 67 | + |
| 68 | +#payflowpro_gateway-personal-info { |
| 69 | + margin-right:0 !important; |
| 70 | +} |
| 71 | + |
| 72 | +#payflowpro_gateway-donate-addl-info-secure-logos { |
| 73 | + float: left; |
| 74 | + margin-right: 2em; |
| 75 | +} |
| 76 | + |
| 77 | +#payflowpro_gateway-cc_form_letter_inside { |
| 78 | + padding-top: .5em; |
| 79 | +} |
| 80 | + |
| 81 | +#payflowpro_gateway-cc_otherways { |
| 82 | + padding-top: .5em; |
| 83 | + display: block; |
| 84 | +} |
| 85 | +#payflowpro_gateway-donate-addl-info { |
| 86 | + margin-top:2em !important; |
| 87 | + margin-bottom:1em !important; |
| 88 | +} |
| 89 | + |
| 90 | +#appeal { |
| 91 | + background-color:transparent; |
| 92 | + border-color:transparent; |
| 93 | + border-style:solid; |
| 94 | + border-width:1px 0 1px 1px; |
| 95 | + padding:16px 24px 24px; |
| 96 | +} |
| 97 | +#appeal-head { |
| 98 | + font-size:1.5em; |
| 99 | + line-height:1.125em; |
| 100 | + padding-bottom:0.5em; |
| 101 | + padding-top:0.125em; |
| 102 | +} |
| 103 | +#appeal-body { |
| 104 | + font-size:1.125em; |
| 105 | + margin-bottom:1em; |
| 106 | + padding:0.2em 0; |
| 107 | +} |
| 108 | +#donate { |
| 109 | +} |
| 110 | +#donate-head { |
| 111 | + border:none; |
| 112 | + font-size:1.5em; |
| 113 | + line-height:1.125em; |
| 114 | + padding-bottom:0em; |
| 115 | + padding-top:0.125em; |
| 116 | +} |
| 117 | +#donate-body { |
| 118 | + font-size:1.125em; |
| 119 | + margin-bottom:1em; |
| 120 | +} |
| 121 | + |
| 122 | +/* Move the form up */ |
| 123 | +#mw-head-base { |
| 124 | + height: 1em !important; |
| 125 | +} |
| 126 | + |
| 127 | +/* Hiding content border */ |
| 128 | +table { |
| 129 | + background-color: transparent; |
| 130 | +} |
| 131 | +div#content { |
| 132 | + background-color: transparent !important; |
| 133 | + background-image: none !important; |
| 134 | +} |
| 135 | +div#mw-head-base { |
| 136 | + background-image: none !important; |
| 137 | +} |
| 138 | +#footer { |
| 139 | + background-image: none !important; |
| 140 | +} |
| 141 | + |
| 142 | +/* Hiding stuff we don't need */ |
| 143 | +h1#firstHeading, div#contentSub { |
| 144 | + display: none; |
| 145 | +} |
| 146 | + |
| 147 | +/* NEW STUFF */ |
| 148 | +#greenBackground{ |
| 149 | + padding:16px 24px; |
| 150 | + width:300px; |
| 151 | + background-color:#CCE7CD; |
| 152 | + border:1px solid #5EAC58; |
| 153 | +} |
| 154 | +p#informationsharing { |
| 155 | + width: 318px; |
| 156 | + padding: 0 15px; |
| 157 | + line-height: 14px; |
| 158 | + font-size: 11px; |
| 159 | +} |
| 160 | +ul#moreinfolinks li{ |
| 161 | + list-style: none !important; |
| 162 | + list-style-image: none !important; |
| 163 | +} |
| 164 | +h3.amount_header { |
| 165 | + padding: 0 0 0.4em 0; |
| 166 | + margin-bottom: 0; |
| 167 | + font-weight: normal; |
| 168 | +} |
| 169 | + |
| 170 | +table#payflow-table-donor{ |
| 171 | + /*margin-left: 10px;*/ |
| 172 | +} |
| 173 | + |
| 174 | +/* Form inputs */ |
| 175 | +input#fname, input#lname { |
| 176 | + width: 130px; |
| 177 | +} |
| 178 | +input#street, input#card_num, input#emailAdd { |
| 179 | + width: 271px; |
| 180 | +} |
| 181 | +input#city { |
| 182 | + width: 135px; |
| 183 | +} |
| 184 | +input#zip { |
| 185 | + width: 65px; |
| 186 | +} |
| 187 | + |
| 188 | +/* From Webitects */ |
| 189 | +/* Options */ |
| 190 | +.form .options-h, .form .options-v { margin: 0; } |
| 191 | +.options-h, .options-v { list-style: none; margin: 0 0 1em 0; } |
| 192 | +.options-h img, .options-v img { vertical-align: middle; } |
| 193 | +.options-h li, .options-v li { background: none; margin-bottom: 0.3em; padding: 0; } |
| 194 | +.options-h li { display: inline; line-height: 2.5; margin-right: 0.3em; white-space: nowrap; } |
| 195 | +.options-h li select { vertical-align: middle; } |
| 196 | +.options-h li:last-child { margin: 0; } |
| 197 | +.form .options-v { margin-top: 5px; } |
| 198 | +.options-v li { padding-left: 25px; text-indent: -25px; } |
\ No newline at end of file |
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/css/gc.cc.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 199 | + native |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js |
— | — | @@ -0,0 +1,92 @@ |
| 2 | +window.displayCreditCardForm = function() { |
| 3 | + $( '#payment' ).empty(); |
| 4 | + // Load wait spinner |
| 5 | + $( '#payment' ).append( '<br/><br/><br/><img alt="loading" src="'+mw.config.get( 'wgScriptPath' )+'/extensions/DonationInterface/gateway_forms/includes/loading-white.gif" />' ); |
| 6 | + var language = 'en'; // default value is English |
| 7 | + var matches = document.location.href.match(/uselang=(\w+)/i); // fine the real language |
| 8 | + if ( matches && matches[1] ) { |
| 9 | + language = matches[1]; |
| 10 | + } |
| 11 | + |
| 12 | + var currencyField = document.getElementById( 'input_currency_code' ); |
| 13 | + var currency_code = ''; |
| 14 | + if ( currencyField && currencyField.type == 'select-one' ) { // currency is a dropdown select |
| 15 | + currency_code = $( 'select#input_currency_code option:selected' ).val(); |
| 16 | + } else { |
| 17 | + currency_code = $( "input[name='currency_code']" ).val(); |
| 18 | + } |
| 19 | + |
| 20 | + var stateField = document.getElementById( 'state' ); |
| 21 | + var state = ''; |
| 22 | + if ( stateField && stateField.type == 'select-one' ) { // state is a dropdown select |
| 23 | + state = $( 'select#state option:selected' ).val(); |
| 24 | + } else { |
| 25 | + state = $( "input[name='state']" ).val(); |
| 26 | + } |
| 27 | + |
| 28 | + var countryField = document.getElementById( 'country' ); |
| 29 | + var country = ''; |
| 30 | + if ( countryField && countryField.type == 'select-one' ) { // country is a dropdown select |
| 31 | + country = $( 'select#country option:selected' ).val(); |
| 32 | + } else { |
| 33 | + country = $( "input[name='country']" ).val(); |
| 34 | + } |
| 35 | + |
| 36 | + var sendData = { |
| 37 | + 'action': 'donate', |
| 38 | + 'gateway': 'globalcollect', |
| 39 | + 'currency_code': currency_code, |
| 40 | + 'amount': $( "input[name='amount']" ).val(), |
| 41 | + 'fname': $( "input[name='fname']" ).val(), |
| 42 | + 'lname': $( "input[name='lname']" ).val(), |
| 43 | + 'street': $( "input[name='street']" ).val(), |
| 44 | + 'city': $( "input[name='city']" ).val(), |
| 45 | + 'state': state, |
| 46 | + 'zip': $( "input[name='zip']" ).val(), |
| 47 | + 'emailAdd': $( "input[name='emailAdd']" ).val(), |
| 48 | + 'country': country, |
| 49 | + 'payment_method': 'cc', |
| 50 | + 'language': language, |
| 51 | + 'card_type': $( "input[name='cardtype']:checked" ).val().toLowerCase(), |
| 52 | + 'contribution_tracking_id': $( "input[name='contribution_tracking_id']" ).val(), |
| 53 | + 'numAttempt': $( "input[name='numAttempt']" ).val(), |
| 54 | + 'utm_source': $( "input[name='utm_source']" ).val(), |
| 55 | + 'utm_campaign': $( "input[name='utm_campaign']" ).val(), |
| 56 | + 'utm_medium': $( "input[name='utm_medium']" ).val(), |
| 57 | + 'format': 'json' |
| 58 | + }; |
| 59 | + $.ajax( { |
| 60 | + 'url': mw.util.wikiScript( 'api' ), |
| 61 | + 'data': sendData, |
| 62 | + 'dataType': 'json', |
| 63 | + 'type': 'GET', |
| 64 | + 'success': function( data ) { |
| 65 | + if ( typeof data.error !== 'undefined' ) { |
| 66 | + alert( mw.msg( 'donate_interface-error-msg-general' ) ); |
| 67 | + $( "#paymentContinue" ).show(); // Show continue button in 2nd section |
| 68 | + showStep2(); |
| 69 | + } else if ( typeof data.result !== 'undefined' ) { |
| 70 | + if ( data.result.errors ) { |
| 71 | + var errors = new Array(); |
| 72 | + $.each( data.result.errors, function( index, value ) { |
| 73 | + alert( value ); // Show them the error |
| 74 | + $( "#paymentContinue" ).show(); // Show continue button in 2nd section |
| 75 | + showStep2(); // Switch back to 2nd section of form |
| 76 | + } ); |
| 77 | + } else { |
| 78 | + if ( data.result.formaction ) { |
| 79 | + $( '#payment' ).empty(); |
| 80 | + // Insert the iframe into the form |
| 81 | + $( '#payment' ).append( |
| 82 | + '<iframe src="'+data.result.formaction+'" width="318" height="314" frameborder="0"></iframe>' |
| 83 | + ); |
| 84 | + |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + }, |
| 89 | + 'error': function( xhr ) { |
| 90 | + alert( mw.msg( 'donate_interface-error-msg-general' ) ); |
| 91 | + } |
| 92 | + } ); |
| 93 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 94 | + native |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.cc.js |
— | — | @@ -0,0 +1,60 @@ |
| 2 | +/* |
| 3 | + * The following variable are declared inline in webitects_2_3step.html: |
| 4 | + * amountErrors, billingErrors, paymentErrors, scriptPath, actionURL |
| 5 | + */ |
| 6 | +$( document ).ready( function () { |
| 7 | + |
| 8 | + // check for RapidHtml errors and display, if any |
| 9 | + var amountErrorString = ""; |
| 10 | + var billingErrorString = ""; |
| 11 | + var paymentErrorString = ""; |
| 12 | + |
| 13 | + // generate formatted errors to display |
| 14 | + var temp = []; |
| 15 | + for ( var e in amountErrors ) |
| 16 | + if ( amountErrors[e] != "" ) |
| 17 | + temp[temp.length] = amountErrors[e]; |
| 18 | + amountErrorString = temp.join( "<br />" ); |
| 19 | + |
| 20 | + temp = []; |
| 21 | + for ( var f in billingErrors ) |
| 22 | + if ( billingErrors[f] != "" ) |
| 23 | + temp[temp.length] = billingErrors[f]; |
| 24 | + billingErrorString = temp.join( "<br />" ); |
| 25 | + |
| 26 | + temp = []; |
| 27 | + for ( var g in paymentErrors ) |
| 28 | + if ( paymentErrors[g] != "" ) |
| 29 | + temp[temp.length] = paymentErrors[g]; |
| 30 | + paymentErrorString = temp.join( "<br />" ); |
| 31 | + |
| 32 | + // show the errors |
| 33 | + if ( amountErrorString != "" ) { |
| 34 | + $( "#topError" ).html( amountErrorString ); |
| 35 | + } else if ( billingErrorString != "" ) { |
| 36 | + $( "#topError" ).html( billingErrorString ); |
| 37 | + } else if ( paymentErrorString != "" ) { |
| 38 | + $( "#topError" ).html( paymentErrorString ); |
| 39 | + } |
| 40 | + |
| 41 | + $( "#paymentContinueBtn" ).live( "click", function() { |
| 42 | + if ( validate_personal( document.paypalcontribution ) && validateAmount() ) { |
| 43 | + displayCreditCardForm() |
| 44 | + } |
| 45 | + } ); |
| 46 | + |
| 47 | + // Set the cards to progress to step 3 |
| 48 | + $( ".cardradio" ).live( "click", function() { |
| 49 | + if ( validate_personal( document.payment ) && validateAmount() ) { |
| 50 | + $( "#payment" ).animate( { height:'314px' }, 1000 ); |
| 51 | + displayCreditCardForm(); |
| 52 | + // hide the continue button so that people don't get confused with two of them |
| 53 | + $( "#paymentContinue" ).hide(); |
| 54 | + } |
| 55 | + else { |
| 56 | + // show the continue button to indicate how to get to step 3 since they |
| 57 | + // have already clicked on a card image |
| 58 | + $( "#paymentContinue" ).show(); |
| 59 | + } |
| 60 | + } ); |
| 61 | +} ); |
\ No newline at end of file |
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.cc.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 62 | + native |