Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | 'utm_campaign': $( "input[name='utm_campaign']" ).val(), |
56 | 56 | 'utm_medium': $( "input[name='utm_medium']" ).val(), |
57 | 57 | 'referrer': $( "input[name='referrer']" ).val(), |
| 58 | + 'recurring': $( "input[name='recurring']" ).val(), |
58 | 59 | 'format': 'json' |
59 | 60 | }; |
60 | 61 | $.ajax( { |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | 'utm_campaign': $( "input[name='utm_campaign']" ).val(), |
58 | 58 | 'utm_medium': $( "input[name='utm_medium']" ).val(), |
59 | 59 | 'referrer': $( "input[name='referrer']" ).val(), |
| 60 | + 'recurring': $( "input[name='recurring']" ).val(), |
60 | 61 | 'format': 'json' |
61 | 62 | }; |
62 | 63 | $.ajax( { |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -1685,6 +1685,7 @@ |
1686 | 1686 | 'issuer_id', |
1687 | 1687 | 'order_id', //This may or may not oughta-be-here... |
1688 | 1688 | 'language', |
| 1689 | + 'recurring' |
1689 | 1690 | ); |
1690 | 1691 | } |
1691 | 1692 | |
— | — | @@ -2009,6 +2010,22 @@ |
2010 | 2011 | } |
2011 | 2012 | |
2012 | 2013 | /** |
| 2014 | + * Stage: recurring |
| 2015 | + * Adds the recurring payment pieces to the structure of |
| 2016 | + * INSERT_ORDERWITHPAYMENT if the recurring field is populated. |
| 2017 | + * |
| 2018 | + * @param string $type request|response |
| 2019 | + */ |
| 2020 | + protected function stage_recurring( $type = 'request' ){ |
| 2021 | + if ( ! $this->getData_Staged( 'recurring' ) ){ |
| 2022 | + return; |
| 2023 | + } else { |
| 2024 | + $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['ORDER'][] = 'ORDERTYPE'; |
| 2025 | + $this->transactions['INSERT_ORDERWITHPAYMENT']['values']['ORDERTYPE'] = '4'; |
| 2026 | + } |
| 2027 | + } |
| 2028 | + |
| 2029 | + /** |
2013 | 2030 | * Add keys to transaction for submethod |
2014 | 2031 | * |
2015 | 2032 | */ |
Index: trunk/extensions/DonationInterface/gateway_common/donation.api.php |
— | — | @@ -113,6 +113,7 @@ |
114 | 114 | 'utm_campaign' => $this->defineParam( false ), |
115 | 115 | 'utm_medium' => $this->defineParam( false ), |
116 | 116 | 'referrer' => $this->defineParam( false ), |
| 117 | + 'recurring' => $this->defineParam( false ), |
117 | 118 | ); |
118 | 119 | } |
119 | 120 | |
— | — | @@ -182,6 +183,7 @@ |
183 | 184 | 'utm_campaign' => 'Tracking variable', |
184 | 185 | 'utm_medium' => 'Tracking variable', |
185 | 186 | 'referrer' => 'Original referrer', |
| 187 | + 'recurring' => 'Optional - indicates that the transaction is meant to be recurring.', |
186 | 188 | ); |
187 | 189 | } |
188 | 190 | |
Index: trunk/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -136,6 +136,7 @@ |
137 | 137 | 'transaction_type' => $wgRequest->getText( 'transaction_type', null ), |
138 | 138 | 'form_name' => $wgRequest->getText( 'form_name', null ), |
139 | 139 | 'ffname' => $wgRequest->getText( 'ffname', null ), |
| 140 | + 'recurring' => $wgRequest->getVal( 'recurring', null ), //boolean type |
140 | 141 | ); |
141 | 142 | if ( !$this->wasPosted() ) { |
142 | 143 | $this->setVal( 'posted', false ); |
— | — | @@ -1428,6 +1429,7 @@ |
1429 | 1430 | '_cache_', |
1430 | 1431 | 'anonymous', |
1431 | 1432 | 'optout', |
| 1433 | + 'recurring', |
1432 | 1434 | ); |
1433 | 1435 | |
1434 | 1436 | foreach ($boolean as $key){ |