當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PayPal::getCheckoutDetails方法代碼示例

本文整理匯總了PHP中PayPal::getCheckoutDetails方法的典型用法代碼示例。如果您正苦於以下問題:PHP PayPal::getCheckoutDetails方法的具體用法?PHP PayPal::getCheckoutDetails怎麽用?PHP PayPal::getCheckoutDetails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PayPal的用法示例。


在下文中一共展示了PayPal::getCheckoutDetails方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PayPal

* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once './class/paypal.php';
//when needed
require_once './class/httprequest.php';
//when needed
//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') {
    echo 'Succeed!';
    print_r($r->getCheckoutDetails($final['TOKEN']));
    /* Details example:
    Array
    (
        [TOKEN] => EC-46K253307T956310E
        [TIMESTAMP] => 2010-12-12T09:38:01Z
        [CORRELATIONID] => cbf9ed77f3dbe
        [ACK] => Success
        [VERSION] => 52.0
        [BUILD] => 1613703
        [EMAIL] => buyer1_1292145548_per@maly.cz
        [PAYERID] => ZMU92MM4SPBHS
        [PAYERSTATUS] => verified
        [FIRSTNAME] => Test
        [LASTNAME] => User
        [COUNTRYCODE] => US
開發者ID:rafasashi,項目名稱:paypal,代碼行數:31,代碼來源:ppreturn.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: PayPal

    }
}
// end of the loop.
?>

							<?php 
include_once get_template_directory() . '/inc/paypal/class/paypal.php';
include_once get_template_directory() . '/inc/paypal/class/httprequest.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') {
    //echo 'Succeed!';
    $oToken = $r->getCheckoutDetails($final['TOKEN']);
    $txnID = $oToken['TOKEN'];
    $firstName = $oToken['FIRSTNAME'];
    $lastName = $oToken['LASTNAME'];
    $addressCountry = $oToken['COUNTRYCODE'];
    $payerEmail = $oToken['EMAIL'];
    $bani = explode("|", $oToken['CUSTOM']);
    $payment_gross = $bani[0];
    $valuta = $bani[1];
    $donCause = $bani[2];
    $my_post = array('post_title' => $txnID, 'post_status' => 'publish', 'post_author' => 1, 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_type' => 'post_pledges');
    $post_id = wp_insert_post($my_post);
    add_post_meta($post_id, "wpl_pledge_cause", $donCause);
    add_post_meta($post_id, "wpl_pledge_transaction_id", $txnID);
    add_post_meta($post_id, "wpl_pledge_first_name", $firstName);
    add_post_meta($post_id, "wpl_pledge_last_name", $lastName);
開發者ID:craighays,項目名稱:nsfhp,代碼行數:31,代碼來源:template-donations-pp.php


注:本文中的PayPal::getCheckoutDetails方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。