Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/RapidHtmlResources.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | * This file is included in DonationInterfa/payflowpro_gateway.php |
7 | 7 | */ |
8 | 8 | |
9 | | -$wgPayflowRapidHtmlRemoteExtPath = 'DonationInterface/payflowpro_gateway/forms/rapidhtml'; |
| 9 | +$wgPayflowRapidHtmlRemoteExtPath = 'DonationInterface/gateway_forms/rapidhtml'; |
10 | 10 | |
11 | 11 | /** |
12 | 12 | * LIGHTBOX |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js |
— | — | @@ -84,7 +84,50 @@ |
85 | 85 | // Set the cards to progress to step 3 |
86 | 86 | $( ".cardradio" ).live( "click", function() { |
87 | 87 | if ( validate_personal( document.paypalcontribution ) ) { |
88 | | - showStep3(); |
| 88 | + var language = 'en'; // default value |
| 89 | + var matches = document.location.href.match(/uselang=(\w+)/i); |
| 90 | + if ( matches[1] ) { |
| 91 | + language = matches[1]; |
| 92 | + } |
| 93 | + var sendData = { |
| 94 | + 'action': 'donate', |
| 95 | + 'gateway': 'globalcollect', |
| 96 | + 'currency': 'USD', |
| 97 | + 'amount': $( "input[name='amount']" ).val(), |
| 98 | + 'fname': $( "input[name='fname']" ).val(), |
| 99 | + 'lname': $( "input[name='lname']" ).val(), |
| 100 | + 'street': $( "input[name='street']" ).val(), |
| 101 | + 'city': $( "input[name='city']" ).val(), |
| 102 | + 'state': $( "input[name='state']" ).val(), |
| 103 | + 'zip': $( "input[name='zip']" ).val(), |
| 104 | + 'emailAdd': $( "input[name='emailAdd']" ).val(), |
| 105 | + 'country': $( "input[name='country']" ).val(), |
| 106 | + 'payment_method': 'card', |
| 107 | + 'language': language, |
| 108 | + 'card_type': $( "input[name='cardtype']" ).val().toLowerCase(), |
| 109 | + 'format': 'json' |
| 110 | + }; |
| 111 | + |
| 112 | + $.ajax( { |
| 113 | + 'url': mw.util.wikiScript( 'api' ), |
| 114 | + 'data': sendData, |
| 115 | + 'dataType': 'json', |
| 116 | + 'type': 'GET', |
| 117 | + 'success': function( data ) { |
| 118 | + if ( data.result.errors ) { |
| 119 | + var errors = new Array(); |
| 120 | + $.each( data.result.errors, function( index, value ) { |
| 121 | + alert( value ); |
| 122 | + } ); |
| 123 | + } else { |
| 124 | + if ( data.result.returnurl ) { |
| 125 | + // Insert the iframe into the form |
| 126 | + showStep3(); |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | + } ); |
| 131 | + |
89 | 132 | } |
90 | 133 | else { |
91 | 134 | // show the continue button to indicate how to get to step 3 since they |
Index: trunk/extensions/DonationInterface/gateway_common/donation.api.php |
— | — | @@ -49,21 +49,24 @@ |
50 | 50 | $outputResult = array(); |
51 | 51 | $outputResult['message'] = $result['message']; |
52 | 52 | $outputResult['status'] = $result['status']; |
53 | | - if ( array_key_exists( 'PAYMENT', $result['data'] ) |
54 | | - && array_key_exists( 'RETURNURL', $result['data']['PAYMENT'] ) ) |
55 | | - { |
56 | | - $outputResult['returnurl'] = $result['data']['PAYMENT']['RETURNURL']; |
| 53 | + |
| 54 | + if ( array_key_exists( 'data', $result ) ) { |
| 55 | + if ( array_key_exists( 'PAYMENT', $result['data'] ) |
| 56 | + && array_key_exists( 'RETURNURL', $result['data']['PAYMENT'] ) ) |
| 57 | + { |
| 58 | + $outputResult['returnurl'] = $result['data']['PAYMENT']['RETURNURL']; |
| 59 | + } |
| 60 | + if ( array_key_exists( 'FORMACTION', $result['data'] ) ) { |
| 61 | + $outputResult['formaction'] = $result['data']['FORMACTION']; |
| 62 | + } |
| 63 | + if ( array_key_exists( 'RESPMSG', $result['data'] ) ) { |
| 64 | + $outputResult['responsemsg'] = $result['data']['RESPMSG']; |
| 65 | + } |
57 | 66 | } |
58 | | - if ( array_key_exists( 'FORMACTION', $result['data'] ) ) { |
59 | | - $outputResult['formaction'] = $result['data']['FORMACTION']; |
60 | | - } |
61 | | - if ( array_key_exists( 'RESPMSG', $result['data'] ) ) { |
62 | | - $outputResult['responsemsg'] = $result['data']['RESPMSG']; |
63 | | - } |
64 | 67 | if ( $result['errors'] ) { |
65 | 68 | $outputResult['errors'] = $result['errors']; |
66 | 69 | } |
67 | | - |
| 70 | + |
68 | 71 | if ( $this->donationData ) { |
69 | 72 | $this->getResult()->addValue( null, 'request', $this->donationData ); |
70 | 73 | } |