Index: trunk/extensions/ContributionTracking/ContributionTracking_body.php |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 | |
30 | 30 | |
31 | 31 | function execute( $language ) { |
| 32 | + require_once( 'countryCodes.inc' ); |
32 | 33 | global $wgRequest, $wgOut, $wgContributionTrackingPayPalIPN, $wgContributionTrackingReturnToURLDefault, |
33 | 34 | $wgContributionTrackingPayPalRecurringIPN, $wgContributionTrackingPayPalBusiness; |
34 | 35 | |
— | — | @@ -52,6 +53,14 @@ |
53 | 54 | if($owa_ref != null && !is_numeric($owa_ref)){ |
54 | 55 | $owa_ref = $this->get_owa_ref_id($owa_ref); |
55 | 56 | } |
| 57 | + |
| 58 | + // Translate the shipping country from a code to a country name |
| 59 | + $country = ''; |
| 60 | + $code = $wgRequest->getText('country2'); |
| 61 | + if ( $code ) { |
| 62 | + $countries = countryCodes(); |
| 63 | + $country = $countries[$code]; |
| 64 | + } |
56 | 65 | |
57 | 66 | $tracked_contribution = array( |
58 | 67 | 'note' => $wgRequest->getText('comment', null), |
— | — | @@ -62,6 +71,7 @@ |
63 | 72 | 'utm_campaign' => $wgRequest->getText('utm_campaign', null), |
64 | 73 | 'optout' => ($wgRequest->getCheck('email-opt', 0) ? 0 : 1), |
65 | 74 | 'language' => $wgRequest->getText('language', null), |
| 75 | + 'country' => $country, |
66 | 76 | 'owa_session' => $wgRequest->getText('owa_session', null), |
67 | 77 | 'owa_ref' => $owa_ref, |
68 | 78 | 'ts' => $ts, |