
Public Member Functions | |
| canEdit () | |
| isAvailable ($quote=null) | |
| getOrderPlaceRedirectUrl () | |
| authorize (Varien_Object $payment, $amount) | |
| capture (Varien_Object $payment, $amount) | |
| refund (Varien_Object $payment, $amount) | |
| void (Varien_Object $payment) | |
| cancel (Varien_Object $payment) | |
Public Attributes | |
| const | ACTION_AUTHORIZE = 0 |
| const | ACTION_AUTHORIZE_CAPTURE = 1 |
Protected Attributes | |
| $_code = 'googlecheckout' | |
| $_formBlockType = 'googlecheckout/form' | |
| $_isGateway = false | |
| $_canAuthorize = true | |
| $_canCapture = true | |
| $_canCapturePartial = true | |
| $_canRefund = true | |
| $_canRefundInvoicePartial = true | |
| $_canVoid = true | |
| $_canUseInternal = false | |
| $_canUseCheckout = false | |
| $_canUseForMultishipping = false | |
Definition at line 27 of file Payment.php.
| authorize | ( | Varien_Object $ | payment, | |
| $ | amount | |||
| ) |
Authorize
| Varien_Object | $orderPayment |
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 86 of file Payment.php.
00087 { 00088 $api = Mage::getModel('googlecheckout/api')->setStoreId($payment->getOrder()->getStoreId()); 00089 $api->authorize($payment->getOrder()->getExtOrderId()); 00090 00091 return $this; 00092 }
| cancel | ( | Varien_Object $ | payment | ) |
Void payment
| Varien_Object | $invoicePayment |
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 163 of file Payment.php.
00164 { 00165 if (!$payment->getOrder()->getBeingCanceledFromGoogleApi()) { 00166 $hlp = Mage::helper('googlecheckout'); 00167 $reason = $this->getReason() ? $this->getReason() : $hlp->__('Unknown Reason'); 00168 $comment = $this->getComment() ? $this->getComment() : $hlp->__('No Comment'); 00169 00170 $api = Mage::getModel('googlecheckout/api')->setStoreId($payment->getOrder()->getStoreId()); 00171 $api->cancel($payment->getOrder()->getExtOrderId(), $reason, $comment); 00172 } 00173 00174 return $this; 00175 }
| canEdit | ( | ) |
Can be edit order (renew order)
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 54 of file Payment.php.
| capture | ( | Varien_Object $ | payment, | |
| $ | amount | |||
| ) |
Capture payment
| Varien_Object | $orderPayment |
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 100 of file Payment.php.
00101 { 00102 /* 00103 try { 00104 $this->authorize($payment, $amount); 00105 } catch (Exception $e) { 00106 // authorization is not expired yet 00107 } 00108 */ 00109 00110 if ($payment->getOrder()->getPaymentAuthorizationExpiration() < Mage::getModel('core/date')->gmtTimestamp()) { 00111 try { 00112 $this->authorize($payment, $amount); 00113 } catch (Exception $e) { 00114 // authorization is not expired yet 00115 } 00116 } 00117 00118 $api = Mage::getModel('googlecheckout/api')->setStoreId($payment->getOrder()->getStoreId()); 00119 $api->charge($payment->getOrder()->getExtOrderId(), $amount); 00120 $payment->setForcedState(Mage_Sales_Model_Order_Invoice::STATE_OPEN); 00121 00122 return $this; 00123 }
| getOrderPlaceRedirectUrl | ( | ) |
Return Order Place Redirect URL
Definition at line 75 of file Payment.php.
00076 { 00077 return Mage::getUrl('googlecheckout/redirect/redirect'); 00078 }
| isAvailable | ( | $ | quote = null |
) |
Return true if the method can be used at this time Use google/checkout/active flag of admin module config
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 65 of file Payment.php.
00066 { 00067 return Mage::getStoreConfig('google/checkout/active') > 0; 00068 }
| refund | ( | Varien_Object $ | payment, | |
| $ | amount | |||
| ) |
Refund money
| Varien_Object | $invoicePayment |
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 132 of file Payment.php.
00133 { 00134 $hlp = Mage::helper('googlecheckout'); 00135 00136 // foreach ($payment->getCreditMemo()->getCommentsCollection() as $comment) { 00137 // $this->setReason($hlp->__('See Comments')); 00138 // $this->setComment($comment->getComment()); 00139 // } 00140 00141 $reason = $this->getReason() ? $this->getReason() : $hlp->__('No Reason'); 00142 $comment = $this->getComment() ? $this->getComment() : $hlp->__('No Comment'); 00143 00144 $api = Mage::getModel('googlecheckout/api')->setStoreId($payment->getOrder()->getStoreId()); 00145 $api->refund($payment->getOrder()->getExtOrderId(), $amount, $reason, $comment); 00146 00147 return $this; 00148 }
| void | ( | Varien_Object $ | payment | ) |
Void payment
| Varien_Object | $invoicePayment |
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 150 of file Payment.php.
00151 { 00152 $this->cancel($payment); 00153 00154 return $this; 00155 }
$_canAuthorize = true [protected] |
$_canCapture = true [protected] |
$_canCapturePartial = true [protected] |
$_canRefund = true [protected] |
$_canRefundInvoicePartial = true [protected] |
$_canUseCheckout = false [protected] |
$_canUseForMultishipping = false [protected] |
$_canUseInternal = false [protected] |
$_canVoid = true [protected] |
$_code = 'googlecheckout' [protected] |
$_formBlockType = 'googlecheckout/form' [protected] |
$_isGateway = false [protected] |
Availability options
Reimplemented from Mage_Payment_Model_Method_Abstract.
Definition at line 38 of file Payment.php.
| const ACTION_AUTHORIZE = 0 |
| const ACTION_AUTHORIZE_CAPTURE = 1 |
1.5.8