当前位置: 首页>>代码示例>>PHP>>正文


PHP PayPal::doPayment方法代码示例

本文整理汇总了PHP中PayPal::doPayment方法的典型用法代码示例。如果您正苦于以下问题:PHP PayPal::doPayment方法的具体用法?PHP PayPal::doPayment怎么用?PHP PayPal::doPayment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PayPal的用法示例。


在下文中一共展示了PayPal::doPayment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PayPal

 function do_payment()
 {
     $amount = $this->input->get('amount');
     $r = new PayPal();
     $r->doExpressCheckout($amount, 'Da Greatest Library You Ever Seen');
     $final = $r->doPayment();
     if ($final['ACK'] == 'Success') {
         echo 'Succeed!';
     } else {
         echo 'Error!';
     }
 }
开发者ID:adadsa,项目名称:sosmed,代码行数:12,代码来源:c_payment.php

示例2: PayPal

<?php

require_once './paypal/paypal.php';
require_once './paypal/httprequest.php';
//Load PHPMailer Class
require_once 'phpmailer/class.phpmailer.php';
//Use this form for production server
$r = new PayPal(true);
//Use this form for sandbox tests
// $r = new PayPal();
$final = $r->doPayment();
if ($final['ACK'] == 'Success') {
    $payment = $r->getCheckoutDetails($final['TOKEN']);
    //If payment from PayPal is successful, send out our thankyou email
    $first_name = $payment['FIRSTNAME'];
    $last_name = $payment['LASTNAME'];
    $name = $first_name . ' ' . $last_name;
    $email = $payment['EMAIL'];
    $amount = $payment['CUSTOM'];
    $amount = explode("|", $amount, 2);
    $amount = $amount[0];
    $date = $payment['TIMESTAMP'];
    $date = strtotime($date);
    // Build and send the email *using PHPMailer
    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->SMTPDebug = 0;
    $mail->SMTPAuth = true;
    $mail->Host = $mailConfig['host'];
    $mail->Port = 587;
    $mail->Username = $mailConfig['user'];
开发者ID:eooes,项目名称:processing-web,代码行数:31,代码来源:_ppEmailThanks.php

示例3: executeConfirmation

 public function executeConfirmation(sfWebRequest $request)
 {
     $paypal = new PayPal();
     $final = $paypal->doPayment();
     if ($final['ACK'] == 'Success') {
         $this->result = "Succeed!";
         /*        Array
         //            (
         //            [TOKEN] => EC-4AV72391LH8693509
         //            [TIMESTAMP] => 2012-10-10T13:40:58Z
         //            [CORRELATIONID] => b20d0c034074
         //            [ACK] => Success
         //            [VERSION] => 52.0
         //            [BUILD] => 3893058
         //            [TRANSACTIONID] => 27557320TK055573R
         //            [TRANSACTIONTYPE] => expresscheckout
         //            [PAYMENTTYPE] => instant
         //            [ORDERTIME] => 2012-10-10T13:40:56Z
         //            [AMT] => 900.00
         //            [FEEAMT] => 30.85
         //            [TAXAMT] => 0.00
         //            [CURRENCYCODE] => EUR
         //            [PAYMENTSTATUS] => Completed
         //            [PENDINGREASON] => None
         //            [REASONCODE] => None
         //            )
                 
              :*/
         // CONTRAT
         $contratMobilyrent = new MobilyrentContrat();
         $contratMobilyrent->setDatecontrat(date('Y-m-d'));
         $contratMobilyrent->setDatedepart($this->getUser()->getAttribute('datedepart'));
         $contratMobilyrent->setDateretourprevue($this->getUser()->getAttribute('dateretour'));
         $contratMobilyrent->setDateretourreelle($this->getUser()->getAttribute('dateretour'));
         $contratMobilyrent->setPrixjournalierconvenu($this->getUser()->getAttribute('voiture')->getTarifJour());
         $contratMobilyrent->setNocontrat($final['CORRELATIONID']);
         $contratMobilyrent->setKmdepart(0);
         $contratMobilyrent->setKmretour(0);
         $contratMobilyrent->setIsActivated(1);
         $contratMobilyrent->setMontantaccompte($this->getUser()->getAttribute('voiture')->getMobilyrentModele()->getCaution());
         $contratMobilyrent->save();
         //FACTURE
         $factureMobilyrent = new MobilyrentFacture();
         $factureMobilyrent->setDatefacture(date('Y-m-d'));
         $factureMobilyrent->setNofacture($final['CORRELATIONID']);
         $factureMobilyrent->setTotalfacture($this->getUser()->getAttribute('montantLocation'));
         $factureMobilyrent->setIsActivated(1);
         $factureMobilyrent->setMobilyrentContrat($contratMobilyrent);
         $factureMobilyrent->save();
         //PAIEMENT
         $paiementMobilyrent = new MobilyrentPaiement();
         $paiementMobilyrent->setNom("test");
         $paiementMobilyrent->setPrenom("test");
         $paiementMobilyrent->setAdresse("1 Allée colette");
         $paiementMobilyrent->setCodepostal("91270");
         $paiementMobilyrent->setDatepaiement(date('Y-m-d'));
         $paiementMobilyrent->setMontantpaiement($this->getUser()->getAttribute('montantLocation'));
         $paiementMobilyrent->setMobilyrentFacture($factureMobilyrent);
         $paiementMobilyrent->setIdtypepaiement(2);
         $paiementMobilyrent->setIdstatut(1);
         $paiementMobilyrent->save();
         //GET SF_GUARD_USER
         $user = Doctrine::getTable('sfGuardUser')->retrieveByUsername($this->getUser()->getAttribute('email_address'));
         //echo '<pre>';
         //print_r();
         //exit;
         //LOCATION
         $locationMobilyrent = new MobilyrentLocation();
         $locationMobilyrent->setMobilyrentContrat($contratMobilyrent);
         $locationMobilyrent->setMobilyrentVehicule($this->getUser()->getAttribute('voiture'));
         //$locationMobilyrent->setIduserprofile($this->getUser()->getGuardUser()->getProfile()->getId());
         $locationMobilyrent->setIduserprofile($user->getProfile()->getId());
         $locationMobilyrent->setIsActivated(1);
         $locationMobilyrent->save();
         $message = $this->getMailer()->compose(sfConfig::get('app_mail_saidi'), $this->getUser()->getAttribute('email_address'), '[Mobilyrent] - Reservation confirmée Mobilyrent location de voiture', '[Mobilyrent] - Reservation confirmée Mobilyrent location de voiture');
         $this->getMailer()->send($message);
     } else {
         $this->result = "Failure!";
     }
 }
开发者ID:sfinx13,项目名称:appsmartproject,代码行数:80,代码来源:_actions.class.php

示例4: executeConfirmation

 public function executeConfirmation(sfWebRequest $request)
 {
     $paypal = new PayPal();
     $final = $paypal->doPayment();
     if ($final['ACK'] == 'Success') {
         $this->result = "Succeed!";
         // CONTRAT
         $contratMobilyrent = new MobilyrentContrat();
         $contratMobilyrent->setDatecontrat(date('Y-m-d'));
         $contratMobilyrent->setDatedepart($this->getUser()->getAttribute('datedepart'));
         $contratMobilyrent->setDateretourprevue($this->getUser()->getAttribute('dateretour'));
         $contratMobilyrent->setDateretourreelle($this->getUser()->getAttribute('dateretour'));
         $contratMobilyrent->setPrixjournalierconvenu($this->getUser()->getAttribute('voiture')->getTarifJour());
         $contratMobilyrent->setNocontrat($final['CORRELATIONID']);
         $contratMobilyrent->setKmdepart(0);
         $contratMobilyrent->setKmretour(0);
         $contratMobilyrent->setIsActivated(1);
         $contratMobilyrent->setMontantaccompte($this->getUser()->getAttribute('voiture')->getMobilyrentModele()->getCaution());
         $contratMobilyrent->save();
         //FACTURE
         $factureMobilyrent = new MobilyrentFacture();
         $factureMobilyrent->setDatefacture(date('Y-m-d'));
         $factureMobilyrent->setNofacture($final['CORRELATIONID']);
         $factureMobilyrent->setTotalfacture($this->getUser()->getAttribute('montantLocation'));
         $factureMobilyrent->setIsActivated(1);
         $factureMobilyrent->setMobilyrentContrat($contratMobilyrent);
         $factureMobilyrent->save();
         //PAIEMENT
         $paiementMobilyrent = new MobilyrentPaiement();
         $paiementMobilyrent->setNom($this->getUser()->getGuardUser()->getLastName());
         $paiementMobilyrent->setPrenom($this->getUser()->getGuardUser()->getFirstName());
         $paiementMobilyrent->setAdresse($this->getUser()->getGuardUser()->getProfile()->getAdresse());
         $paiementMobilyrent->setCodepostal($this->getUser()->getGuardUser()->getProfile()->getCodepostal());
         $paiementMobilyrent->setDatepaiement(date('Y-m-d'));
         $paiementMobilyrent->setMontantpaiement($this->getUser()->getAttribute('montantLocation'));
         $paiementMobilyrent->setMobilyrentFacture($factureMobilyrent);
         $paiementMobilyrent->setIdtypepaiement(2);
         $paiementMobilyrent->setIdstatut(1);
         $paiementMobilyrent->save();
         //GET SF_GUARD_USER
         $user = Doctrine::getTable('sfGuardUser')->retrieveByUsername($this->getUser()->getAttribute('email_address'));
         $locationMobilyrent = new MobilyrentLocation();
         $locationMobilyrent->setMobilyrentContrat($contratMobilyrent);
         $locationMobilyrent->setMobilyrentVehicule($this->getUser()->getAttribute('voiture'));
         $locationMobilyrent->setIduserprofile($this->getUser()->getGuardUser()->getProfile()->getId());
         //$locationMobilyrent->setIduserprofile($user->getProfile()->getId());
         $locationMobilyrent->setIsActivated(1);
         $locationMobilyrent->save();
         $message = $this->getMailer()->compose(sfConfig::get('app_mail_saidi'), $this->getUser()->getAttribute('email_address'), '[Mobilyrent] - Reservation confirmée Mobilyrent location de voiture', '[Mobilyrent] - Reservation confirmée Mobilyrent location de voiture');
         $this->getMailer()->send($message);
         $startDate = $this->getUser()->getAttribute('datedepart');
         $startTime = $this->getUser()->getAttribute('heuredepart');
         $endDate = $this->getUser()->getAttribute('dateretour');
         $endTime = $this->getUser()->getAttribute('heureretour');
         $title = $this->getUser()->getGuardUser()->getName();
         $voitureObject = $this->getUser()->getAttribute('voiture');
         $content = "Reservation de la voiture:" . ' ' . $voitureObject->getNoimmatriculation();
         $startDate = "{$startDate}T{$startTime}";
         $endDate = "{$endDate}T{$endTime}";
         $this->setPlanning($startDate, $endDate, $title, $content);
     } else {
         $this->result = "Failure!";
     }
 }
开发者ID:sfinx13,项目名称:appsmartproject,代码行数:64,代码来源:actions.class.php


注:本文中的PayPal::doPayment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。