本文整理汇总了PHP中Paypal::getError方法的典型用法代码示例。如果您正苦于以下问题:PHP Paypal::getError方法的具体用法?PHP Paypal::getError怎么用?PHP Paypal::getError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paypal
的用法示例。
在下文中一共展示了Paypal::getError方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PayPaypal
public function PayPaypal()
{
if (!isset($this->data['type'])) {
$this->msg = Yii::t("default", "Payment type is required");
return;
}
$package_id = isset($this->data['package_id']) ? $this->data['package_id'] : '';
if ($this->data['type'] == "purchaseSMScredit") {
$paypal_con = Yii::app()->functions->getPaypalConnectionAdmin();
$paypal = new Paypal($paypal_con);
if ($res_paypal = $paypal->getExpressDetail()) {
$paypal->params['PAYERID'] = $res_paypal['PAYERID'];
$paypal->params['AMT'] = $res_paypal['AMT'];
$paypal->params['TOKEN'] = $res_paypal['TOKEN'];
$paypal->params['CURRENCYCODE'] = $res_paypal['CURRENCYCODE'];
if ($res = $paypal->expressCheckout()) {
$info = Yii::app()->functions->getSMSPackagesById($package_id);
$payment_code = Yii::app()->functions->paymentCode("paypal");
$params = array('merchant_id' => Yii::app()->functions->getMerchantID(), 'sms_package_id' => $package_id, 'payment_type' => $payment_code, 'package_price' => $res_paypal['AMT'], 'sms_limit' => $info['sms_limit'], 'date_created' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'payment_gateway_response' => json_encode($res), 'status' => "paid");
if ($this->insertData("{{sms_package_trans}}", $params)) {
$this->details = Yii::app()->request->baseUrl . "/merchant/smsReceipt/id/" . Yii::app()->db->getLastInsertID();
$this->code = 1;
$this->msg = Yii::t("default", "Successful");
} else {
$this->msg = Yii::t("default", "ERROR: Cannot insert record.");
}
} else {
$this->msg = $paypal->getError();
}
} else {
$this->msg = $paypal->getError();
}
}
/*end purchaseSMS*/
}
示例2:
</div><!-- receipt-main-wrap-->
<?php
}
} else {
echo "<p class=\"uk-text-danger\">" . Yii::t("default", "ERROR: Cannot get order details.") . "</p>";
}
?>
<?php
} else {
?>
<p class="uk-text-danger"><?php
echo Yii::t("default", "ERROR: Under ID not found.");
?>
</p>
<?php
}
?>
<?php
} else {
?>
<p class="uk-text-danger"><?php
echo $paypal->getError();
?>
</p>
<?php
}
?>
</div> <!--main-->
</div> <!--page-->
示例3: Paypal
<?php
$continue = true;
$msg = "";
if ($merchant = Yii::app()->functions->getMerchantByToken($_GET['internal-token'])) {
} else {
$continue = false;
$msg = Yii::t("default", 'Sorry but we cannot find what you are looking for.');
}
$paypal_con = Yii::app()->functions->getPaypalConnectionAdmin();
$paypal = new Paypal($paypal_con);
if ($res_paypal = $paypal->getExpressDetail()) {
} else {
$continue = false;
$msg = "Paypay Error: " . $paypal->getError();
}
?>
<div class="page merchant-payment-option">
<div class="main">
<div class="inner">
<div class="spacer"></div>
<?php
if ($continue == TRUE) {
?>
<h3><?php
echo Yii::t("default", "Paypal Verification");
?>
</h3>
<form class="uk-form uk-form-horizontal forms" id="forms" onsubmit="return false;">
示例4: actionProcessPayout
public function actionProcessPayout()
{
$db_ext = new DbExt();
$paypal_client_id = yii::app()->functions->getOptionAdmin('wd_paypal_client_id');
$paypal_client_secret = yii::app()->functions->getOptionAdmin('wd_paypal_client_secret');
$paypal_config = Yii::app()->functions->getPaypalConnectionWithdrawal();
dump($paypal_config);
$Paypal = new Paypal($paypal_config);
$Paypal->debug = true;
$website_title = yii::app()->functions->getOptionAdmin('website_title');
$cron = new CronFunctions();
if ($res = $cron->getPayoutToProcess()) {
if (is_array($res) && count($res) >= 1) {
foreach ($res as $val) {
$withdrawal_id = $val['withdrawal_id'];
$api_raw_response = '';
$status_msg = '';
dump($val);
switch ($val['payment_method']) {
case "paypal":
dump("Process paypal");
//if (!empty($paypal_client_id) && !empty($paypal_client_secret)){
if (is_array($paypal_config) && count($paypal_config) >= 1) {
if ($val['account'] != "") {
$Paypal->params['RECEIVERTYPE'] = "EmailAddress";
$Paypal->params['CURRENCYCODE'] = "USD";
$Paypal->params['EMAILSUBJECT'] = "=You have a payment from " . $website_title;
$Paypal->params['L_EMAIL0'] = $val['account'];
$Paypal->params['L_AMT0'] = normalPrettyPrice($val['amount']);
$Paypal->params['L_UNIQUEID0'] = str_pad($val['withdrawal_id'], 10, "0");
if ($pay_resp = $Paypal->payout()) {
dump($pay_resp);
if ($pay_resp['ACK'] == "Success") {
$status_msg = 'paid';
$api_raw_response = json_encode($pay_resp);
} else {
$api_raw_response = json_encode($pay_resp);
$status_msg = $pay_resp['L_LONGMESSAGE0'];
}
} else {
$status_msg = $Paypal->getError();
}
} else {
$status_msg = t("Paypal account is empty");
}
} else {
$status_msg = t("Payout settings for paypal not yet set");
}
break;
case "bank":
$status_msg = 'paid';
break;
}
echo "<h3>Update status</h3>";
dump($api_raw_response);
dump($status_msg);
$params_update = array('date_process' => date('c'), 'api_raw_response' => $api_raw_response, 'status' => $status_msg);
dump($params_update);
if ($db_ext->updateData("{{withdrawal}}", $params_update, 'withdrawal_id', $withdrawal_id)) {
echo "<h2>Update ok</h2>";
} else {
echo "<h2>Update Failed</h2>";
}
if ($status_msg == "paid") {
// send email
$subject = yii::app()->functions->getOptionAdmin('wd_template_process_subject');
if (empty($subject)) {
$subject = t("Your Request for Withdrawal has been Processed");
}
if ($merchant_info = Yii::app()->functions->getMerchant($val['merchant_id'])) {
$merchant_email = $merchant_info['contact_email'];
$tpl = yii::app()->functions->getOptionAdmin('wd_template_process');
$tpl = smarty("merchant-name", $merchant_info['restaurant_name'], $tpl);
$tpl = smarty("payout-amount", standardPrettyFormat($val['amount']), $tpl);
$tpl = smarty("payment-method", $val['payment_method'], $tpl);
$tpl = smarty("acoount", $val['account'], $tpl);
dump($tpl);
if (!empty($tpl)) {
sendEmail($merchant_email, '', $subject, $tpl);
}
}
}
}
}
} else {
dump("No record to process");
}
}
示例5: die
/*dump($params);
die();*/
$paypal = new Paypal($paypal_con);
$paypal->params = $params;
$paypal->debug = false;
if ($resp = $paypal->setExpressCheckout()) {
$insert['token'] = $resp['token'];
$insert['order_id'] = isIsset($_GET['id']);
$insert['date_created'] = date('c');
$insert['ip_address'] = $_SERVER['REMOTE_PORT'];
$insert['paypal_request'] = json_encode($paypal->params);
$insert['paypal_response'] = json_encode($resp['resp']);
Yii::app()->functions->paypalSavedToken($insert);
header('Location: ' . $resp['url']);
} else {
$error = $paypal->getError();
}
}
} else {
$error = Yii::t("default", "Merchant Paypal Credential not yet been set.");
}
}
?>
<div class="page-right-sidebar payment-option-page">
<div class="main">
<!--<p class="uk-text-success">Redirecting you to paypal. <i class="fa fa-spinner fa-spin"></i></p>-->
<?php
if (!empty($error)) {
?>
<p class="uk-text-danger"><?php
echo $error;
示例6: paymentPaypalVerification
public function paymentPaypalVerification()
{
$raw = base64_decode(isset($this->data['raw']) ? $this->data['raw'] : '');
parse_str($raw, $raw_decode);
$price = '';
$description = '';
if (is_array($raw_decode) && count($raw_decode) >= 1) {
$price = isset($raw_decode['price']) ? $raw_decode['price'] : '';
$description = isset($raw_decode['description']) ? $raw_decode['description'] : '';
}
$paypal_con = Yii::app()->functions->getPaypalConnectionAdmin();
$paypal = new Paypal($paypal_con);
if ($res_paypal = $paypal->getExpressDetail()) {
$paypal->params['PAYERID'] = $res_paypal['PAYERID'];
$paypal->params['AMT'] = $res_paypal['AMT'];
$paypal->params['TOKEN'] = $res_paypal['TOKEN'];
$paypal->params['CURRENCYCODE'] = $res_paypal['CURRENCYCODE'];
if ($res = $paypal->expressCheckout()) {
/*now insert transaction logs*/
if ($this->data['purchase'] == "fax_package") {
$payment_code = Yii::app()->functions->paymentCode("paypal");
$FunctionsK = new FunctionsK();
$info = $FunctionsK->getFaxPackagesById($this->data['package_id']);
$params = array('merchant_id' => Yii::app()->functions->getMerchantID(), 'fax_package_id' => $this->data['package_id'], 'payment_type' => $payment_code, 'package_price' => $price, 'fax_limit' => $info['fax_limit'], 'date_created' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'payment_gateway_response' => json_encode($res), 'status' => "paid");
if ($this->insertData("{{fax_package_trans}}", $params)) {
$this->details = websiteUrl() . "/merchant/faxreceipt/id/" . Yii::app()->db->getLastInsertID();
$this->code = 1;
$this->msg = Yii::t("default", "Successful");
$merchantinfo = Yii::app()->functions->getMerchantInfo();
$FunctionsK = new FunctionsK();
$FunctionsK->faxSendNotification((array) $merchantinfo[0], $this->data['package_id'], $payment_code, $price);
} else {
$this->msg = Yii::t("default", "ERROR: Cannot insert record.");
}
} else {
$this->msg = t("Uknown transaction");
}
} else {
$this->msg = $paypal->getError();
}
} else {
$this->msg = $paypal->getError();
}
}