本文整理汇总了PHP中Paypal::pdt方法的典型用法代码示例。如果您正苦于以下问题:PHP Paypal::pdt方法的具体用法?PHP Paypal::pdt怎么用?PHP Paypal::pdt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paypal
的用法示例。
在下文中一共展示了Paypal::pdt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processPdt
public function processPdt($get)
{
if (isset($get['tx']) && isset($get['st']) && strtolower($get['st']) == 'completed') {
$db = new DBHandler();
$db->connect();
$paypal = new Paypal();
$data = $paypal->pdt($get['tx']);
// Datas
$u = new Utility();
$params = array();
$items = array();
// if ((isset($data['option_selection20']) && $data['option_selection20'] != '') && (isset($data['option_selection21']) && $data['option_selection21'] != '')) {
// $params = $u->processBookingPaypalData($data);
// $params['couponCode'] = $db->retrieveLeadLastId() . 'SEDA' . $u->generateBookingCode();
// // Items
// $items = $u->processBookingPaypalItems($data);
// } else {
$params = $u->processPaypalData($data);
$params['couponCode'] = $db->retrieveLeadLastId() . $u->generateCode();
// Items
$items = $u->processPaypalItems($data);
// }
// End of Datas
if (DEBUG == true) {
$datas = implode(",", $params);
error_log(date('[Y-m-d H:i e] ') . "Save Data Leads in PDT: {$datas}" . PHP_EOL, 3, DATA_LOG);
}
$lead = array();
$check = $db->retrieveLeadByTxnId($get['tx']);
if (!$check) {
// if ((isset($data['option_selection20']) && $data['option_selection20'] != '') && (isset($data['option_selection21']) && $data['option_selection21'] != '')) {
// $db->insertBookLead($params, $items);
// if ($params['singlet'] == 'XS') {
// $db->updateInventory();
// }
// } else {
$db->insertLead($params, $items);
if ($params['singlet'] == 'XS') {
$db->updateInventory();
}
// }
//
// $analytics = new Analytics;
// $analytics->ga($params, $items);
//
// $now = new DateTime();
// $params['date_added'] = $now->format('Y-m-d G:i:s');
//
// $mail = new MailerHandler();
// $mail->sendMail($params);
//
//
// $sms = new SMS();
// $sms->sendSms($params['contact'],$get['tx']);
// if ((isset($data['option_selection20']) && $data['option_selection20'] != '') && (isset($data['option_selection21']) && $data['option_selection21'] != '')) {
// $mail->sendMailToSeda($params);
// }
//$bm = new BenchmarkHandler;
//$bm->addOnlineLeadToBenchmark($params);
$now = new DateTime();
$params['date_added'] = $now->format('Y-m-d G:i:s');
$lead = $params;
} else {
// $book = $db->retrieveBookingByLeadId($check['id']);
// if ($book) {
// $check['revenue'] = $book['total_payment'];
// $check['check_in'] = $book['check_in'];
// $check['check_out'] = $book['check_out'];
// $check['booked_room'] = $book['booked_room'];
// $check['max'] = $book['max'];
// $check['hotel'] = $book['hotel'];
// $check['days'] = $book['days'];
// }
// $lead = $check;
}
// $ss = new SpreadsheetHandler;
// $duplicate = $ss->isEntryDuplicate($get['tx']);
// if (!$duplicate) {
// $ss->addLeadToDocs($params);
// if ((isset($data['option_selection20']) && $data['option_selection20'] != '') && (isset($data['option_selection21']) && $data['option_selection21'] != '')) {
// $ss->addHotelBookingToDocs($params);
// }
// }
if ($lead) {
// Go to Thank you page.
return $lead;
} else {
// Go to failed or pending page
return array();
}
} else {
return false;
}
}