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


PHP Payment::getCcExpMonth方法代碼示例

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


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

示例1: _placeOrder

 /**
  * Place an order with authorization or capture action
  *
  * @param Payment $payment
  * @param float $amount
  * @return $this
  */
 protected function _placeOrder(Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     $api = $this->_pro->getApi()->setPaymentAction($this->_pro->getConfig()->getConfigValue('paymentAction'))->setIpAddress($this->_requestHttp->getClientIp(false))->setAmount($amount)->setCurrencyCode($order->getBaseCurrencyCode())->setInvNum($order->getIncrementId())->setEmail($order->getCustomerEmail())->setNotifyUrl($this->_urlBuilder->getUrl('paypal/ipn/'))->setCreditCardType($payment->getCcType())->setCreditCardNumber($payment->getCcNumber())->setCreditCardExpirationDate($this->_getFormattedCcExpirationDate($payment->getCcExpMonth(), $payment->getCcExpYear()))->setCreditCardCvv2($payment->getCcCid())->setMaestroSoloIssueNumber($payment->getCcSsIssue());
     if ($payment->getCcSsStartMonth() && $payment->getCcSsStartYear()) {
         $year = sprintf('%02d', substr($payment->getCcSsStartYear(), -2, 2));
         $api->setMaestroSoloIssueDate($this->_getFormattedCcExpirationDate($payment->getCcSsStartMonth(), $year));
     }
     if ($this->getIsCentinelValidationEnabled()) {
         $this->getCentinelValidator()->exportCmpiData($api);
     }
     // add shipping and billing addresses
     if ($order->getIsVirtual()) {
         $api->setAddress($order->getBillingAddress())->setSuppressShipping(true);
     } else {
         $api->setAddress($order->getShippingAddress());
         $api->setBillingAddress($order->getBillingAddress());
     }
     // add line items
     $cart = $this->_cartFactory->create(array('salesModel' => $order));
     $api->setPaypalCart($cart)->setIsLineItemsEnabled($this->_pro->getConfig()->getConfigValue('lineItemsEnabled'));
     // call api and import transaction and other payment information
     $api->callDoDirectPayment();
     $this->_importResultToPayment($api, $payment);
     try {
         $api->callGetTransactionDetails();
     } catch (\Magento\Framework\Model\Exception $e) {
         // if we receive errors, but DoDirectPayment response is Success, then set Pending status for transaction
         $payment->setIsTransactionPending(true);
     }
     $this->_importResultToPayment($api, $payment);
     return $this;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:40,代碼來源:Direct.php

示例2: getExpirationDate

 /**
  * @param Payment $payment
  * @return string
  */
 private function getExpirationDate(Payment $payment)
 {
     $expDate = new \DateTime($payment->getCcExpYear() . '-' . $payment->getCcExpMonth() . '-' . '01' . ' ' . '00:00:00', new \DateTimeZone('UTC'));
     $expDate->add(new \DateInterval('P1M'));
     return $expDate->format('Y-m-d 00:00:00');
 }
開發者ID:rafaelstz,項目名稱:magento2,代碼行數:10,代碼來源:Transparent.php

示例3: getCcExpMonth

 /**
  * {@inheritdoc}
  */
 public function getCcExpMonth()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCcExpMonth');
     if (!$pluginInfo) {
         return parent::getCcExpMonth();
     } else {
         return $this->___callPlugins('getCcExpMonth', func_get_args(), $pluginInfo);
     }
 }
開發者ID:CSYE6225,項目名稱:UnixSysProgramming,代碼行數:12,代碼來源:Interceptor.php


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