Index: civicrm/trunk/sites/all/modules/fundcore/gateways/fundcore_paypal.module |
— | — | @@ -61,6 +61,18 @@ |
62 | 62 | |
63 | 63 | $timestamp = strtotime($post_data['payment_date']); |
64 | 64 | |
| 65 | + // Detect if we're using the new-style |
| 66 | + if (is_numeric($post_data['option_selection1'])) { |
| 67 | + $tracking_data = db_fetch_array(db_query('SELECT * FROM {contribution_tracking} WHERE id = %d', $post_data['option_selection1'])); |
| 68 | + $contribution['anonymous'] = $tracking_data['anonymous']; |
| 69 | + $contribution['comment'] = $tracking_data['note']; |
| 70 | + } |
| 71 | + else { |
| 72 | + $split = explode(';', $post_data['option_selection1']); |
| 73 | + $contribution['anonymous'] = ($split[0] != 'public' && $split[0] != 'Mention my name'); |
| 74 | + $contribution['comment'] = $post_data['option_selection2']; |
| 75 | + } |
| 76 | + |
65 | 77 | $contribution['email'] = $post_data['payer_email']; |
66 | 78 | $contribution['first_name'] = $post_data['first_name']; |
67 | 79 | $contribution['last_name'] = $post_data['last_name']; |
— | — | @@ -74,15 +86,12 @@ |
75 | 87 | $contribution['country'] = $post_data['address_country_code']; |
76 | 88 | $contribution['postal_code'] = $post_data['address_zip']; |
77 | 89 | |
78 | | - $split = explode(';', $post_data['option_selection1']); |
79 | | - $contribution['anonymous'] = ($split[0] != 'public' && $split[0] != 'Mention my name'); |
80 | 90 | $contribution['gateway_txn_id'] = $post_data['txn_id']; |
81 | 91 | $contribution['original_currency'] = $post_data['mc_currency']; |
82 | 92 | $contribution['original_gross'] = $post_data['mc_gross']; |
83 | 93 | $contribution['fee'] = exchange_rate_convert($post_data['mc_currency'], $post_data['mc_fee'], $timestamp); |
84 | 94 | $contribution['gross'] = exchange_rate_convert($post_data['mc_currency'], $post_data['mc_gross'], $timestamp); |
85 | 95 | $contribution['net'] = $contribution['gross'] - $contribution['fee']; |
86 | | - $contribution['comment'] = $post_data['option_selection2']; |
87 | 96 | $contribution['date'] = $timestamp; |
88 | 97 | |
89 | 98 | drupal_set_message('<pre>' . check_plain(print_r($contribution, TRUE)) . '</pre>'); |
Index: civicrm/trunk/sites/all/modules/fundcore/gateways/fundcore_moneybookers.module |
— | — | @@ -47,12 +47,24 @@ |
48 | 48 | } |
49 | 49 | |
50 | 50 | function fundcore_moneybookers_parse($post_data, $timestamp) { |
| 51 | + $contribution = array(); |
| 52 | + |
| 53 | + // Detect if we're using the new-style |
| 54 | + if (is_numeric($post_data['os0'])) { |
| 55 | + $tracking_data = db_fetch_array(db_query('SELECT * FROM {contribution_tracking} WHERE id = %d', $post_data['os0'])); |
| 56 | + $contribution['anonymous'] = $tracking_data['anonymous']; |
| 57 | + $contribution['comment'] = $tracking_data['note']; |
| 58 | + } |
| 59 | + else { |
| 60 | + $split = explode(';', $post_data['os0']); |
| 61 | + $contribution['anonymous'] = ($split[0] != 'public' && $split[0] != 'Mention my name'); |
| 62 | + $contribution['comment'] = $post_data['os1']; |
| 63 | + } |
| 64 | + |
51 | 65 | $split = explode('@', $post_data['pay_from_email']); |
52 | 66 | $contribution['first_name'] = ''; |
53 | 67 | $contribution['last_name'] = $split[0]; |
54 | 68 | $contribution['email'] = $post_data['pay_from_email']; |
55 | | - $split = explode(';', $post_data['os0']); |
56 | | - $contribution['anonymous'] = ($split[0] != 'public' && $split[0] != 'Mention my name'); |
57 | 69 | $contribution['gateway_txn_id'] = $post_data['mb_transaction_id']; |
58 | 70 | $contribution['original_currency'] = $post_data['currency']; |
59 | 71 | $contribution['original_gross'] = $post_data['amount']; |
— | — | @@ -60,7 +72,6 @@ |
61 | 73 | $contribution['fee'] = 0; |
62 | 74 | $contribution['net'] = $contribution['gross'] - $contribution['fee']; |
63 | 75 | $contribution['date'] = $timestamp; |
64 | | - $contribution['comment'] = $post_data['os1']; |
65 | 76 | |
66 | 77 | return $contribution; |
67 | 78 | } |