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


PHP SoapClient::capture方法代码示例

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


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

示例1: printHeaders

    'location' => "https://pal-test.adyen.com/pal/servlet/soap/Payment",
    'trace' => 1,
    'classmap' => $classmap));

#print("<pre>");
#print_r($soapClient->__getFunctions());
#print("</pre>");
#print("<hr />");
	
#print("<pre>");
#print_r($soapClient->__getTypes());
#print("</pre>");
#print("<hr />");

try {
	$result = $soapClient->capture(array('modificationRequest' => $rr, 'captureResponse' => $ro));
} catch (SoapFault $exception) {
	print("<pre>");
	print($exception);
	print("<pre>");
	print("<hr />");
    printHeaders($soapClient);
}

print("\nresult = " . $result->captureResult->response);
print("\npspreference = " . $result->captureResult->pspReference);
print("\n\n");

//====================== Debug Functions ======================
function printHeaders($client)
{
开发者ID:prachetas,项目名称:php,代码行数:31,代码来源:modification_example.php

示例2: capture

 public function capture(Varien_Object $payment, $amount)
 {
     $session = Mage::getSingleton('adminhtml/session');
     //
     // Verify if remote interface is enabled
     //
     if (!$this->_canDoCapture($payment->getOrder())) {
         return $this;
     }
     if ((int) $this->getConfigData('remoteinterface', $payment->getOrder() ? $payment->getOrder()->getStoreId() : null) != 1) {
         $this->addOrderComment($payment->getOrder(), Mage::helper('epay')->__('EPAY_LABEL_73'));
         return $this;
     }
     try {
         //
         // Read info directly from the database
         $read = Mage::getSingleton('core/resource')->getConnection('core_read');
         $row = $read->fetchRow("select * from epay_order_status where orderid = '" . $payment->getOrder()->getIncrementId() . "'");
         if ($row["status"] == '1') {
             $epayamount = (string) ($amount * 100);
             $tid = $row["tid"];
             $param = array('merchantnumber' => $this->getConfigData('merchantnumber', $payment->getOrder() ? $payment->getOrder()->getStoreId() : null), 'transactionid' => $tid, 'amount' => $epayamount, 'group' => '', 'pbsResponse' => 0, 'epayresponse' => 0, 'pwd' => $this->getConfigData('remoteinterfacepassword', $payment->getOrder() ? $payment->getOrder()->getStoreId() : null));
             $client = new SoapClient('https://ssl.ditonlinebetalingssystem.dk/remote/payment.asmx?WSDL');
             $result = $client->capture($param);
             if ($result->captureResult == 1) {
                 //
                 // Success - transaction captured!
                 //
                 $this->addOrderComment($payment->getOrder(), "Transaction with id: " . $tid . " has been captured by amount: " . number_format($amount, 2, ",", "."));
                 if (!$payment->getParentTransactionId() || $tid != $payment->getParentTransactionId()) {
                     $payment->setTransactionId($tid);
                 }
                 $payment->setIsTransactionClosed(0);
             } else {
                 if ($result->epayresponse != -1) {
                     if ($result->epayresponse == -1002) {
                         $this->addOrderComment($payment->getOrder(), "Transaction could not be deleted by ePay: " . $result->epayresponse . ". Forretningsnummeret findes ikke.");
                         throw new Exception("Transaction could not be captured by ePay: " . $result->epayresponse . ". Forretningsnummeret findes ikke.");
                     } else {
                         if ($result->epayresponse == -1003 || $result->epayresponse == -1006) {
                             $this->addOrderComment($payment->getOrder(), "Transaction could not be captured by ePay: " . $result->epayresponse . ". Der er ikke adgang til denne funktion (API / Remote Interface).");
                             throw new Exception("Transaction could not be captured by ePay: " . $result->epayresponse . ". Der er ikke adgang til denne funktion (API / Remote Interface).");
                         } else {
                             $this->addOrderComment($payment->getOrder(), 'Transaction could not be captured by ePay: ' . $result->epayresponse . '. ' . $this->getEpayErrorText($result->epayresponse));
                             throw new Exception('Transaction could not be captured by ePay: ' . $result->epayresponse . '. ' . $this->getEpayErrorText($result->epayresponse));
                         }
                     }
                 } else {
                     throw new Exception("Transaction could not be captured by ePay: " . $result->pbsResponse . '. ' . $this->getPbsErrorText($result->pbsResponse));
                 }
             }
         } else {
             //
             // Somehow the order was not found - this must be an error!
             //
             throw new Exception("Order not found - please check the epay_order_status table!");
         }
     } catch (Exception $e) {
         $session->addException($e, $e->getMessage() . " - Go to the ePay administration to capture the payment manually.");
     }
     return $this;
 }
开发者ID:EpayGlenn,项目名称:magento,代码行数:62,代码来源:Standard.php

示例3: SoapClient

 * - $options[cache_wsdl] = WSDL_CACHE_BOTH, we advice 
 *   to cache the WSDL since we usually never change it.
 */
$client = new SoapClient("https://pal-test.adyen.com/pal/Payment.wsdl", array("login" => "YourWSUser", "password" => "YourWSUserPassword", "style" => SOAP_DOCUMENT, "encoding" => SOAP_LITERAL, "cache_wsdl" => WSDL_CACHE_BOTH, "trace" => 1));
/**
 * Perform capture request by sending in a 
 * modificationRequest, the protocol is defined 
 * in the WSDL. The following parameters are used:
 * - merchantAccount: The merchant account the payment was processed with.
 * - modificationAmount: The amount to capture
 * 	- currency: the currency must match the original payment
 * 	- amount: the value must be the same or less than the original amount
 * - originalReference: This is the pspReference that was assigned to the authorisation
 * - reference: If you wish, you can to assign your own reference or description to the modification. 
 */
try {
    $result = $client->capture(array("modificationRequest" => array("merchantAccount" => "YourMerchantAccount", "modificationAmount" => array("currency" => "EUR", "value" => "199"), "originalReference" => "PspReferenceOfTheAuthorisedPayment", "reference" => "YourReference")));
    /**
     * If the message was syntactically valid and merchantAccount is correct you will 
     * receive a captureResult response with the following fields:
     * - pspReference: A new reference to uniquely identify this modification request. 
     * - response: A confirmation indicating we receievd the request: [capture-received]. 
     * 
     * Please note: The result of the cancellation is sent via a notification with eventCode CAPTURE.
     */
    print_r($result);
} catch (SoapFault $ex) {
    print "<pre>";
    print $ex;
    print "<pre>";
}
开发者ID:felrosset,项目名称:php,代码行数:31,代码来源:capture.php

示例4: sendData

 /**
  * @param mixed $data
  * @return CaptureResponse
  */
 public function sendData($data)
 {
     $client = new \SoapClient($this->endpoint . '?WSDL');
     $result = $client->capture($data);
     return $this->response = new CaptureResponse($this, array('captureResult' => $result->captureResult, 'pbsResponse' => $result->pbsResponse, 'epayresponse' => $result->epayresponse));
 }
开发者ID:xown,项目名称:omnipay-epay,代码行数:10,代码来源:CaptureRequest.php

示例5: epay_daily_cron_job

function epay_daily_cron_job()
{
    $gateway = getGatewayVariables("epay");
    $query = mysql_query("SELECT * FROM tblinvoices INNER JOIN tblepay epay ON epay.invoiceid = tblinvoices.id WHERE tblinvoices.paymentmethod = 'epay' AND tblinvoices.status = 'Unpaid' AND (tblinvoices.duedate <= NOW() + INTERVAL 1 DAY) AND epay.`status` = 0");
    while ($row = mysql_fetch_array($query)) {
        try {
            //Capture
            $epay_params['merchantnumber'] = $gateway["merchantnumber"];
            $epay_params['amount'] = $row['total'] * 100;
            $epay_params['transactionid'] = $row['txnid'];
            $epay_params['group'] = "";
            $epay_params['pbsResponse'] = "-1";
            $epay_params['epayresponse'] = "-1";
            $soap = new SoapClient('https://ssl.ditonlinebetalingssystem.dk/remote/payment.asmx?WSDL');
            $soap_capture_result = $soap->capture($epay_params);
            //Transaction OK
            if ($soap_capture_result->captureResult == true) {
                //OK capture
                addInvoicePayment($row['invoiceid'], $row['txnid'], $row['total'], 0, "epay");
                mysql_query("UPDATE tblepay SET status = 1 WHERE invoiceid = " . $row['invoiceid']);
            } else {
                //Error in capture
                logActivity("epay_daily_cron_job: TXNID: " . $row['txnid'] . " PBS: " . $soap_capture_result->pbsresponse . " ePay: " . $soap_capture_result->epayresponse);
                mysql_query("UPDATE tblepay SET status = 2 WHERE invoiceid = " . $row['invoiceid']);
            }
        } catch (Exception $e) {
            logActivity("epay_daily_cron_job: " . $e->getMessage());
        }
    }
}
开发者ID:proudwing,项目名称:whmcs,代码行数:30,代码来源:epay.php


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