当前位置: 首页>>代码示例>>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;未经允许,请勿转载。