public function doCapture() { $result = 'payment not found'; $payment = Payments::find($this->request->id); if ($payment) { $result = Paypal::doCapture($payment->auth_id, $payment->auth_amount, 'USD', true); } return compact('result'); }
* alongside the normal registration data in the registration collection */ require __DIR__ . '/bootstrap/modules.php'; /** * This file contains your application's globalization rules, including inflections, * transliterations, localized validation, and how localized text should be loaded. Uncomment this * line if you plan to globalize your site. */ // require __DIR__ . '/bootstrap/g11n.php'; /** * This file contains configurations for handling different content types within the framework, * including converting data to and from different formats, and handling static media assets. */ require __DIR__ . '/bootstrap/media.php'; /** * This file configures console filters and settings, specifically output behavior and coloring. */ if (PHP_SAPI === 'cli') { require __DIR__ . '/bootstrap/console.php'; } $paypal_config = \app\util\Config::get('paypal'); \app\util\Paypal::config($paypal_config['nvp']); $mailchimp_config = \app\util\Config::get('mailchimp'); $MCAPI = new \app\extensions\helper\MCAPI($mailchimp_config['api-key']); if (isset($_COOKIE['session_id'])) { $login_identity = Identities::first(array('conditions' => array('session.id' => $_COOKIE['session_id'], 'session.expires' => array('$gte' => time())))); if ($login_identity) { $login_identity->save(array('session.expires' => time() + \app\util\Config::get('session_length', 7) * 24 * 60 * 60)); Auth::set('any', $login_identity); } }