本文整理汇总了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
示例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'];
示例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);