├── CHANGELOG.md ├── README.md ├── app ├── .DS_Store ├── code │ └── community │ │ └── Esmart │ │ └── PayPalBrasil │ │ ├── Block │ │ ├── Adminhtml │ │ │ ├── Profilername.php │ │ │ ├── Sales │ │ │ │ ├── Creditmemo │ │ │ │ │ └── Totals.php │ │ │ │ ├── Invoice │ │ │ │ │ └── Totals.php │ │ │ │ └── Order │ │ │ │ │ └── Totals.php │ │ │ ├── System │ │ │ │ └── Config │ │ │ │ │ └── Form │ │ │ │ │ └── Field │ │ │ │ │ └── Merchant.php │ │ │ └── Totals │ │ │ │ └── Invoice │ │ │ │ └── Cost.php │ │ ├── Checkout │ │ │ └── Total.phtml │ │ ├── Express │ │ │ ├── Form.php │ │ │ ├── Review.php │ │ │ ├── Shortcut.php │ │ │ └── Shortcut │ │ │ │ ├── Incontext │ │ │ │ └── Js.php │ │ │ │ └── Login.php │ │ ├── Invoice │ │ │ └── Info.php │ │ ├── Logo.php │ │ ├── Payment │ │ │ └── Info.php │ │ ├── Plus │ │ │ ├── Form.php │ │ │ └── Info.php │ │ └── Sales │ │ │ ├── Invoice │ │ │ └── Cost.php │ │ │ └── Order │ │ │ └── Cost.php │ │ ├── Controller │ │ ├── Express.php │ │ └── Express │ │ │ ├── Incontext.php │ │ │ └── Login.php │ │ ├── Helper │ │ └── Data.php │ │ ├── Model │ │ ├── Adminhtml │ │ │ ├── CustomerAddressAttributes.php │ │ │ ├── CustomerAttributes.php │ │ │ ├── Logo.php │ │ │ ├── OscOptions.php │ │ │ └── System │ │ │ │ └── Config │ │ │ │ └── Backend │ │ │ │ └── Installments.php │ │ ├── Api │ │ │ └── Nvp.php │ │ ├── Cancel.php │ │ ├── Config.php │ │ ├── Cost.php │ │ ├── Debug.php │ │ ├── Express.php │ │ ├── Express │ │ │ └── Checkout.php │ │ ├── Info.php │ │ ├── Installments.php │ │ ├── Installments │ │ │ ├── Config.php │ │ │ ├── Cost.php │ │ │ ├── Costcreditmemo.php │ │ │ └── Costinvoice.php │ │ ├── Invoice.php │ │ ├── Ipn.php │ │ ├── Observer.php │ │ ├── Paypal.php │ │ ├── Paypal │ │ │ └── Validate.php │ │ ├── Plus.php │ │ ├── Plus │ │ │ ├── Iframe.php │ │ │ └── Paypal │ │ │ │ └── Autoload.php │ │ └── Transaction.php │ │ ├── controllers │ │ ├── AjaxController.php │ │ ├── ExpressController.php │ │ ├── IncontextController.php │ │ ├── IpnController.php │ │ ├── LoginController.php │ │ └── OnepageController.php │ │ ├── data │ │ └── esmart_paypalbrasil_setup │ │ │ └── data-upgrade-0.4.3.2-0.4.4.0.php │ │ ├── etc │ │ ├── adminhtml.xml │ │ ├── config.xml │ │ └── system.xml │ │ └── sql │ │ └── esmart_paypalbrasil_setup │ │ ├── install-0.1.0.0.php │ │ ├── upgrade-0.1.1.0-0.2.0.0.php │ │ ├── upgrade-0.4.9.0-0.5.0.0.php │ │ └── upgrade-0.5.9.0-0.6.0.0.php ├── design │ ├── .DS_Store │ ├── adminhtml │ │ └── default │ │ │ └── default │ │ │ ├── layout │ │ │ └── esmart │ │ │ │ ├── paypalbrasil.xml │ │ │ │ └── paypalinstantupdate.xml │ │ │ └── template │ │ │ └── esmart │ │ │ └── paypalbrasil │ │ │ ├── express │ │ │ └── info.phtml │ │ │ └── plus │ │ │ └── info.phtml │ └── frontend │ │ ├── .DS_Store │ │ └── base │ │ ├── .DS_Store │ │ └── default │ │ ├── .DS_Store │ │ ├── layout │ │ ├── .DS_Store │ │ └── esmart │ │ │ └── paypalbrasil.xml │ │ └── template │ │ └── esmart │ │ └── paypalbrasil │ │ ├── checkout │ │ ├── idecheckoutvm-rewrite.phtml │ │ ├── inovarti-form-rewrite.phtml │ │ ├── onepage.phtml │ │ └── onepage_amasty.phtml │ │ ├── express │ │ ├── coupon.phtml │ │ ├── mark.phtml │ │ ├── review.phtml │ │ ├── shortcut.phtml │ │ └── shortcut │ │ │ ├── agreements.phtml │ │ │ ├── loader.phtml │ │ │ └── login.phtml │ │ ├── footer_logo.phtml │ │ ├── js.phtml │ │ ├── onepage │ │ └── payment.phtml │ │ ├── order │ │ ├── cost.phtml │ │ └── cost_refunded.phtml │ │ ├── plus │ │ ├── form.phtml │ │ └── info.phtml │ │ ├── product_logo.phtml │ │ └── securepurchase.phtml ├── etc │ └── modules │ │ └── Esmart_PayPalBrasil.xml └── locale │ └── pt_BR │ └── Esmart_PayPalBrasil.csv ├── js └── esmart │ └── paypalbrasil │ ├── Esmart_PaypalBrasilPrototype.events.aheadworks.js │ ├── Esmart_PaypalBrasilPrototype.events.amasty.js │ ├── Esmart_PaypalBrasilPrototype.events.default.js │ ├── Esmart_PaypalBrasilPrototype.events.firecheckout.js │ ├── Esmart_PaypalBrasilPrototype.events.inovarti.js │ ├── Esmart_PaypalBrasilPrototype.events.moip.js │ ├── Esmart_PaypalBrasilPrototype.events.smartcheckout.js │ ├── Esmart_PaypalBrasilPrototype.events.vendamais.js │ ├── Esmart_PaypalBrasilPrototype.js │ ├── idecheckoutvm-rewrite.js │ ├── opcheckout-rewrite-js.js │ ├── opcheckout-rewrite.js │ ├── paypal-in-context-cart-product.js │ ├── paypal-in-context.js │ └── review.js ├── lib └── PayPal │ ├── Api │ ├── Address.php │ ├── Agreement.php │ ├── AgreementDetails.php │ ├── AgreementStateDescriptor.php │ ├── AgreementTransaction.php │ ├── AgreementTransactions.php │ ├── Amount.php │ ├── Authorization.php │ ├── BankAccount.php │ ├── BankAccountsList.php │ ├── BankToken.php │ ├── BaseAddress.php │ ├── BillingInfo.php │ ├── CancelNotification.php │ ├── Capture.php │ ├── CarrierAccountToken.php │ ├── CartBase.php │ ├── ChargeModel.php │ ├── Cost.php │ ├── CreateProfileResponse.php │ ├── Credit.php │ ├── CreditCard.php │ ├── CreditCardHistory.php │ ├── CreditCardList.php │ ├── CreditCardToken.php │ ├── Currency.php │ ├── CurrencyConversion.php │ ├── CustomAmount.php │ ├── Details.php │ ├── Error.php │ ├── ErrorDetails.php │ ├── ExtendedBankAccount.php │ ├── FlowConfig.php │ ├── FmfDetails.php │ ├── FundingDetail.php │ ├── FundingInstrument.php │ ├── FundingOption.php │ ├── FundingSource.php │ ├── FuturePayment.php │ ├── HyperSchema.php │ ├── Image.php │ ├── Incentive.php │ ├── InputFields.php │ ├── InstallmentInfo.php │ ├── InstallmentOption.php │ ├── Invoice.php │ ├── InvoiceAddress.php │ ├── InvoiceItem.php │ ├── InvoiceSearchResponse.php │ ├── Item.php │ ├── ItemList.php │ ├── Links.php │ ├── Measurement.php │ ├── MerchantInfo.php │ ├── MerchantPreferences.php │ ├── Metadata.php │ ├── NameValuePair.php │ ├── Notification.php │ ├── OpenIdAddress.php │ ├── OpenIdError.php │ ├── OpenIdSession.php │ ├── OpenIdTokeninfo.php │ ├── OpenIdUserinfo.php │ ├── Order.php │ ├── OverrideChargeModel.php │ ├── Patch.php │ ├── PatchRequest.php │ ├── Payee.php │ ├── Payer.php │ ├── PayerInfo.php │ ├── Payment.php │ ├── PaymentCard.php │ ├── PaymentCardToken.php │ ├── PaymentDefinition.php │ ├── PaymentDetail.php │ ├── PaymentExecution.php │ ├── PaymentHistory.php │ ├── PaymentInstruction.php │ ├── PaymentOptions.php │ ├── PaymentTerm.php │ ├── Payout.php │ ├── PayoutBatch.php │ ├── PayoutBatchHeader.php │ ├── PayoutItem.php │ ├── PayoutItemDetails.php │ ├── PayoutSenderBatchHeader.php │ ├── Phone.php │ ├── Plan.php │ ├── PlanList.php │ ├── Presentation.php │ ├── RecipientBankingInstruction.php │ ├── RedirectUrls.php │ ├── Refund.php │ ├── RefundDetail.php │ ├── RelatedResources.php │ ├── Sale.php │ ├── Search.php │ ├── ShippingAddress.php │ ├── ShippingCost.php │ ├── ShippingInfo.php │ ├── Tax.php │ ├── Terms.php │ ├── Transaction.php │ ├── TransactionBase.php │ ├── Transactions.php │ ├── WebProfile.php │ ├── Webhook.php │ ├── WebhookEvent.php │ ├── WebhookEventList.php │ ├── WebhookEventType.php │ ├── WebhookEventTypeList.php │ └── WebhookList.php │ ├── Auth │ └── OAuthTokenCredential.php │ ├── Cache │ └── AuthorizationCache.php │ ├── Common │ ├── ArrayUtil.php │ ├── PayPalModel.php │ ├── PayPalResourceModel.php │ ├── PayPalUserAgent.php │ └── ReflectionUtil.php │ ├── Converter │ └── FormatConverter.php │ ├── Core │ ├── PayPalConfigManager.php │ ├── PayPalConstants.php │ ├── PayPalCredentialManager.php │ ├── PayPalHttpConfig.php │ ├── PayPalHttpConnection.php │ ├── PayPalLoggingLevel.php │ ├── PayPalLoggingManager.php │ └── cacert.pem │ ├── Exception │ ├── PayPalConfigurationException.php │ ├── PayPalConnectionException.php │ ├── PayPalInvalidCredentialException.php │ └── PayPalMissingCredentialException.php │ ├── Handler │ ├── IPayPalHandler.php │ ├── OauthHandler.php │ └── RestHandler.php │ ├── Rest │ ├── ApiContext.php │ └── IResource.php │ ├── Security │ └── Cipher.php │ ├── Transport │ └── PayPalRestCall.php │ └── Validation │ ├── ArgumentValidator.php │ ├── JsonValidator.php │ ├── ModelAccessorValidator.php │ ├── NumericValidator.php │ └── UrlValidator.php ├── skin ├── .DS_Store ├── adminhtml │ └── default │ │ └── default │ │ └── esmart │ │ └── paypalbrasil │ │ ├── Esmart_PaypalBrasilPrototype.events.aheadworks.js │ │ ├── Esmart_PaypalBrasilPrototype.events.amasty.js │ │ ├── Esmart_PaypalBrasilPrototype.events.default.js │ │ ├── Esmart_PaypalBrasilPrototype.events.firecheckout.js │ │ ├── Esmart_PaypalBrasilPrototype.events.inovarti.js │ │ ├── Esmart_PaypalBrasilPrototype.events.smartcheckout.js │ │ ├── Esmart_PaypalBrasilPrototype.events.vendamais.js │ │ ├── Esmart_PaypalBrasilPrototype.js │ │ ├── css │ │ └── paypalbrasil.css │ │ ├── images │ │ ├── selo_pp.png │ │ ├── selo_pp_configs.png │ │ └── selo_ppplus.png │ │ ├── paypal-in-context-cart-product.js │ │ └── paypal-in-context.js └── frontend │ ├── .DS_Store │ └── base │ ├── .DS_Store │ └── default │ ├── .DS_Store │ └── esmart │ ├── .DS_Store │ └── paypalbrasil │ ├── .DS_Store │ ├── css │ ├── aw_onestepcheckout.css │ ├── inovarti_onestepcheckout.css │ ├── moip_onestepcheckout.css │ └── styles.css │ ├── image │ ├── loading.gif │ ├── login-paypal.png │ ├── logos │ │ ├── compra_express.png │ │ ├── paypal_nf_v01.png │ │ ├── selo_pp_parcelado10x_01.jpg │ │ ├── selo_pp_parcelado10x_02.jpg │ │ ├── selo_pp_parcelado11x_01.jpg │ │ ├── selo_pp_parcelado11x_02.jpg │ │ ├── selo_pp_parcelado12x_01.jpg │ │ ├── selo_pp_parcelado12x_02.jpg │ │ ├── selo_pp_parcelado2x_01.jpg │ │ ├── selo_pp_parcelado2x_02.jpg │ │ ├── selo_pp_parcelado3x_01.jpg │ │ ├── selo_pp_parcelado3x_02.jpg │ │ ├── selo_pp_parcelado4x_01.jpg │ │ ├── selo_pp_parcelado4x_02.jpg │ │ ├── selo_pp_parcelado5x_01.jpg │ │ ├── selo_pp_parcelado5x_02.jpg │ │ ├── selo_pp_parcelado6x_01.jpg │ │ ├── selo_pp_parcelado6x_02.jpg │ │ ├── selo_pp_parcelado7x_01.jpg │ │ ├── selo_pp_parcelado7x_02.jpg │ │ ├── selo_pp_parcelado8x_01.jpg │ │ ├── selo_pp_parcelado8x_02.jpg │ │ ├── selo_pp_parcelado9x_01.jpg │ │ ├── selo_pp_parcelado9x_02.jpg │ │ ├── selo_pp_rodape_01.jpg │ │ └── selo_pp_rodape_02.jpg │ └── paypal_rgb.png │ └── js │ └── inovarti-form-rewrite.js └── tutorial └── Credenciais_API.pdf /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | **1.0.5** 2 | + Correções de diversos bugs dos OSC's 3 | + Adição de uma trava para Cartões de Crédito que não permitem parcelamento quando utilizado o repasso de juros do PayPal Plus 4 | 5 | **1.0.4** 6 | + Adição de suporte para a última versão do OneStepCheckout da MOIP 7 | + Diversas otimizações e bugfixes: 8 | + Descontos indevidamente sendo aplicados no Checkout Transparente 9 | + Checkout Transparente não abrindo corretamente em alguns OneStepCheckout's 10 | + PayPal Checkout via Mini-Browser não abrindo corretamente em alguns OneStepCheckout's 11 | 12 | **1.0.3** 13 | + Adição de novas funcionalidades para o PayPal Plus: 14 | + Suporte ao Repasse de Juros ao consumidor final 15 | + Suporte melhor integrado ao pagamento à vista com desconto 16 | + Melhoria na comunicação dos detalhes da compra 17 | + Adição de compatibilidade com os seguintes módulos de OneStepCheckout para a funcionalidade de Repasse de Juros: 18 | + iPAGARE 1.8.0 19 | + Firecheckout 4.3.6 20 | + Aheadwoks 1.3.11 21 | + Amasty 3.2.6 22 | + Inovarti 6 23 | 24 | **1.0.2** 25 | + Diversas otimizações e mudanças para o PayPal Plus: 26 | + Otimização na validação de caracteres do cliente 27 | + Otimização na arquitetura com um ganho significativo em performance 28 | + Remoção de Querystring na importação da biblioteca do produto 29 | + Inclusão de nova compatibilidade para o OneStepCheckout do iPAGARE 30 | + Remoção da compatibilidade para o OneStepCheckout do MOIP 31 | + Para o Express Checkout, agora a ação de venda padrão é "Venda" ao invés de "Autorização" 32 | 33 | **1.0.1** 34 | + Atualização do SDK PayPal para suporte à TLS 1.2 35 | + Atualização do README 36 | 37 | **1.0.0** 38 | + Versão stable 1.0.0 39 | + README totalmente em português 40 | + Tutorial para geração de credenciais de API -------------------------------------------------------------------------------- /app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/app/.DS_Store -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Adminhtml/Profilername.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Esmart_PayPalBrasil_Block_Adminhtml_Profilername extends Mage_Adminhtml_Block_System_Config_Form_Field 23 | { 24 | /** 25 | * Set field readonly 26 | * 27 | * @param Varien_Data_Form_Element_Abstract $element 28 | * @return string 29 | */ 30 | protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) 31 | { 32 | $value = $element->getEscapedValue(); 33 | 34 | if (empty($value)) { 35 | $helper = $helper = Mage::helper('esmart_paypalbrasil'); 36 | $element->setValue($helper->getProfilerNameSuggestion()); 37 | } 38 | 39 | return $element->getElementHtml(); 40 | } 41 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Adminhtml/Sales/Creditmemo/Totals.php: -------------------------------------------------------------------------------- 1 | getSource(); 9 | 10 | if($order->getEsmartPaypalbrasilCostAmount() == 0){ 11 | return $this; 12 | } 13 | 14 | 15 | if(Mage::getModel('esmart_paypalbrasil/installments')->getStatusInstallments() == true) { 16 | $this->addTotalBefore(new Varien_Object(array( 17 | 'code' => 'paypal_plus', 18 | 'value' => $order->getEsmartPaypalbrasilCostAmount(), 19 | 'base_value'=> $order->getEsmartPaypalbrasilCostAmount(), 20 | 'label' => $this->helper('sales')->__(Mage::getModel('esmart_paypalbrasil/installments_config')->getCustomizeText()), 21 | ), array('grand_total', 'tax'))); 22 | } 23 | 24 | return $this; 25 | } 26 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Adminhtml/Sales/Invoice/Totals.php: -------------------------------------------------------------------------------- 1 | getSource(); 9 | 10 | if($order->getEsmartPaypalbrasilCostAmount() == 0){ 11 | return $this; 12 | } 13 | 14 | 15 | if(Mage::getModel('esmart_paypalbrasil/installments')->getStatusInstallments() == true) { 16 | $this->addTotalBefore(new Varien_Object(array( 17 | 'code' => 'paypal_plus', 18 | 'value' => $order->getEsmartPaypalbrasilCostAmount(), 19 | 'base_value'=> $order->getEsmartPaypalbrasilCostAmount(), 20 | 'label' => $this->helper('sales')->__(Mage::getModel('esmart_paypalbrasil/installments_config')->getCustomizeText()), 21 | ), array('grand_total', 'tax'))); 22 | } 23 | 24 | return $this; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Adminhtml/Sales/Order/Totals.php: -------------------------------------------------------------------------------- 1 | getOrder(); 13 | 14 | if($order->getEsmartPaypalbrasilCostAmount() == 0){ 15 | return $this; 16 | } 17 | 18 | 19 | if(Mage::getModel('esmart_paypalbrasil/installments')->getStatusInstallments() == true) { 20 | $this->addTotalBefore(new Varien_Object(array( 21 | 'code' => 'paypal_plus', 22 | 'value' => $order->getEsmartPaypalbrasilCostAmount(), 23 | 'base_value'=> $order->getEsmartPaypalbrasilCostAmount(), 24 | 'label' => $this->helper('sales')->__(Mage::getModel('esmart_paypalbrasil/installments_config')->getCustomizeText()), 25 | ), array('grand_total', 'tax'))); 26 | } 27 | 28 | return $this; 29 | } 30 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Adminhtml/System/Config/Form/Field/Merchant.php: -------------------------------------------------------------------------------- 1 | _getToken(); 10 | $element->setValue($value); 11 | try{ 12 | Mage::getModel('core/config')->saveConfig('payment/incontext/merchantid', $value); 13 | } catch (Exception $e) { 14 | Mage::logException($e); 15 | } 16 | 17 | return parent::_getElementHtml($element); 18 | } 19 | 20 | protected function _getToken(){ 21 | 22 | $payments = Mage::getSingleton('payment/config')->getActiveMethods(); 23 | 24 | foreach ($payments as $paymentCode=>$paymentModel) { 25 | 26 | $api = false; 27 | if ($paymentCode=='paypal_express'){ 28 | $api = Mage::getModel('esmart_paypalbrasil/paypal'); 29 | $this->_config = Mage::getModel('paypal/config', array(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS)); 30 | break; 31 | } 32 | } 33 | 34 | if ($api){ 35 | try{ 36 | $api->setConfigObject($this->_config); 37 | $api->callGetPalDetails(); 38 | $merchantId = $api->getPal(); 39 | return $merchantId; 40 | } catch (Exception $e) { 41 | Mage::logException($e); 42 | } 43 | return ''; 44 | } 45 | 46 | /* 47 | 48 | */ 49 | 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Adminhtml/Totals/Invoice/Cost.php: -------------------------------------------------------------------------------- 1 | getParentBlock(); 8 | $invoice = $totalsBlock->getInvoice(); 9 | 10 | $totalsBlock->addTotal(new Varien_Object(array( 11 | 'code' => 'rewardpoints', 12 | 'label' => $this->__('Custom Discount'), 13 | 'value' => -$invoice->getCustomDiscount(), 14 | )), 'subtotal'); 15 | } 16 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Checkout/Total.phtml: -------------------------------------------------------------------------------- 1 | getLocale(); 18 | $mark = Mage::getConfig()->getBlockClassName('core/template'); 19 | $mark = new $mark; 20 | $mark->setTemplate('esmart/paypalbrasil/express/mark.phtml') 21 | ->setPaymentAcceptanceMarkHref($this->_config->getPaymentMarkWhatIsPaypalUrl($locale)) 22 | ->setPaymentAcceptanceMarkSrc($this->_config->getPaymentMarkImageUrl($locale->getLocaleCode())) 23 | ; 24 | 25 | $this->setMethodLabelAfterHtml($mark->toHtml()); 26 | 27 | return $result; 28 | } 29 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Express/Shortcut.php: -------------------------------------------------------------------------------- 1 | getIdsButtons(); 10 | if (!is_array($list)){ 11 | $list= array(); 12 | } 13 | $id = $this->getShortcutHtmlId(); 14 | if (!empty($id)){ 15 | $list[] = $id; 16 | } 17 | $list = array_unique($list); 18 | Mage::getSingleton('core/session')->setIdsButtons($list); 19 | 20 | /* set # in href button */ 21 | if ($this->isActiveIncontext()) { 22 | $this->setCheckoutUrl('#'); 23 | } 24 | } 25 | 26 | public function isActiveIncontext() 27 | { 28 | return (bool)Mage::getStoreConfigFlag('payment/incontext/enable'); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Express/Shortcut/Incontext/Js.php: -------------------------------------------------------------------------------- 1 | setTemplate('esmart/paypalbrasil/js.phtml'); 6 | } 7 | 8 | public function getJsonConfig(){ 9 | $_secure = false; 10 | $sheme = Mage::app()->getRequest()->getScheme(); 11 | if ($sheme=='https'){ 12 | $_secure = true; 13 | } 14 | 15 | $merchantId = Mage::getStoreConfig('payment/incontext/merchantid'); 16 | $isActive = Mage::getStoreConfig('payment/incontext/enable'); 17 | 18 | $environment = 'production'; 19 | // get config of Express Checkout 20 | if (Mage::getStoreConfig('paypal/wpp/sandbox_flag')){ 21 | $environment = 'sandbox'; 22 | } 23 | if (empty($merchantId)){ 24 | $isActive = false; 25 | } 26 | 27 | $config = new Varien_Object(); 28 | $config->setData('isActive', $isActive); 29 | $config->setData('environment', $environment); 30 | $config->setData('merchantid', $merchantId); 31 | $config->setData('setExpressCheckout', $this->getUrl('paypalbrasil/incontext/start', array('_secure' => $_secure))); 32 | 33 | return Mage::helper('core')->jsonEncode($config); 34 | } 35 | 36 | public function getJButtonsIds(){ 37 | $buttonlist = Mage::getSingleton('core/session')->getIdsButtons(); 38 | Mage::getSingleton('core/session')->unsIdsButtons(); 39 | 40 | return Mage::helper('core')->jsonEncode($buttonlist); 41 | } 42 | 43 | public function isInContextActive() 44 | { 45 | return Mage::getStoreConfig('payment/incontext/enable'); 46 | } 47 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Logo.php: -------------------------------------------------------------------------------- 1 | _getConfig()->getPaymentMarkWhatIsPaypalUrl(Mage::app()->getLocale()); 19 | } 20 | 21 | /** 22 | * Getter for paypal config 23 | * 24 | * @return Mage_Paypal_Model_Config 25 | */ 26 | protected function _getConfig() 27 | { 28 | return Mage::getSingleton('paypal/config'); 29 | } 30 | 31 | /** 32 | * Disable block output if logo turned off 33 | * 34 | * @return string 35 | */ 36 | protected function _toHtml() 37 | { 38 | $type = $this->getLogoType(); // assigned in layout etc. 39 | $logoUrl = $this->_getConfig()->getAdditionalOptionsLogoUrl(Mage::app()->getLocale()->getLocaleCode(),$type); 40 | if (!$logoUrl) { 41 | return ''; 42 | } 43 | $country = Mage::getStoreConfig(Mage_Paypal_Helper_Data::MERCHANT_COUNTRY_CONFIG_PATH); 44 | if ($country == Mage_Paypal_Helper_Data::US_COUNTRY) { 45 | $this->setTemplate('paypal/partner/us_logo.phtml'); 46 | return parent::_toHtml(); 47 | } 48 | $this->setLogoImageUrl($logoUrl); 49 | return parent::_toHtml(); 50 | } 51 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Payment/Info.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2020 Imagination Media (http://imaginemage.com/) 6 | * @license https://opensource.org/licenses/OSL-3.0.php Open Software License 3.0 7 | */ 8 | class Esmart_PayPalBrasil_Block_Payment_Info extends Mage_PayPal_Block_Payment_Info 9 | { 10 | /** 11 | * Internal constructor, that is called from real constructor 12 | * 13 | */ 14 | protected function _construct() 15 | { 16 | parent::_construct(); 17 | $this->setTemplate('esmart/paypalbrasil/express/info.phtml'); 18 | } 19 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Plus/Info.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Esmart_PayPalBrasil_Block_Plus_Info extends Mage_Payment_Block_Info 23 | { 24 | /** 25 | * Internal constructor, that is called from real constructor 26 | * 27 | */ 28 | protected function _construct() 29 | { 30 | parent::_construct(); 31 | $this->setTemplate('esmart/paypalbrasil/plus/info.phtml'); 32 | } 33 | 34 | /** 35 | * Get card information 36 | * 37 | * @param array $data 38 | * 39 | * @return string 40 | */ 41 | public function getCardInformation(array $data) 42 | { 43 | $convertArray = array( 44 | '{parcela_qtde}' => $data['termQty'], 45 | '{parcela_valor}' => $data['termValue'], 46 | ); 47 | 48 | $content = Mage::getStoreConfig('payment/paypal_plus/checkout_payment_info'); 49 | 50 | foreach ($convertArray as $holder => $value) { 51 | $content = str_replace($holder, $value, $content); 52 | } 53 | 54 | return $content; 55 | } 56 | 57 | /** 58 | * 59 | * 60 | * @param Varien_Object|array $transport 61 | */ 62 | protected function _prepareSpecificInformation($transport = null) 63 | { 64 | if (null !== $this->_paymentSpecificInformation) { 65 | return $this->_paymentSpecificInformation; 66 | } 67 | $helper = Mage::helper('esmart_paypalbrasil'); 68 | 69 | $info = $this->getInfo(); 70 | $card = json_decode($info->getAdditionalInformation('paypal_plus_cards')); 71 | $transport = new Varien_Object( 72 | array($helper->__("Transaction ID") => $info->getLastTransId(), 73 | $helper->__("Installment") => $card->termQty, 74 | $helper->__("Installment Value") => $card->termValue, 75 | $helper->__("Total") => $card->total) 76 | ); 77 | $transport = parent::_prepareSpecificInformation($transport); 78 | 79 | return $transport; 80 | } 81 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Sales/Invoice/Cost.php: -------------------------------------------------------------------------------- 1 | getParentBlock()->getOrder(); 12 | } 13 | 14 | public function getSource() 15 | { 16 | return $this->getParentBlock()->getSource(); 17 | } 18 | 19 | /** 20 | * Initialize customer balance order total 21 | * 22 | * @return $this 23 | */ 24 | public function initTotals() 25 | { 26 | 27 | $total = new Varien_Object(array( 28 | 'code' => $this->getNameInLayout(), 29 | 'block_name' => $this->getNameInLayout(), 30 | 'area' => $this->getArea() 31 | )); 32 | $after = $this->getAfterTotal(); 33 | if (!$after) { 34 | $after = 'giftcards'; 35 | } 36 | $this->getParentBlock()->addTotal($total, $after); 37 | return $this; 38 | } 39 | 40 | public function getLabelProperties() 41 | { 42 | return $this->getParentBlock()->getLabelProperties(); 43 | } 44 | 45 | public function getValueProperties() 46 | { 47 | return $this->getParentBlock()->getValueProperties(); 48 | } 49 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Block/Sales/Order/Cost.php: -------------------------------------------------------------------------------- 1 | getParentBlock()->getOrder(); 13 | } 14 | 15 | public function getSource() 16 | { 17 | return $this->getParentBlock()->getSource(); 18 | } 19 | 20 | /** 21 | * Initialize customer balance order total 22 | * 23 | * @return $this 24 | */ 25 | public function initTotals() 26 | { 27 | 28 | $total = new Varien_Object(array( 29 | 'code' => $this->getNameInLayout(), 30 | 'block_name' => $this->getNameInLayout(), 31 | 'area' => $this->getArea() 32 | )); 33 | $after = $this->getAfterTotal(); 34 | if (!$after) { 35 | $after = 'giftcards'; 36 | } 37 | $this->getParentBlock()->addTotal($total, $after); 38 | return $this; 39 | } 40 | 41 | public function getLabelProperties() 42 | { 43 | return $this->getParentBlock()->getLabelProperties(); 44 | } 45 | 46 | public function getValueProperties() 47 | { 48 | return $this->getParentBlock()->getValueProperties(); 49 | } 50 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Adminhtml/Logo.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | 23 | class Esmart_PayPalBrasil_Model_Adminhtml_Logo extends Mage_Paypal_Model_System_Config_Source_Logo 24 | { 25 | /** 26 | * Return array with js of diferents checkout 27 | * 28 | * @return array 29 | */ 30 | public function toOptionArray() 31 | { 32 | $helper = Mage::helper('esmart_paypalbrasil'); 33 | 34 | return Mage::getModel('paypal/config')->getAdditionalOptionsLogoTypes(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Adminhtml/OscOptions.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Esmart_PayPalBrasil_Model_Adminhtml_OscOptions 23 | { 24 | /** 25 | * Return array with js of diferents checkout 26 | * 27 | * @return array 28 | */ 29 | public function toOptionArray() 30 | { 31 | $helper = Mage::helper('esmart_paypalbrasil'); 32 | 33 | return array( 34 | array('value'=> Esmart_PayPalBrasil_Helper_Data::JS_EVENTS_DEFAULT, 'label'=> $helper->__('Checkout_Default')), 35 | array('value'=> Esmart_PayPalBrasil_Helper_Data::JS_EVENTS_INOVARTI, 'label'=> $helper->__('Inovarti_Onestepcheckout')), 36 | array('value'=> Esmart_PayPalBrasil_Helper_Data::JS_EVENTS_FIRECHECKOUT, 'label'=> $helper->__('TM_FireCheckout')), 37 | array('value'=> Esmart_PayPalBrasil_Helper_Data::JS_EVENTS_AMASTY, 'label'=> $helper->__('Amasty_Scheckout')), 38 | array('value'=> Esmart_PayPalBrasil_Helper_Data::JS_EVENTS_AHEADWORKS, 'label'=> $helper->__('AW_OneStepCheckout')), 39 | array('value'=> Esmart_PayPalBrasil_Helper_Data::JS_EVENTS_VENDAMAIS, 'label'=> $helper->__('Ideasa_IdeCheckoutvm')), 40 | array('value'=> Esmart_PayPalBrasil_Helper_Data::JS_EVENTS_MOIP, 'label'=> $helper->__('MOIP')), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Adminhtml/System/Config/Backend/Installments.php: -------------------------------------------------------------------------------- 1 | getGroups(); 16 | 17 | if($groups['ppplus_attributes2']['fields']['installments']['value'] == 1) { 18 | 19 | if (!empty($groups['paypal_plus']['fields']['oscoptions']['value'])) { 20 | $checkoutType = $groups['paypal_plus']['fields']['oscoptions']['value']; 21 | $name = $this->getNameOSC($checkoutType); 22 | switch ($checkoutType) { 23 | case 'esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.default.js': 24 | case 'esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.inovarti.js': 25 | case 'esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.firecheckout.js': 26 | case 'esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.amasty.js': 27 | case 'esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.aheadworks.js'; 28 | case 'esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.vendamais.js'; 29 | case 'esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.moip.js'; 30 | break; 31 | default: 32 | $error = 'A funcionalidade de repasse de juros não funciona com módulo de checkout ' . $name . '.'; 33 | Mage::throwException($error); 34 | } 35 | } 36 | } 37 | parent::_beforeSave(); 38 | } 39 | 40 | protected function getNameOSC($value){ 41 | $value = explode('.',$value); 42 | $nameOSC = str_replace('','.',$value[2]); 43 | return ucwords($nameOSC); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Cost.php: -------------------------------------------------------------------------------- 1 | setCode('esmart_paypalbrasil_cost'); 10 | } 11 | 12 | /** 13 | * @param Mage_Sales_Model_Quote_Address $address 14 | * @return $this 15 | */ 16 | public function collect(Mage_Sales_Model_Quote_Address $address) 17 | { 18 | parent::collect($address); 19 | 20 | /** @var Mage_Sales_Model_Quote_Payment $payment */ 21 | $payment = $address->getQuote()->getPayment(); 22 | 23 | if ($address->getQuote()->getPayment()->getMethod() != 'paypal_plus') { 24 | return $this; 25 | } 26 | 27 | $items = $address->getAllItems(); 28 | if (!count($items)) { 29 | return $this; 30 | } 31 | 32 | 33 | $cost = $payment->getAdditionalInformation('paypal_plus_installments_cost'); 34 | 35 | if ($cost > 0) { 36 | 37 | $this->_setAmount($cost); 38 | $this->_setBaseAmount($cost); 39 | 40 | $address->setGrandTotal($address->getGrandTotal() + $cost); 41 | $address->setBaseGrandTotal($address->getGrandTotal()); 42 | 43 | } 44 | 45 | return $this; 46 | } 47 | 48 | /** 49 | * @param Mage_Sales_Model_Quote_Address $address 50 | * @return $this 51 | */ 52 | public function fetch(Mage_Sales_Model_Quote_Address $address) 53 | { 54 | //if ((Mage::getSingleton('checkout/session')->getCanCalculatePaypalCost() === true) && (Mage::getSingleton('checkout/session')->getPayPalPlusCost() != true)) { 55 | Mage::getSingleton('checkout/session')->setPayPalPlusCost(true); 56 | $payment = $address->getQuote()->getPayment(); 57 | $address->addTotal( 58 | [ 59 | 'code' => $this->getCode(), 60 | 'title' => Mage::helper('esmart_paypalbrasil')->__('Cost'), 61 | 'value' => $address->getEsmartPaypalbrasilCostAmount() 62 | ] 63 | ); 64 | $payment->save(); 65 | // } 66 | 67 | return $this; 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Express.php: -------------------------------------------------------------------------------- 1 | getOrder(); 19 | 20 | $lenharo = Mage::getStoreConfig('payment/moip_transparente_standard/validador_retorno'); 21 | 22 | //If exists paypal discount 1x 23 | if( empty($lenharo) && ($pp_express_discount = Mage::app()->getRequest()->getParam('pp_express_discount')) ){ 24 | $amount = $amount + $pp_express_discount; 25 | } 26 | 27 | // prepare api call 28 | $token = $payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_TOKEN); 29 | $api = $this->_pro->getApi() 30 | ->setToken($token) 31 | ->setPayerId($payment-> 32 | getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID)) 33 | ->setAmount($amount) 34 | ->setPaymentAction($this->_pro->getConfig()->paymentAction) 35 | ->setNotifyUrl(Mage::getUrl('paypal/ipn/')) 36 | ->setInvNum($order->getIncrementId()) 37 | ->setCurrencyCode($order->getBaseCurrencyCode()) 38 | ->setPaypalCart(Mage::getModel('paypal/cart', array($order))) 39 | ->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled); 40 | 41 | // call api and get details from it 42 | $api->callDoExpressCheckoutPayment(); 43 | 44 | $this->_importToPayment($api, $payment); 45 | return $this; 46 | } 47 | 48 | /** 49 | * Retrieve payment method title 50 | * 51 | * @return string 52 | */ 53 | public function getTitle() 54 | { 55 | return 'PayPal ' . $this->getConfigData('title'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Installments/Costcreditmemo.php: -------------------------------------------------------------------------------- 1 | getOrder(); 7 | if ($order->getEsmartPaypalbrasilCostAmount() > 0) { 8 | 9 | $creditmemo->setEsmartPaypalbrasilCostAmount($order->getEsmartPaypalbrasilCostAmount()); 10 | $creditmemo->setBaseEsmartPaypalbrasilCostAmount($order->getBaseEsmartPaypalbrasilCostAmount()); 11 | 12 | $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $creditmemo->getEsmartPaypalbrasilCostAmount()); 13 | $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $creditmemo->getBaseEsmartPaypalbrasilCostAmount()); 14 | } 15 | 16 | if ($order->getEsmartPaypalbrasilDiscountAmount() != 0) { 17 | 18 | $creditmemo->setEsmartPaypalbrasilDiscountAmount($order->getEsmartPaypalbrasilDiscountAmount()); 19 | $creditmemo->setBaseEsmartPaypalbrasilDiscountAmount($order->getBaseEsmartPaypalbrasilDiscountAmount()); 20 | 21 | $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $creditmemo->getEsmartPaypalbrasilDiscountAmount()); 22 | $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $creditmemo->getBaseEsmartPaypalbrasilDiscountAmount()); 23 | } 24 | 25 | return $this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Installments/Costinvoice.php: -------------------------------------------------------------------------------- 1 | getOrder(); 7 | 8 | if ($order->getEsmartPaypalbrasilCostAmount() > 0) { 9 | 10 | $invoice->setEsmartPaypalbrasilCostAmount($order->getEsmartPaypalbrasilCostAmount()); 11 | $invoice->setBaseEsmartPaypalbrasilCostAmount($order->getBaseEsmartPaypalbrasilCostAmount()); 12 | 13 | $invoice->setGrandTotal($invoice->getGrandTotal() + $invoice->getEsmartPaypalbrasilCostAmount()); 14 | $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $invoice->getBaseEsmartPaypalbrasilCostAmount()); 15 | } 16 | 17 | if ($order->getEsmartPaypalbrasilDiscountAmount() != 0) { 18 | 19 | $invoice->setEsmartPaypalbrasilDiscountAmount($order->getEsmartPaypalbrasilDiscountAmount()); 20 | $invoice->setBaseEsmartPaypalbrasilDiscountAmount($order->getBaseEsmartPaypalbrasilDiscountAmount()); 21 | 22 | $invoice->setGrandTotal($invoice->getGrandTotal() + $invoice->getEsmartPaypalbrasilDiscountAmount()); 23 | $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $invoice->getBaseEsmartPaypalbrasilDiscountAmount()); 24 | } 25 | 26 | return $this; 27 | } 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Paypal.php: -------------------------------------------------------------------------------- 1 | call('getPalDetails', array()); 9 | $this->_importFromResponse($this->_getPalDetailsResponse, $response); 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Plus/Paypal/Autoload.php: -------------------------------------------------------------------------------- 1 | 21 | * @author Thiago H Oliveira 22 | * @author Rafael K Ventura 23 | */ 24 | class Esmart_PayPalBrasil_Model_Plus_Paypal_Autoload 25 | { 26 | 27 | private static $_instance; 28 | 29 | public static function instance() 30 | { 31 | if (!self::$_instance) { 32 | $class = __CLASS__; 33 | self::$_instance = new $class(); 34 | } 35 | return self::$_instance; 36 | } 37 | 38 | /* 39 | * static method to register classes; 40 | * unregister Varien to skip of Warnings 41 | * 42 | */ 43 | public static function register() 44 | { 45 | spl_autoload_unregister(array(Varien_Autoload::instance(), 'autoload')); 46 | spl_autoload_register(array(self::instance(), 'autoload'), true, true); 47 | } 48 | 49 | /** 50 | * Autoload method of lib 51 | * 52 | * @param string $className 53 | * 54 | * @return void 55 | */ 56 | public function autoload($className) 57 | { 58 | $className = ltrim($className, '\\'); 59 | $fileName = ''; 60 | $namespace = ''; 61 | if ($lastNsPos = strrpos($className, '\\')) { 62 | $namespace = substr($className, 0, $lastNsPos); 63 | $className = substr($className, $lastNsPos + 1); 64 | $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; 65 | } 66 | 67 | $dirs = explode(':', get_include_path()); 68 | 69 | foreach ($dirs as $dir) { 70 | $fullPathFile = $dir . DS . $fileName . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; 71 | 72 | if (file_exists($fullPathFile)) { 73 | require_once $fullPathFile; 74 | break; 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/Model/Transaction.php: -------------------------------------------------------------------------------- 1 | notify_url = $url; 16 | return $this; 17 | } 18 | 19 | /** 20 | * PayPal get Notify url store 21 | * 22 | * @return string 23 | */ 24 | public function getNotifyUrl() { 25 | return $this->notify_url; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/controllers/AjaxController.php: -------------------------------------------------------------------------------- 1 | getRequest()->getPost('payment', array()); 9 | if (!empty($data)) { 10 | // hack for AW_Points compatibility 11 | $session = Mage::getSingleton('checkout/session'); 12 | $data['use_points'] = $session->getData('use_points'); 13 | $data['points_amount'] = $session->getData('points_amount'); 14 | if( $data['method'] == null ){ 15 | $data['method'] = 'paypal_plus'; 16 | } 17 | $saveResult = $this->getOnepage()->savePayment($data); 18 | if (isset($saveResult['error'])) { 19 | throw new Exception($saveResult['message']); 20 | } 21 | $this->getOnepage()->getQuote()->collectTotals()->save(); 22 | } 23 | return $this; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/controllers/IncontextController.php: -------------------------------------------------------------------------------- 1 | setFlag('', 'no-dispatch', true); 32 | Mage::getSingleton('customer/session')->setBeforeAuthUrl($this->_getRefererUrl()); 33 | $this->getResponse()->setRedirect( 34 | Mage::helper('core/url')->addRequestParam( 35 | Mage::helper('customer')->getLoginUrl(), 36 | array('context' => 'checkout') 37 | ) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/controllers/IpnController.php: -------------------------------------------------------------------------------- 1 | getRequest()->isPost()) { 14 | return; 15 | } 16 | 17 | try { 18 | $data = $this->getRequest()->getPost(); 19 | Mage::getModel('paypal/ipn')->processIpnRequest($data, new Varien_Http_Adapter_Curl()); 20 | 21 | } catch (Mage_Paypal_UnavailableException $e) { 22 | Mage::logException($e); 23 | $this->getResponse()->setHeader('HTTP/1.1','503 Service Unavailable')->sendResponse(); 24 | exit; 25 | } catch (Exception $e) { 26 | Mage::logException($e); 27 | $this->getResponse()->setHttpResponseCode(500); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/controllers/LoginController.php: -------------------------------------------------------------------------------- 1 | getFullActionName()); 14 | 15 | $html = $this->_getPaymentMethodsHtml(); 16 | 17 | $this->getResponse()->clearHeaders()->setHeader('content-type', 'application/json', true); 18 | $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array( 19 | "html" => $html 20 | ))); 21 | } 22 | } -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/data/esmart_paypalbrasil_setup/data-upgrade-0.4.3.2-0.4.4.0.php: -------------------------------------------------------------------------------- 1 | 4 | * 5 | * @var Mage_Core_Model_Resource_Setup $this 6 | */ 7 | $installer = $this; 8 | 9 | $regions = array( 10 | array('BR', 'AC', 'Acre'), 11 | array('BR', 'AL', 'Alagoas'), 12 | array('BR', 'AP', 'Amapá'), 13 | array('BR', 'AM', 'Amazonas'), 14 | array('BR', 'BA', 'Bahia'), 15 | array('BR', 'CE', 'Ceará'), 16 | array('BR', 'DF', 'Distrito Federal'), 17 | array('BR', 'ES', 'Espírito Santo'), 18 | array('BR', 'GO', 'Goiás'), 19 | array('BR', 'MA', 'Maranhão'), 20 | array('BR', 'MT', 'Mato Grosso'), 21 | array('BR', 'MS', 'Mato Grosso do Sul'), 22 | array('BR', 'MG', 'Minas Gerais'), 23 | array('BR', 'PA', 'Pará'), 24 | array('BR', 'PB', 'Paraíba'), 25 | array('BR', 'PR', 'Paraná'), 26 | array('BR', 'PE', 'Pernambuco'), 27 | array('BR', 'PI', 'Piauí'), 28 | array('BR', 'RJ', 'Rio de Janeiro'), 29 | array('BR', 'RN', 'Rio Grande do Norte'), 30 | array('BR', 'RS', 'Rio Grande do Sul'), 31 | array('BR', 'RO', 'Rondônia'), 32 | array('BR', 'RR', 'Roraima'), 33 | array('BR', 'SC', 'Santa Catarina'), 34 | array('BR', 'SP', 'São Paulo'), 35 | array('BR', 'SE', 'Sergipe'), 36 | array('BR', 'TO', 'Tocantins'), 37 | ); 38 | 39 | foreach ($regions as $row) { 40 | $bind = array( 41 | 'country_id' => $row[0], 42 | 'code' => $row[1], 43 | 'default_name' => $row[2], 44 | ); 45 | 46 | /** @var Varien_Db_Select $select */ 47 | $select = $installer->getConnection() 48 | ->select() 49 | ->from($installer->getTable('directory/country_region'), 'region_id') 50 | ->where("country_id = '{$row[0]}' AND code = '{$row[1]}'"); 51 | 52 | $result = $installer->getConnection()->fetchOne($select); 53 | 54 | if (!empty($result)) { 55 | continue; 56 | } 57 | 58 | $installer->getConnection()->insert($installer->getTable('directory/country_region'), $bind); 59 | $regionId = $installer->getConnection()->lastInsertId($installer->getTable('directory/country_region')); 60 | 61 | $bind = array( 62 | 'locale' => 'pt_BR', 63 | 'region_id' => $regionId, 64 | 'name' => $row[2] 65 | ); 66 | 67 | $installer->getConnection()->insert($installer->getTable('directory/country_region_name'), $bind); 68 | } 69 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/etc/adminhtml.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 26 | 27 | PayPal Brasil 28 | 85 29 | 30 | 31 | Configure 32 | 10 33 | adminhtml/system_config/edit/section/payment 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | PayPal Express Checkout via Mini-Browser 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/sql/esmart_paypalbrasil_setup/install-0.1.0.0.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | 23 | $installer = $this; 24 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/sql/esmart_paypalbrasil_setup/upgrade-0.1.1.0-0.2.0.0.php: -------------------------------------------------------------------------------- 1 | startSetup(); 4 | 5 | $model = Mage::getResourceModel('customer/setup', 'customer_setup'); 6 | 7 | $model->addAttribute('customer', 'ppal_remembered_cards', array( 8 | 'label' => 'PayPal Remembered Cards', 9 | 'type' => 'varchar', 10 | 'input' => 'hidden', 11 | 'visible'=> false, 12 | 'required' => false 13 | )); 14 | 15 | $installer->endSetup(); -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/sql/esmart_paypalbrasil_setup/upgrade-0.4.9.0-0.5.0.0.php: -------------------------------------------------------------------------------- 1 | startSetup(); 5 | 6 | $options = array( 7 | 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, 8 | 'length' => '12,4', 9 | 'visible' => true, 10 | 'required' => false, 11 | 'comment' => 'Cost Installments', 12 | 'nullable' => false, 13 | 'default' => '0.0000' 14 | ); 15 | 16 | $connection = $installer->getConnection(); 17 | 18 | $sales_quote_address = $installer->getTable('sales/quote_address'); 19 | if ($connection->tableColumnExists($sales_quote_address,'esmart_paypalbrasil_cost_amount') === false ){ 20 | $connection->addColumn($sales_quote_address, 'esmart_paypalbrasil_cost_amount',$options); 21 | } 22 | if ($connection->tableColumnExists($sales_quote_address,'base_esmart_paypalbrasil_cost_amount') === false ){ 23 | $installer->getConnection()->addColumn($sales_quote_address, 'base_esmart_paypalbrasil_cost_amount',$options); 24 | } 25 | 26 | $sales_order = $installer->getTable('sales/order'); 27 | if ($connection->tableColumnExists($sales_order,'esmart_paypalbrasil_cost_amount') === false ) { 28 | $installer->getConnection()->addColumn($sales_order, 'esmart_paypalbrasil_cost_amount', $options); 29 | } 30 | if ($connection->tableColumnExists($sales_order,'base_esmart_paypalbrasil_cost_amount') === false ) { 31 | $installer->getConnection()->addColumn($sales_order, 'base_esmart_paypalbrasil_cost_amount', $options); 32 | } 33 | 34 | $sales_invoice = $installer->getTable('sales/invoice'); 35 | if ($connection->tableColumnExists($sales_invoice,'esmart_paypalbrasil_cost_amount') === false ) { 36 | $installer->getConnection()->addColumn($sales_invoice, 'esmart_paypalbrasil_cost_amount', $options); 37 | } 38 | if ($connection->tableColumnExists($sales_invoice,'base_esmart_paypalbrasil_cost_amount') === false ) { 39 | $installer->getConnection()->addColumn($sales_invoice, 'base_esmart_paypalbrasil_cost_amount', $options); 40 | } 41 | 42 | $sales_creditmemo = $installer->getTable('sales/creditmemo'); 43 | if ($connection->tableColumnExists($sales_creditmemo,'esmart_paypalbrasil_cost_amount') === false ) { 44 | $installer->getConnection()->addColumn($sales_creditmemo, 'esmart_paypalbrasil_cost_amount', $options); 45 | } 46 | if ($connection->tableColumnExists($sales_creditmemo,'base_esmart_paypalbrasil_cost_amount') === false ) { 47 | $installer->getConnection()->addColumn($sales_creditmemo, 'base_esmart_paypalbrasil_cost_amount', $options); 48 | } 49 | 50 | $installer->endSetup(); 51 | -------------------------------------------------------------------------------- /app/code/community/Esmart/PayPalBrasil/sql/esmart_paypalbrasil_setup/upgrade-0.5.9.0-0.6.0.0.php: -------------------------------------------------------------------------------- 1 | startSetup(); 5 | 6 | $options = array( 7 | 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, 8 | 'length' => '12,4', 9 | 'visible' => true, 10 | 'required' => false, 11 | 'comment' => 'Cost Installments', 12 | 'nullable' => false, 13 | 'default' => '0.0000' 14 | ); 15 | 16 | $connection = $installer->getConnection(); 17 | 18 | $sales_quote_address = $installer->getTable('sales/quote_address'); 19 | if ($connection->tableColumnExists($sales_quote_address,'esmart_paypalbrasil_discount_amount') === false ){ 20 | $connection->addColumn($sales_quote_address, 'esmart_paypalbrasil_discount_amount',$options); 21 | } 22 | if ($connection->tableColumnExists($sales_quote_address,'base_esmart_paypalbrasil_discount_amount') === false ){ 23 | $installer->getConnection()->addColumn($sales_quote_address, 'base_esmart_paypalbrasil_discount_amount',$options); 24 | } 25 | 26 | $sales_order = $installer->getTable('sales/order'); 27 | if ($connection->tableColumnExists($sales_order,'esmart_paypalbrasil_discount_amount') === false ) { 28 | $installer->getConnection()->addColumn($sales_order, 'esmart_paypalbrasil_discount_amount', $options); 29 | } 30 | if ($connection->tableColumnExists($sales_order,'base_esmart_paypalbrasil_discount_amount') === false ) { 31 | $installer->getConnection()->addColumn($sales_order, 'base_esmart_paypalbrasil_discount_amount', $options); 32 | } 33 | 34 | $sales_invoice = $installer->getTable('sales/invoice'); 35 | if ($connection->tableColumnExists($sales_invoice,'esmart_paypalbrasil_discount_amount') === false ) { 36 | $installer->getConnection()->addColumn($sales_invoice, 'esmart_paypalbrasil_discount_amount', $options); 37 | } 38 | if ($connection->tableColumnExists($sales_invoice,'base_esmart_paypalbrasil_discount_amount') === false ) { 39 | $installer->getConnection()->addColumn($sales_invoice, 'base_esmart_paypalbrasil_discount_amount', $options); 40 | } 41 | 42 | $sales_creditmemo = $installer->getTable('sales/creditmemo'); 43 | if ($connection->tableColumnExists($sales_creditmemo,'esmart_paypalbrasil_discount_amount') === false ) { 44 | $installer->getConnection()->addColumn($sales_creditmemo, 'esmart_paypalbrasil_discount_amount', $options); 45 | } 46 | if ($connection->tableColumnExists($sales_creditmemo,'base_esmart_paypalbrasil_discount_amount') === false ) { 47 | $installer->getConnection()->addColumn($sales_creditmemo, 'base_esmart_paypalbrasil_discount_amount', $options); 48 | } 49 | 50 | $installer->endSetup(); 51 | -------------------------------------------------------------------------------- /app/design/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/app/design/.DS_Store -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/layout/esmart/paypalinstantupdate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/esmart/paypalbrasil/express/info.phtml: -------------------------------------------------------------------------------- 1 | 6 |

7 | escapeHtml($this->getMethod()->getTitle()) ?> 8 |

9 | getInfo(); 11 | $state = $info->getAdditionalInformation('paypal_payment_status'); 12 | ?> 13 | 14 | getSpecificInformation()):?> 15 |

16 | ID do Pagador: 17 | getAdditionalInformation('paypal_payer_id'); ?> 18 |

19 |

20 | Email do Comprador: 21 | getAdditionalInformation('paypal_payer_email'); ?> 22 |

23 |

24 | Status da Transação : 25 | 26 | Pagamento Aprovado 27 | 28 | Pagamento não Aprovado 29 | 30 | Pagamento em Análise 31 | (Esta análise pode levar até 24hrs) 32 | 33 |

34 |

35 | Status do Endereço do Comprador: 36 | getAdditionalInformation('paypal_address_status'); ?> 37 |

38 |

39 | Merchant Protection Eligibility: 40 | getAdditionalInformation('paypal_protection_eligibility'); ?> 41 |

42 |

43 | Last Correlation ID: 44 | getAdditionalInformation('paypal_correlation_id'); ?> 45 |

46 | 47 | getAdditionalInformation('buyer_tax_id') ) : ?> 48 |

49 | CPF do Comprador: 50 | getAdditionalInformation('buyer_tax_id'); ?> 51 |

52 | 53 | 54 |

55 | Dados da Transação : 56 |

57 | getAdditionalInformation('plots_val') ) : ?> 58 | Cartão de crédito
59 | 60 | - Parcela(s): 61 | getAdditionalInformation('plots') . "x de " . $info->getAdditionalInformation('plots_val') ?>
62 |
63 |
64 | 65 |

Pagamento em: 1x (à vista)

66 | 67 | 68 | 69 | 70 | 71 | getChildHtml()?> 72 | -------------------------------------------------------------------------------- /app/design/frontend/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/app/design/frontend/.DS_Store -------------------------------------------------------------------------------- /app/design/frontend/base/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/app/design/frontend/base/.DS_Store -------------------------------------------------------------------------------- /app/design/frontend/base/default/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/app/design/frontend/base/default/.DS_Store -------------------------------------------------------------------------------- /app/design/frontend/base/default/layout/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/app/design/frontend/base/default/layout/.DS_Store -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/checkout/idecheckoutvm-rewrite.phtml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/checkout/inovarti-form-rewrite.phtml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/express/mark.phtml: -------------------------------------------------------------------------------- 1 | 27 | 33 | 34 | <?php echo Mage::helper('core')->quoteEscape(Mage::helper('paypal')->__('Acceptance Mark')) ?>  35 | 36 | getPaymentWhatIs()) {echo Mage::helper('paypal')->__($this->getPaymentWhatIs());} else {echo Mage::helper('paypal')->__('What is PayPal?');} ?> 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/express/shortcut/agreements.phtml: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | /** @var Mage_Core_Block_Template $this */ 23 | ?> 24 |
25 | 28 | 29 | 38 | 39 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/express/shortcut/loader.phtml: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | ?> 23 | 36 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/footer_logo.phtml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 14 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/js.phtml: -------------------------------------------------------------------------------- 1 | isInContextActive()): ?> 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/order/cost.phtml: -------------------------------------------------------------------------------- 1 | getOrder(); 3 | $_source = $this->getSource(); 4 | ?> 5 | getEsmartPaypalbrasilCostAmount() > 0): ?> 6 | 7 | getLabelProperties()?>> 8 | getTextCost(); ?> 9 | 10 | getValueProperties()?>>formatPrice($_source->getEsmartPaypalbrasilCostAmount()) ?> 11 | 12 | 13 | getEsmartPaypalbrasilDiscountAmount() != 0): ?> 14 | 15 | getLabelProperties()?>> 16 | getTextDiscount(); ?> 17 | 18 | getValueProperties()?>>formatPrice(-$_source->getEsmartPaypalbrasilDiscountAmount()) ?> 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/order/cost_refunded.phtml: -------------------------------------------------------------------------------- 1 | getOrder(); 3 | $_source = $this->getSource(); 4 | ?> 5 | getEsmartPaypalbrasilCostAmount() > 0): ?> 6 | 7 | getLabelProperties()?>> 8 | getTextCost(); ?> 9 | 10 | getValueProperties()?>>-formatPrice($_source->getEsmartPaypalbrasilCostAmount()) ?> 11 | 12 | 13 | getEsmartPaypalbrasilDiscountAmount() != 0): ?> 14 | 15 | getLabelProperties()?>> 16 | getTextDiscount(); ?> 17 | 18 | getValueProperties()?>>formatPrice(-$_source->getEsmartPaypalbrasilDiscountAmount()) ?> 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/plus/form.phtml: -------------------------------------------------------------------------------- 1 | 7 | getMethodCode(); 9 | $installmentActive = $this->paymentConfig(); 10 | ?> 11 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/plus/info.phtml: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | ?> 23 | getInfo(); 26 | ?> 27 |

28 | escapeHtml($this->getMethod()->getTitle()) ?> 29 |

30 |
31 |

32 | ID da Transação:getAdditionalInformation('paypal_plus_sale_id'); ?> 33 |

34 |
35 | getAdditionalInformation('paypal_plus_cards'), true); ?> 36 | 37 | 38 |

Cartão de crédito

39 | 40 | 41 | 42 | 43 | 44 |

Pagamento em: 1x (à vista)

45 | 46 | 47 | 48 | 49 | - Parcela(s): 50 |
51 | - Total: 52 |
53 |
54 | 55 | 56 | 57 | 58 |

59 | Dados da Transação : 60 |

61 | Cartão de crédito
62 |

Pagamento em: 1x (à vista)

63 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/product_logo.phtml: -------------------------------------------------------------------------------- 1 | 6 | 11 |
12 | <?php echo Mage::helper('core')->quoteEscape(Mage::helper('paypal')->__('Additional Options')) ?> 13 |
14 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/esmart/paypalbrasil/securepurchase.phtml: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | ?> 23 | 29 | 34 | -------------------------------------------------------------------------------- /app/etc/modules/Esmart_PayPalBrasil.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 26 | 27 | true 28 | community 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /js/esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.default.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Magento Custom by BSeller 3 | * 4 | * :) design/frontend/base/default/layout/esmart/paypalbrasil.xml 5 | * 6 | * AUX js/esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.js 7 | * 8 | * @package js 9 | */ 10 | $('p_method_paypal_plus').stopObserving('click'); 11 | // clean all radio buttons when Dom:load 12 | $('checkout-payment-method-load').select('input.radio').each(function(el){ el.checked = false}); 13 | 14 | // listen all click events and a condition to id element 15 | $('checkout-step-payment').on('click', 'input.radio', function(event, element) { 16 | if(event.target.id == 'p_method_paypal_plus') { 17 | 18 | try { 19 | // ask if already have a object.btnCheckout 20 | if (!EsmartPaypalBrasilBtnContinue.btnCheckout) { 21 | // button checkout 22 | var BtnCheckout = $('payment-buttons-container').select('button').first(); 23 | 24 | // set element on object and get a onclick method 25 | EsmartPaypalBrasilBtnContinue.setElement(BtnCheckout, true); 26 | 27 | // active addEventListeners 28 | EsmartPaypalBrasilPPPlus.init(); 29 | } 30 | 31 | if(EsmartPaypalBrasilPPPlus.iframe_loaded === null){ 32 | // generate a IFrame 33 | EsmartPaypalBrasilPPPlus.generateIframe(); 34 | } 35 | 36 | }catch(e) { 37 | var message = "Checkout Default com problema."; 38 | if( $('p_method_paypal_plus').checked){ $('p_method_paypal_plus').checked = false }; 39 | console.log(message); 40 | alert(message); 41 | } 42 | }else{ 43 | EsmartPaypalBrasilPPPlus.iframe_loaded = null; 44 | if(obj.installments == true) { 45 | $('paypal_plus_instalments').setValue(0); 46 | $('paypal_plus_iframe').setValue(''); 47 | } 48 | } 49 | }); 50 | 51 | // clean a iframe and inputs.radio of payments 52 | $$("div.step-title").each( function(el) { 53 | el.observe('click', function(){ 54 | $('checkout-step-payment').select('input.radio').each(function(el){ el.checked = false}); 55 | $$("ul#payment_form_paypal_plus")[0].hide(); 56 | $('paypal_plus_iframe').update('').removeAttribute('style'); 57 | 58 | }) 59 | }); 60 | -------------------------------------------------------------------------------- /js/esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.events.smartcheckout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Magento Custom by BSeller 3 | * 4 | * :) design/frontend/base/default/layout/esmart/paypalbrasil.xml 5 | * 6 | * AUX js/esmart/paypalbrasil/Esmart_PaypalBrasilPrototype.js 7 | * 8 | * @package js 9 | */ 10 | //document.observe("dom:loaded", function() { 11 | // necessary to smartcheckout crazy updates :/ clean all observing of radio button paypal 12 | $('p_method_paypal_plus').stopObserving('click'); 13 | $('checkout-payment-method-load').stopObserving('change'); 14 | 15 | // clean paypal radio buttons when Dom:load 16 | if( $('p_method_paypal_plus').checked){ $('p_method_paypal_plus').checked = false }; 17 | 18 | // listen all click events and a condition to id element 19 | $('checkout-payment-method-load').on('click', 'input.radio', function(event, element) { 20 | if(event.target.id == 'p_method_paypal_plus') { 21 | 22 | try { 23 | 24 | // ask if already have a object.btnCheckout 25 | if (!EsmartPaypalBrasilBtnContinue.btnCheckout) { 26 | // button checkout 27 | var BtnSmartCheckout = $('review-buttons-container').select('button').first(); 28 | 29 | // has a observing in this button that call before onclick :/ 30 | BtnSmartCheckout.stopObserving('click'); 31 | 32 | // set element on object and get a onclick method 33 | EsmartPaypalBrasilBtnContinue.setElement(BtnSmartCheckout, false); 34 | 35 | // active addEventListeners 36 | EsmartPaypalBrasilPPPlus.init(); 37 | } 38 | 39 | // generate a IFrame 40 | EsmartPaypalBrasilPPPlus.generateIframe(); 41 | 42 | }catch(e) { 43 | var message = "Checkout SmartCheckout com problema."; 44 | if( $('p_method_paypal_plus').checked){ $('p_method_paypal_plus').checked = false }; 45 | console.log(message); 46 | alert(message); 47 | } 48 | } 49 | }); 50 | //}); -------------------------------------------------------------------------------- /js/esmart/paypalbrasil/idecheckoutvm-rewrite.js: -------------------------------------------------------------------------------- 1 | // Override nextStep method 2 | IdeCheckoutvm.prototype.nextStep = function(transport) { 3 | console.log(transport); 4 | var response = null; 5 | if (transport && transport.responseText) { 6 | try { 7 | response = eval("(" + transport.responseText + ")") 8 | } catch (e) { 9 | response = {} 10 | } 11 | } 12 | if (response.redirectUrl) { 13 | this._beforeRedirectClient(); 14 | this.isSuccess = true; 15 | 16 | if (response.redirectUrl.match('/paypal/express/')) { 17 | 18 | let urlConnect = response.redirectUrl; 19 | 20 | paypal.checkout.initXO(); 21 | 22 | new Ajax.Request(urlConnect,{ 23 | method: 'get', 24 | async: true, 25 | crossDomain: false, 26 | onSuccess: function (token) { 27 | let url = token.request.url; 28 | paypal.checkout.startFlow(url); 29 | }, 30 | onFailure: function (responseData, textStatus, errorThrown) { 31 | alert("Error in ajax post"+responseData.statusText); 32 | //Gracefully Close the minibrowser in case of AJAX errors 33 | paypal.checkout.closeFlow(); 34 | } 35 | }); 36 | }else { 37 | document.location.href = response.redirectUrl; 38 | } 39 | } 40 | if (response.error) { 41 | this.buttonCheckoutvm.enable(); 42 | if (response.errorMessage.message) { 43 | this._showErrorMessage(response.errorMessage.message) 44 | } else { 45 | this._clearMessage() 46 | } 47 | if (response.errorMessage.errorFields) { 48 | var ideCheckoutValidationInst = new IdeCheckoutvmValidation(this.form); 49 | ideCheckoutValidationInst.fillFormErrors(response.errorMessage.errorFields) 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /js/esmart/paypalbrasil/opcheckout-rewrite-js.js: -------------------------------------------------------------------------------- 1 | Checkout.prototype._onSectionClick 2 | = Checkout.prototype._onSectionClick.wrap(function(parentMethod) { 3 | var section = $(Event.element(event).up('.section')); 4 | if (section.hasClassName('allow')) { 5 | if(section.readAttribute('id') == 'opc-payment'){ 6 | console.log("READY"); 7 | new Ajax.Request('/paypalbrasil/onepage/updateDropdown/', { 8 | method: 'post', 9 | async: false, 10 | onSuccess: function (response) { 11 | $("checkout-payment-method-load").remove(); 12 | $("co-payment-form").insert("
"); 13 | $("checkout-payment-method-load").insert(response.responseJSON.html); 14 | } 15 | }); 16 | } 17 | Event.stop(event); 18 | this.gotoSection(section.readAttribute('id').replace('opc-', ''), false); 19 | return false; 20 | } 21 | }); -------------------------------------------------------------------------------- /js/esmart/paypalbrasil/opcheckout-rewrite.js: -------------------------------------------------------------------------------- 1 | Payment.prototype.save 2 | = Payment.prototype.save.wrap(function(parentMethod){ 3 | if (checkout.loadWaiting!=false) return; 4 | var validator = new Validation(this.form); 5 | if (this.validate() && validator.validate()) { 6 | checkout.setLoadWaiting('payment'); 7 | let b = this.saveUrl; 8 | let met = this.currentMethod; 9 | if(met === "paypal_express") { 10 | let urlConnect = "/paypal/express/start/"; 11 | 12 | paypal.checkout.initXO(); 13 | 14 | new Ajax.Request(urlConnect,{ 15 | method: 'get', 16 | async: true, 17 | crossDomain: false, 18 | 19 | onSuccess: function (token) { 20 | let url = token.request.url; 21 | paypal.checkout.startFlow(url); 22 | }, 23 | onFailure: function (responseData, textStatus, errorThrown) { 24 | alert("Error in ajax post"+responseData.statusText); 25 | //Gracefully Close the minibrowser in case of AJAX errors 26 | paypal.checkout.closeFlow(); 27 | } 28 | }); 29 | } else { 30 | new Ajax.Request( 31 | this.saveUrl, 32 | { 33 | method: 'post', 34 | onComplete: this.onComplete, 35 | onSuccess: this.onSave, 36 | onFailure: checkout.ajaxFailure.bind(checkout), 37 | parameters: Form.serialize(this.form) 38 | } 39 | ); 40 | } 41 | } 42 | }); -------------------------------------------------------------------------------- /js/esmart/paypalbrasil/paypal-in-context-cart-product.js: -------------------------------------------------------------------------------- 1 | document.observe("dom:loaded", function() { 2 | 3 | if (typeof window.paypalCheckoutReady === "undefined"){ 4 | 5 | window.paypalCheckoutReady = function() { 6 | 7 | if (typeof PayPalLightboxConfig == "undefined"){ 8 | return; 9 | } 10 | if(typeof PayPalLightboxConfig != "object"){ 11 | PayPalLightboxConfig = JSON.parse(PayPalLightboxConfig); 12 | } 13 | if (PayPalLightboxConfig.isActive==0){ 14 | return; 15 | } 16 | 17 | paypal.checkout.setup(PayPalLightboxConfig.merchantid, { 18 | environment: PayPalLightboxConfig.environment, 19 | button: IDS, 20 | click: function (e) { 21 | e.preventDefault(); 22 | 23 | /* to incontext Works on PDP, needs a product on cart */ 24 | if ($('product_addtocart_form')) { 25 | var validator = new Validation($('product_addtocart_form')); 26 | if(e.currentTarget.className == "paypal-button") { 27 | callShortcutPopup(); 28 | } else { 29 | if ((validator && validator.validate())) { 30 | var data = $('product_addtocart_form').serialize(); 31 | data += '&isAjax=1'; 32 | var urlAddToCart = $('product_addtocart_form').action; 33 | 34 | new Ajax.Request(urlAddToCart, { 35 | method: 'POST', 36 | async: false, 37 | parameters: data, 38 | onSuccess: function (response) { 39 | console.log("CALL PAYPAL EXPRESS"); 40 | callShortcutPopup(); 41 | } 42 | }); 43 | } 44 | } 45 | }else{ //I'm on Cart, not Product Page 46 | callShortcutPopup(); 47 | } 48 | 49 | function callShortcutPopup() { 50 | 51 | var urlConnect = PayPalLightboxConfig.setExpressCheckout 52 | 53 | paypal.checkout.initXO(); 54 | 55 | new Ajax.Request(urlConnect,{ 56 | method: 'get', 57 | async: true, 58 | crossDomain: false, 59 | 60 | onSuccess: function (token) { 61 | 62 | if (token.responseText.indexOf('cart') != -1 || token.responseText.indexOf('login')!= -1){ 63 | paypal.checkout.closeFlow(); 64 | setLocation(token.responseText); 65 | 66 | }else{ 67 | var url = paypal.checkout.urlPrefix + token.responseText; 68 | paypal.checkout.startFlow(url); 69 | } 70 | 71 | }, 72 | onFailure: function (responseData, textStatus, errorThrown) { 73 | alert("Error in ajax post"+responseData.statusText); 74 | //Gracefully Close the minibrowser in case of AJAX errors 75 | paypal.checkout.closeFlow(); 76 | } 77 | }); 78 | } 79 | 80 | } 81 | }); 82 | }; 83 | } 84 | }); -------------------------------------------------------------------------------- /lib/PayPal/Api/Address.php: -------------------------------------------------------------------------------- 1 | phone = $phone; 28 | return $this; 29 | } 30 | 31 | /** 32 | * Phone number in E.123 format. 33 | * 34 | * @return string 35 | */ 36 | public function getPhone() 37 | { 38 | return $this->phone; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lib/PayPal/Api/AgreementStateDescriptor.php: -------------------------------------------------------------------------------- 1 | note = $note; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Reason for changing the state of the agreement. 34 | * 35 | * @return string 36 | */ 37 | public function getNote() 38 | { 39 | return $this->note; 40 | } 41 | 42 | /** 43 | * The amount and currency of the agreement. 44 | * 45 | * @param \PayPal\Api\Currency $amount 46 | * 47 | * @return $this 48 | */ 49 | public function setAmount($amount) 50 | { 51 | $this->amount = $amount; 52 | return $this; 53 | } 54 | 55 | /** 56 | * The amount and currency of the agreement. 57 | * 58 | * @return \PayPal\Api\Currency 59 | */ 60 | public function getAmount() 61 | { 62 | return $this->amount; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/AgreementTransactions.php: -------------------------------------------------------------------------------- 1 | agreement_transaction_list = $agreement_transaction_list; 28 | return $this; 29 | } 30 | 31 | /** 32 | * Array of agreement_transaction object. 33 | * 34 | * @return \PayPal\Api\AgreementTransaction[] 35 | */ 36 | public function getAgreementTransactionList() 37 | { 38 | return $this->agreement_transaction_list; 39 | } 40 | 41 | /** 42 | * Append AgreementTransactionList to the list. 43 | * 44 | * @param \PayPal\Api\AgreementTransaction $agreementTransaction 45 | * @return $this 46 | */ 47 | public function addAgreementTransactionList($agreementTransaction) 48 | { 49 | if (!$this->getAgreementTransactionList()) { 50 | return $this->setAgreementTransactionList(array($agreementTransaction)); 51 | } else { 52 | return $this->setAgreementTransactionList( 53 | array_merge($this->getAgreementTransactionList(), array($agreementTransaction)) 54 | ); 55 | } 56 | } 57 | 58 | /** 59 | * Remove AgreementTransactionList from the list. 60 | * 61 | * @param \PayPal\Api\AgreementTransaction $agreementTransaction 62 | * @return $this 63 | */ 64 | public function removeAgreementTransactionList($agreementTransaction) 65 | { 66 | return $this->setAgreementTransactionList( 67 | array_diff($this->getAgreementTransactionList(), array($agreementTransaction)) 68 | ); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Amount.php: -------------------------------------------------------------------------------- 1 | currency = $currency; 32 | return $this; 33 | } 34 | 35 | /** 36 | * 3 letter currency code 37 | * 38 | * @return string 39 | */ 40 | public function getCurrency() 41 | { 42 | return $this->currency; 43 | } 44 | 45 | /** 46 | * Total amount charged as part of this payment. 47 | * 48 | * 49 | * @param string|double $total 50 | * 51 | * @return $this 52 | */ 53 | public function setTotal($total) 54 | { 55 | NumericValidator::validate($total, "Total"); 56 | $total = FormatConverter::formatToPrice($total, $this->getCurrency()); 57 | $this->total = $total; 58 | return $this; 59 | } 60 | 61 | /** 62 | * Total amount charged as part of this payment. 63 | * 64 | * @return string 65 | */ 66 | public function getTotal() 67 | { 68 | return $this->total; 69 | } 70 | 71 | /** 72 | * Additional details of the payment amount. 73 | * 74 | * @param \PayPal\Api\Details $details 75 | * 76 | * @return $this 77 | */ 78 | public function setDetails($details) 79 | { 80 | $this->details = $details; 81 | return $this; 82 | } 83 | 84 | /** 85 | * Additional details of the payment amount. 86 | * 87 | * @return \PayPal\Api\Details 88 | */ 89 | public function getDetails() 90 | { 91 | return $this->details; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /lib/PayPal/Api/BankToken.php: -------------------------------------------------------------------------------- 1 | bank_id = $bank_id; 30 | return $this; 31 | } 32 | 33 | /** 34 | * ID of a previously saved Bank resource using /vault/bank API. 35 | * 36 | * @return string 37 | */ 38 | public function getBankId() 39 | { 40 | return $this->bank_id; 41 | } 42 | 43 | /** 44 | * The unique identifier of the payer used when saving this bank using /vault/bank API. 45 | * 46 | * @param string $external_customer_id 47 | * 48 | * @return $this 49 | */ 50 | public function setExternalCustomerId($external_customer_id) 51 | { 52 | $this->external_customer_id = $external_customer_id; 53 | return $this; 54 | } 55 | 56 | /** 57 | * The unique identifier of the payer used when saving this bank using /vault/bank API. 58 | * 59 | * @return string 60 | */ 61 | public function getExternalCustomerId() 62 | { 63 | return $this->external_customer_id; 64 | } 65 | 66 | /** 67 | * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). 68 | * 69 | * @param string $mandate_reference_number 70 | * 71 | * @return $this 72 | */ 73 | public function setMandateReferenceNumber($mandate_reference_number) 74 | { 75 | $this->mandate_reference_number = $mandate_reference_number; 76 | return $this; 77 | } 78 | 79 | /** 80 | * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). 81 | * 82 | * @return string 83 | */ 84 | public function getMandateReferenceNumber() 85 | { 86 | return $this->mandate_reference_number; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /lib/PayPal/Api/CancelNotification.php: -------------------------------------------------------------------------------- 1 | subject = $subject; 31 | return $this; 32 | } 33 | 34 | /** 35 | * Subject of the notification. 36 | * 37 | * @return string 38 | */ 39 | public function getSubject() 40 | { 41 | return $this->subject; 42 | } 43 | 44 | /** 45 | * Note to the payer. 46 | * 47 | * @param string $note 48 | * 49 | * @return $this 50 | */ 51 | public function setNote($note) 52 | { 53 | $this->note = $note; 54 | return $this; 55 | } 56 | 57 | /** 58 | * Note to the payer. 59 | * 60 | * @return string 61 | */ 62 | public function getNote() 63 | { 64 | return $this->note; 65 | } 66 | 67 | /** 68 | * A flag indicating whether a copy of the email has to be sent to the merchant. 69 | * 70 | * @param bool $send_to_merchant 71 | * 72 | * @return $this 73 | */ 74 | public function setSendToMerchant($send_to_merchant) 75 | { 76 | $this->send_to_merchant = $send_to_merchant; 77 | return $this; 78 | } 79 | 80 | /** 81 | * A flag indicating whether a copy of the email has to be sent to the merchant. 82 | * 83 | * @return bool 84 | */ 85 | public function getSendToMerchant() 86 | { 87 | return $this->send_to_merchant; 88 | } 89 | 90 | /** 91 | * A flag indicating whether a copy of the email has to be sent to the payer. 92 | * 93 | * @param bool $send_to_payer 94 | * 95 | * @return $this 96 | */ 97 | public function setSendToPayer($send_to_payer) 98 | { 99 | $this->send_to_payer = $send_to_payer; 100 | return $this; 101 | } 102 | 103 | /** 104 | * A flag indicating whether a copy of the email has to be sent to the payer. 105 | * 106 | * @return bool 107 | */ 108 | public function getSendToPayer() 109 | { 110 | return $this->send_to_payer; 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /lib/PayPal/Api/CarrierAccountToken.php: -------------------------------------------------------------------------------- 1 | carrier_account_id = $carrier_account_id; 29 | return $this; 30 | } 31 | 32 | /** 33 | * ID of a previously saved carrier account resource. 34 | * 35 | * @return string 36 | */ 37 | public function getCarrierAccountId() 38 | { 39 | return $this->carrier_account_id; 40 | } 41 | 42 | /** 43 | * ID of a previously saved carrier account resource. 44 | * 45 | * 46 | * @param string $external_customer_id 47 | * @return $this 48 | */ 49 | public function setExternalCustomerId($external_customer_id) 50 | { 51 | $this->external_customer_id = $external_customer_id; 52 | return $this; 53 | } 54 | 55 | /** 56 | * The unique identifier of the payer used when saving this carrier account instrument. 57 | * 58 | * @return string 59 | */ 60 | public function getExternalCustomerId() 61 | { 62 | return $this->external_customer_id; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/ChargeModel.php: -------------------------------------------------------------------------------- 1 | id = $id; 30 | return $this; 31 | } 32 | 33 | /** 34 | * Identifier of the charge model. 128 characters max. 35 | * 36 | * @return string 37 | */ 38 | public function getId() 39 | { 40 | return $this->id; 41 | } 42 | 43 | /** 44 | * Type of charge model. Allowed values: `SHIPPING`, `TAX`. 45 | * 46 | * @param string $type 47 | * 48 | * @return $this 49 | */ 50 | public function setType($type) 51 | { 52 | $this->type = $type; 53 | return $this; 54 | } 55 | 56 | /** 57 | * Type of charge model. Allowed values: `SHIPPING`, `TAX`. 58 | * 59 | * @return string 60 | */ 61 | public function getType() 62 | { 63 | return $this->type; 64 | } 65 | 66 | /** 67 | * Specific amount for this charge model. 68 | * 69 | * @param \PayPal\Api\Currency $amount 70 | * 71 | * @return $this 72 | */ 73 | public function setAmount($amount) 74 | { 75 | $this->amount = $amount; 76 | return $this; 77 | } 78 | 79 | /** 80 | * Specific amount for this charge model. 81 | * 82 | * @return \PayPal\Api\Currency 83 | */ 84 | public function getAmount() 85 | { 86 | return $this->amount; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Cost.php: -------------------------------------------------------------------------------- 1 | percent = $percent; 33 | return $this; 34 | } 35 | 36 | /** 37 | * Cost in percent. Range of 0 to 100. 38 | * 39 | * @return string 40 | */ 41 | public function getPercent() 42 | { 43 | return $this->percent; 44 | } 45 | 46 | /** 47 | * Cost in amount. Range of 0 to 999999.99. 48 | * 49 | * @param \PayPal\Api\Currency $amount 50 | * 51 | * @return $this 52 | */ 53 | public function setAmount($amount) 54 | { 55 | $this->amount = $amount; 56 | return $this; 57 | } 58 | 59 | /** 60 | * Cost in amount. Range of 0 to 999999.99. 61 | * 62 | * @return \PayPal\Api\Currency 63 | */ 64 | public function getAmount() 65 | { 66 | return $this->amount; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /lib/PayPal/Api/CreateProfileResponse.php: -------------------------------------------------------------------------------- 1 | id = $id; 29 | return $this; 30 | } 31 | 32 | /** 33 | * ID of the payment web experience profile. 34 | * 35 | * @return string 36 | */ 37 | public function getId() 38 | { 39 | return $this->id; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Credit.php: -------------------------------------------------------------------------------- 1 | id = $id; 30 | return $this; 31 | } 32 | 33 | /** 34 | * Unique identifier of credit resource. 35 | * 36 | * @return string 37 | */ 38 | public function getId() 39 | { 40 | return $this->id; 41 | } 42 | 43 | /** 44 | * Specifies the type of credit. 45 | * Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"] 46 | * 47 | * @param string $type 48 | * 49 | * @return $this 50 | */ 51 | public function setType($type) 52 | { 53 | $this->type = $type; 54 | return $this; 55 | } 56 | 57 | /** 58 | * Specifies the type of credit 59 | * 60 | * @return string 61 | */ 62 | public function getType() 63 | { 64 | return $this->type; 65 | } 66 | 67 | /** 68 | * URI to the associated terms. 69 | * 70 | * @param string $terms 71 | * 72 | * @return $this 73 | */ 74 | public function setTerms($terms) 75 | { 76 | $this->terms = $terms; 77 | return $this; 78 | } 79 | 80 | /** 81 | * URI to the associated terms. 82 | * 83 | * @return string 84 | */ 85 | public function getTerms() 86 | { 87 | return $this->terms; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /lib/PayPal/Api/CreditCardHistory.php: -------------------------------------------------------------------------------- 1 | {"credit-cards"} = $credit_cards; 32 | return $this; 33 | } 34 | 35 | /** 36 | * A list of credit card resources 37 | * 38 | * @return \PayPal\Api\CreditCard 39 | */ 40 | public function getCreditCards() 41 | { 42 | return $this->{"credit-cards"}; 43 | } 44 | 45 | /** 46 | * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. 47 | * 48 | * 49 | * @param int $count 50 | * 51 | * @return $this 52 | */ 53 | public function setCount($count) 54 | { 55 | $this->count = $count; 56 | return $this; 57 | } 58 | 59 | /** 60 | * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. 61 | * 62 | * @return int 63 | */ 64 | public function getCount() 65 | { 66 | return $this->count; 67 | } 68 | 69 | /** 70 | * Identifier of the next element to get the next range of results. 71 | * 72 | * 73 | * @param string $next_id 74 | * 75 | * @return $this 76 | */ 77 | public function setNextId($next_id) 78 | { 79 | $this->next_id = $next_id; 80 | return $this; 81 | } 82 | 83 | /** 84 | * Identifier of the next element to get the next range of results. 85 | * 86 | * @return string 87 | */ 88 | public function getNextId() 89 | { 90 | return $this->next_id; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Currency.php: -------------------------------------------------------------------------------- 1 | currency = $currency; 31 | return $this; 32 | } 33 | 34 | /** 35 | * 3 letter currency code as defined by ISO 4217. 36 | * 37 | * @return string 38 | */ 39 | public function getCurrency() 40 | { 41 | return $this->currency; 42 | } 43 | 44 | /** 45 | * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. 46 | * 47 | * @param string|double $value 48 | * 49 | * @return $this 50 | */ 51 | public function setValue($value) 52 | { 53 | NumericValidator::validate($value, "Value"); 54 | $value = FormatConverter::formatToPrice($value, $this->getCurrency()); 55 | $this->value = $value; 56 | return $this; 57 | } 58 | 59 | /** 60 | * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. 61 | * 62 | * @return string 63 | */ 64 | public function getValue() 65 | { 66 | return $this->value; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /lib/PayPal/Api/CustomAmount.php: -------------------------------------------------------------------------------- 1 | label = $label; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Custom amount label. 25 characters max. 34 | * 35 | * @return string 36 | */ 37 | public function getLabel() 38 | { 39 | return $this->label; 40 | } 41 | 42 | /** 43 | * Custom amount value. Range of 0 to 999999.99. 44 | * 45 | * @param \PayPal\Api\Currency $amount 46 | * 47 | * @return $this 48 | */ 49 | public function setAmount($amount) 50 | { 51 | $this->amount = $amount; 52 | return $this; 53 | } 54 | 55 | /** 56 | * Custom amount value. Range of 0 to 999999.99. 57 | * 58 | * @return \PayPal\Api\Currency 59 | */ 60 | public function getAmount() 61 | { 62 | return $this->amount; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/ErrorDetails.php: -------------------------------------------------------------------------------- 1 | field = $field; 31 | return $this; 32 | } 33 | 34 | /** 35 | * Name of the field that caused the error. 36 | * 37 | * @return string 38 | */ 39 | public function getField() 40 | { 41 | return $this->field; 42 | } 43 | 44 | /** 45 | * Reason for the error. 46 | * 47 | * @param string $issue 48 | * 49 | * @return $this 50 | */ 51 | public function setIssue($issue) 52 | { 53 | $this->issue = $issue; 54 | return $this; 55 | } 56 | 57 | /** 58 | * Reason for the error. 59 | * 60 | * @return string 61 | */ 62 | public function getIssue() 63 | { 64 | return $this->issue; 65 | } 66 | 67 | /** 68 | * Reference ID of the purchase_unit associated with this error 69 | * 70 | * @param string $purchase_unit_reference_id 71 | * 72 | * @return $this 73 | */ 74 | public function setPurchaseUnitReferenceId($purchase_unit_reference_id) 75 | { 76 | $this->purchase_unit_reference_id = $purchase_unit_reference_id; 77 | return $this; 78 | } 79 | 80 | /** 81 | * Reference ID of the purchase_unit associated with this error 82 | * 83 | * @return string 84 | */ 85 | public function getPurchaseUnitReferenceId() 86 | { 87 | return $this->purchase_unit_reference_id; 88 | } 89 | 90 | /** 91 | * PayPal internal error code. 92 | * 93 | * @param string $code 94 | * 95 | * @return $this 96 | */ 97 | public function setCode($code) 98 | { 99 | $this->code = $code; 100 | return $this; 101 | } 102 | 103 | /** 104 | * PayPal internal error code. 105 | * 106 | * @return string 107 | */ 108 | public function getCode() 109 | { 110 | return $this->code; 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /lib/PayPal/Api/ExtendedBankAccount.php: -------------------------------------------------------------------------------- 1 | mandate_reference_number = $mandate_reference_number; 26 | return $this; 27 | } 28 | 29 | /** 30 | * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). 31 | * 32 | * @return string 33 | */ 34 | public function getMandateReferenceNumber() 35 | { 36 | return $this->mandate_reference_number; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /lib/PayPal/Api/FlowConfig.php: -------------------------------------------------------------------------------- 1 | landing_page_type = $landing_page_type; 31 | return $this; 32 | } 33 | 34 | /** 35 | * Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used. 36 | * 37 | * @return string 38 | */ 39 | public function getLandingPageType() 40 | { 41 | return $this->landing_page_type; 42 | } 43 | 44 | /** 45 | * The URL on the merchant site for transferring to after a bank transfer payment. 46 | * 47 | * 48 | * @param string $bank_txn_pending_url 49 | * @throws \InvalidArgumentException 50 | * @return $this 51 | */ 52 | public function setBankTxnPendingUrl($bank_txn_pending_url) 53 | { 54 | UrlValidator::validate($bank_txn_pending_url, "BankTxnPendingUrl"); 55 | $this->bank_txn_pending_url = $bank_txn_pending_url; 56 | return $this; 57 | } 58 | 59 | /** 60 | * The URL on the merchant site for transferring to after a bank transfer payment. 61 | * 62 | * @return string 63 | */ 64 | public function getBankTxnPendingUrl() 65 | { 66 | return $this->bank_txn_pending_url; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /lib/PayPal/Api/FundingDetail.php: -------------------------------------------------------------------------------- 1 | clearing_time = $clearing_time; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Expected clearing time 34 | * 35 | * @return string 36 | */ 37 | public function getClearingTime() 38 | { 39 | return $this->clearing_time; 40 | } 41 | 42 | /** 43 | * Hold-off duration of the payment 44 | * 45 | * @param string $payment_hold_date 46 | * 47 | * @return $this 48 | */ 49 | public function setPaymentHoldDate($payment_hold_date) 50 | { 51 | $this->payment_hold_date = $payment_hold_date; 52 | return $this; 53 | } 54 | 55 | /** 56 | * Hold-off duration of the payment 57 | * 58 | * @return string 59 | */ 60 | public function getPaymentHoldDate() 61 | { 62 | return $this->payment_hold_date; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/FuturePayment.php: -------------------------------------------------------------------------------- 1 | $clientMetadataId 33 | ); 34 | } 35 | $payLoad = $this->toJSON(); 36 | $call = new PayPalRestCall($apiContext); 37 | $json = $call->execute( 38 | array('PayPal\Handler\RestHandler'), 39 | "/v1/payments/payment", 40 | "POST", 41 | $payLoad, 42 | $headers 43 | ); 44 | $this->fromJson($json); 45 | 46 | return $this; 47 | 48 | } 49 | 50 | /** 51 | * Get a Refresh Token from Authorization Code 52 | * 53 | * @param $authorizationCode 54 | * @param ApiContext $apiContext 55 | * @return string|null refresh token 56 | */ 57 | public static function getRefreshToken($authorizationCode, $apiContext = null) 58 | { 59 | $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); 60 | $credential = $apiContext->getCredential(); 61 | return $credential->getRefreshToken($apiContext->getConfig(), $authorizationCode); 62 | } 63 | 64 | /** 65 | * Updates Access Token using long lived refresh token 66 | * 67 | * @param string|null $refreshToken 68 | * @param ApiContext $apiContext 69 | * @return void 70 | */ 71 | public function updateAccessToken($refreshToken, $apiContext) 72 | { 73 | $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); 74 | $apiContext->getCredential()->updateAccessToken($apiContext->getConfig(), $refreshToken); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Image.php: -------------------------------------------------------------------------------- 1 | image = $imageBase64String; 26 | return $this; 27 | } 28 | 29 | /** 30 | * Get Image as Base-64 encoded String 31 | * 32 | * @return string 33 | */ 34 | public function getImage() 35 | { 36 | return $this->image; 37 | } 38 | 39 | /** 40 | * Stores the Image to file 41 | * 42 | * @param string $name File Name 43 | * @return string File name 44 | */ 45 | public function saveToFile($name = null) 46 | { 47 | // Self Generate File Location 48 | if (!$name) { 49 | $name = uniqid() . '.png'; 50 | } 51 | // Save to File 52 | file_put_contents($name, base64_decode($this->getImage())); 53 | return $name; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /lib/PayPal/Api/InvoiceAddress.php: -------------------------------------------------------------------------------- 1 | phone = $phone; 28 | return $this; 29 | } 30 | 31 | /** 32 | * Phone number in E.123 format. 33 | * 34 | * @return \PayPal\Api\Phone 35 | */ 36 | public function getPhone() 37 | { 38 | return $this->phone; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lib/PayPal/Api/InvoiceSearchResponse.php: -------------------------------------------------------------------------------- 1 | total_count = $total_count; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Total number of invoices. 34 | * 35 | * @return int 36 | */ 37 | public function getTotalCount() 38 | { 39 | return $this->total_count; 40 | } 41 | 42 | /** 43 | * List of invoices belonging to a merchant. 44 | * 45 | * @param \PayPal\Api\Invoice[] $invoices 46 | * 47 | * @return $this 48 | */ 49 | public function setInvoices($invoices) 50 | { 51 | $this->invoices = $invoices; 52 | return $this; 53 | } 54 | 55 | /** 56 | * List of invoices belonging to a merchant. 57 | * 58 | * @return \PayPal\Api\Invoice[] 59 | */ 60 | public function getInvoices() 61 | { 62 | return $this->invoices; 63 | } 64 | 65 | /** 66 | * Append Invoices to the list. 67 | * 68 | * @param \PayPal\Api\Invoice $invoice 69 | * @return $this 70 | */ 71 | public function addInvoice($invoice) 72 | { 73 | if (!$this->getInvoices()) { 74 | return $this->setInvoices(array($invoice)); 75 | } else { 76 | return $this->setInvoices( 77 | array_merge($this->getInvoices(), array($invoice)) 78 | ); 79 | } 80 | } 81 | 82 | /** 83 | * Remove Invoices from the list. 84 | * 85 | * @param \PayPal\Api\Invoice $invoice 86 | * @return $this 87 | */ 88 | public function removeInvoice($invoice) 89 | { 90 | return $this->setInvoices( 91 | array_diff($this->getInvoices(), array($invoice)) 92 | ); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Measurement.php: -------------------------------------------------------------------------------- 1 | value = $value; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Value this measurement represents. 34 | * 35 | * @return string 36 | */ 37 | public function getValue() 38 | { 39 | return $this->value; 40 | } 41 | 42 | /** 43 | * Unit in which the value is represented. 44 | * 45 | * @param string $unit 46 | * 47 | * @return $this 48 | */ 49 | public function setUnit($unit) 50 | { 51 | $this->unit = $unit; 52 | return $this; 53 | } 54 | 55 | /** 56 | * Unit in which the value is represented. 57 | * 58 | * @return string 59 | */ 60 | public function getUnit() 61 | { 62 | return $this->unit; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/NameValuePair.php: -------------------------------------------------------------------------------- 1 | name = $name; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Key for the name value pair. The value name types should be correlated 34 | * 35 | * @return string 36 | */ 37 | public function getName() 38 | { 39 | return $this->name; 40 | } 41 | 42 | /** 43 | * Value for the name value pair. 44 | * 45 | * @param string $value 46 | * 47 | * @return $this 48 | */ 49 | public function setValue($value) 50 | { 51 | $this->value = $value; 52 | return $this; 53 | } 54 | 55 | /** 56 | * Value for the name value pair. 57 | * 58 | * @return string 59 | */ 60 | public function getValue() 61 | { 62 | return $this->value; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Notification.php: -------------------------------------------------------------------------------- 1 | subject = $subject; 30 | return $this; 31 | } 32 | 33 | /** 34 | * Subject of the notification. 35 | * 36 | * @return string 37 | */ 38 | public function getSubject() 39 | { 40 | return $this->subject; 41 | } 42 | 43 | /** 44 | * Note to the payer. 45 | * 46 | * @param string $note 47 | * 48 | * @return $this 49 | */ 50 | public function setNote($note) 51 | { 52 | $this->note = $note; 53 | return $this; 54 | } 55 | 56 | /** 57 | * Note to the payer. 58 | * 59 | * @return string 60 | */ 61 | public function getNote() 62 | { 63 | return $this->note; 64 | } 65 | 66 | /** 67 | * A flag indicating whether a copy of the email has to be sent to the merchant. 68 | * 69 | * @param bool $send_to_merchant 70 | * 71 | * @return $this 72 | */ 73 | public function setSendToMerchant($send_to_merchant) 74 | { 75 | $this->send_to_merchant = $send_to_merchant; 76 | return $this; 77 | } 78 | 79 | /** 80 | * A flag indicating whether a copy of the email has to be sent to the merchant. 81 | * 82 | * @return bool 83 | */ 84 | public function getSendToMerchant() 85 | { 86 | return $this->send_to_merchant; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /lib/PayPal/Api/OpenIdError.php: -------------------------------------------------------------------------------- 1 | error = $error; 21 | return $this; 22 | } 23 | 24 | /** 25 | * A single ASCII error code from the following enum. 26 | * 27 | * @return string 28 | */ 29 | public function getError() 30 | { 31 | return $this->error; 32 | } 33 | 34 | /** 35 | * A resource ID that indicates the starting resource in the returned results. 36 | * 37 | * @param string $error_description 38 | * @return self 39 | */ 40 | public function setErrorDescription($error_description) 41 | { 42 | $this->error_description = $error_description; 43 | return $this; 44 | } 45 | 46 | /** 47 | * A resource ID that indicates the starting resource in the returned results. 48 | * 49 | * @return string 50 | */ 51 | public function getErrorDescription() 52 | { 53 | return $this->error_description; 54 | } 55 | 56 | /** 57 | * A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. 58 | * 59 | * @param string $error_uri 60 | * @return self 61 | */ 62 | public function setErrorUri($error_uri) 63 | { 64 | $this->error_uri = $error_uri; 65 | return $this; 66 | } 67 | 68 | /** 69 | * A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. 70 | * 71 | * @return string 72 | */ 73 | public function getErrorUri() 74 | { 75 | return $this->error_uri; 76 | } 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /lib/PayPal/Api/OverrideChargeModel.php: -------------------------------------------------------------------------------- 1 | charge_id = $charge_id; 29 | return $this; 30 | } 31 | 32 | /** 33 | * ID of charge model. 34 | * 35 | * @return string 36 | */ 37 | public function getChargeId() 38 | { 39 | return $this->charge_id; 40 | } 41 | 42 | /** 43 | * Updated Amount to be associated with this charge model. 44 | * 45 | * @param \PayPal\Api\Currency $amount 46 | * 47 | * @return $this 48 | */ 49 | public function setAmount($amount) 50 | { 51 | $this->amount = $amount; 52 | return $this; 53 | } 54 | 55 | /** 56 | * Updated Amount to be associated with this charge model. 57 | * 58 | * @return \PayPal\Api\Currency 59 | */ 60 | public function getAmount() 61 | { 62 | return $this->amount; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/PatchRequest.php: -------------------------------------------------------------------------------- 1 | patches = $patches; 28 | return $this; 29 | } 30 | 31 | /** 32 | * Placeholder for holding array of patch objects 33 | * 34 | * @return \PayPal\Api\Patch[] 35 | */ 36 | public function getPatches() 37 | { 38 | return $this->patches; 39 | } 40 | 41 | /** 42 | * Append Patches to the list. 43 | * 44 | * @param \PayPal\Api\Patch $patch 45 | * @return $this 46 | */ 47 | public function addPatch($patch) 48 | { 49 | if (!$this->getPatches()) { 50 | return $this->setPatches(array($patch)); 51 | } else { 52 | return $this->setPatches( 53 | array_merge($this->getPatches(), array($patch)) 54 | ); 55 | } 56 | } 57 | 58 | /** 59 | * Remove Patches from the list. 60 | * 61 | * @param \PayPal\Api\Patch $patch 62 | * @return $this 63 | */ 64 | public function removePatch($patch) 65 | { 66 | return $this->setPatches( 67 | array_diff($this->getPatches(), array($patch)) 68 | ); 69 | } 70 | 71 | /** 72 | * As PatchRequest holds the array of Patch object, we would override the json conversion to return 73 | * a json representation of array of Patch objects. 74 | * 75 | * @param int $options 76 | * @return mixed|string 77 | */ 78 | public function toJSON($options = 0) 79 | { 80 | $json = array(); 81 | foreach ($this->getPatches() as $patch) { 82 | $json[] = $patch->toArray(); 83 | } 84 | return str_replace('\\/', '/', json_encode($json, $options)); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/PayPal/Api/PaymentExecution.php: -------------------------------------------------------------------------------- 1 | payer_id = $payer_id; 29 | return $this; 30 | } 31 | 32 | /** 33 | * PayPal assigned Payer ID returned in the approval return url. 34 | * 35 | * @return string 36 | */ 37 | public function getPayerId() 38 | { 39 | return $this->payer_id; 40 | } 41 | 42 | /** 43 | * Transaction information to be used at the time of execute payment. Only amount and shipping_address can be updated in execute payment 44 | * 45 | * @param \PayPal\Api\Transaction[] $transactions 46 | * 47 | * @return $this 48 | */ 49 | public function setTransactions($transactions) 50 | { 51 | $this->transactions = $transactions; 52 | return $this; 53 | } 54 | 55 | /** 56 | * Transaction information to be used at the time of execute payment. Only amount and shipping_address can be updated in execute payment 57 | * 58 | * @return \PayPal\Api\Transaction[] 59 | */ 60 | public function getTransactions() 61 | { 62 | return $this->transactions; 63 | } 64 | 65 | /** 66 | * Append Transactions to the list. 67 | * 68 | * @param \PayPal\Api\Transaction $transaction 69 | * @return $this 70 | */ 71 | public function addTransaction($transaction) 72 | { 73 | if (!$this->getTransactions()) { 74 | return $this->setTransactions(array($transaction)); 75 | } else { 76 | return $this->setTransactions( 77 | array_merge($this->getTransactions(), array($transaction)) 78 | ); 79 | } 80 | } 81 | 82 | /** 83 | * Remove Transactions from the list. 84 | * 85 | * @param \PayPal\Api\Transaction $transaction 86 | * @return $this 87 | */ 88 | public function removeTransaction($transaction) 89 | { 90 | return $this->setTransactions( 91 | array_diff($this->getTransactions(), array($transaction)) 92 | ); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /lib/PayPal/Api/PaymentOptions.php: -------------------------------------------------------------------------------- 1 | allowed_payment_method = $allowed_payment_method; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Payment method requested for this purchase unit 34 | * 35 | * @return string 36 | */ 37 | public function getAllowedPaymentMethod() 38 | { 39 | return $this->allowed_payment_method; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lib/PayPal/Api/PaymentTerm.php: -------------------------------------------------------------------------------- 1 | term_type = $term_type; 30 | return $this; 31 | } 32 | 33 | /** 34 | * Terms by which the invoice payment is due. 35 | * 36 | * @return string 37 | */ 38 | public function getTermType() 39 | { 40 | return $this->term_type; 41 | } 42 | 43 | /** 44 | * Date on which invoice payment is due. It must be always a future date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). 45 | * 46 | * @param string $due_date 47 | * 48 | * @return $this 49 | */ 50 | public function setDueDate($due_date) 51 | { 52 | $this->due_date = $due_date; 53 | return $this; 54 | } 55 | 56 | /** 57 | * Date on which invoice payment is due. It must be always a future date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). 58 | * 59 | * @return string 60 | */ 61 | public function getDueDate() 62 | { 63 | return $this->due_date; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Phone.php: -------------------------------------------------------------------------------- 1 | country_code = $country_code; 30 | return $this; 31 | } 32 | 33 | /** 34 | * Country code (from in E.164 format) 35 | * 36 | * @return string 37 | */ 38 | public function getCountryCode() 39 | { 40 | return $this->country_code; 41 | } 42 | 43 | /** 44 | * In-country phone number (from in E.164 format) 45 | * 46 | * @param string $national_number 47 | * 48 | * @return $this 49 | */ 50 | public function setNationalNumber($national_number) 51 | { 52 | $this->national_number = $national_number; 53 | return $this; 54 | } 55 | 56 | /** 57 | * In-country phone number (from in E.164 format) 58 | * 59 | * @return string 60 | */ 61 | public function getNationalNumber() 62 | { 63 | return $this->national_number; 64 | } 65 | 66 | /** 67 | * Phone extension 68 | * 69 | * @param string $extension 70 | * 71 | * @return $this 72 | */ 73 | public function setExtension($extension) 74 | { 75 | $this->extension = $extension; 76 | return $this; 77 | } 78 | 79 | /** 80 | * Phone extension 81 | * 82 | * @return string 83 | */ 84 | public function getExtension() 85 | { 86 | return $this->extension; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Presentation.php: -------------------------------------------------------------------------------- 1 | brand_name = $brand_name; 31 | return $this; 32 | } 33 | 34 | /** 35 | * A label that overrides the business name in the PayPal account on the PayPal pages. 36 | * 37 | * @return string 38 | */ 39 | public function getBrandName() 40 | { 41 | return $this->brand_name; 42 | } 43 | 44 | /** 45 | * A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`. 46 | * 47 | * 48 | * @param string $logo_image 49 | * 50 | * @return $this 51 | */ 52 | public function setLogoImage($logo_image) 53 | { 54 | $this->logo_image = $logo_image; 55 | return $this; 56 | } 57 | 58 | /** 59 | * A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`. 60 | * 61 | * @return string 62 | */ 63 | public function getLogoImage() 64 | { 65 | return $this->logo_image; 66 | } 67 | 68 | /** 69 | * Locale of pages displayed by PayPal payment experience. 70 | * 71 | * 72 | * @param string $locale_code 73 | * 74 | * @return $this 75 | */ 76 | public function setLocaleCode($locale_code) 77 | { 78 | $this->locale_code = $locale_code; 79 | return $this; 80 | } 81 | 82 | /** 83 | * Locale of pages displayed by PayPal payment experience. 84 | * 85 | * @return string 86 | */ 87 | public function getLocaleCode() 88 | { 89 | return $this->locale_code; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /lib/PayPal/Api/RedirectUrls.php: -------------------------------------------------------------------------------- 1 | return_url = $return_url; 31 | return $this; 32 | } 33 | 34 | /** 35 | * Url where the payer would be redirected to after approving the payment. 36 | * 37 | * @return string 38 | */ 39 | public function getReturnUrl() 40 | { 41 | return $this->return_url; 42 | } 43 | 44 | /** 45 | * Url where the payer would be redirected to after canceling the payment. 46 | * 47 | * @param string $cancel_url 48 | * @throws \InvalidArgumentException 49 | * @return $this 50 | */ 51 | public function setCancelUrl($cancel_url) 52 | { 53 | UrlValidator::validate($cancel_url, "CancelUrl"); 54 | $this->cancel_url = $cancel_url; 55 | return $this; 56 | } 57 | 58 | /** 59 | * Url where the payer would be redirected to after canceling the payment. 60 | * 61 | * @return string 62 | */ 63 | public function getCancelUrl() 64 | { 65 | return $this->cancel_url; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /lib/PayPal/Api/ShippingAddress.php: -------------------------------------------------------------------------------- 1 | id = $id; 31 | return $this; 32 | } 33 | 34 | /** 35 | * Address ID assigned in PayPal system. 36 | * 37 | * @return string 38 | */ 39 | public function getId() 40 | { 41 | return $this->id; 42 | } 43 | 44 | /** 45 | * Name of the recipient at this address. 46 | * 47 | * @param string $recipient_name 48 | * 49 | * @return $this 50 | */ 51 | public function setRecipientName($recipient_name) 52 | { 53 | $this->recipient_name = $recipient_name; 54 | return $this; 55 | } 56 | 57 | /** 58 | * Name of the recipient at this address. 59 | * 60 | * @return string 61 | */ 62 | public function getRecipientName() 63 | { 64 | return $this->recipient_name; 65 | } 66 | 67 | /** 68 | * Default shipping address of the Payer. 69 | * 70 | * @param bool $default_address 71 | * 72 | * @return $this 73 | */ 74 | public function setDefaultAddress($default_address) 75 | { 76 | $this->default_address = $default_address; 77 | return $this; 78 | } 79 | 80 | /** 81 | * Default shipping address of the Payer. 82 | * 83 | * @return bool 84 | */ 85 | public function getDefaultAddress() 86 | { 87 | return $this->default_address; 88 | } 89 | 90 | /** 91 | * Shipping Address marked as preferred by Payer. 92 | * 93 | * @param bool $preferred_address 94 | * 95 | * @return $this 96 | */ 97 | public function setPreferredAddress($preferred_address) 98 | { 99 | $this->preferred_address = $preferred_address; 100 | return $this; 101 | } 102 | 103 | /** 104 | * Shipping Address marked as preferred by Payer. 105 | * 106 | * @return bool 107 | */ 108 | public function getPreferredAddress() 109 | { 110 | return $this->preferred_address; 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /lib/PayPal/Api/ShippingCost.php: -------------------------------------------------------------------------------- 1 | amount = $amount; 29 | return $this; 30 | } 31 | 32 | /** 33 | * Shipping cost in amount. Range of 0 to 999999.99. 34 | * 35 | * @return \PayPal\Api\Currency 36 | */ 37 | public function getAmount() 38 | { 39 | return $this->amount; 40 | } 41 | 42 | /** 43 | * Tax percentage on shipping amount. 44 | * 45 | * @param \PayPal\Api\Tax $tax 46 | * 47 | * @return $this 48 | */ 49 | public function setTax($tax) 50 | { 51 | $this->tax = $tax; 52 | return $this; 53 | } 54 | 55 | /** 56 | * Tax percentage on shipping amount. 57 | * 58 | * @return \PayPal\Api\Tax 59 | */ 60 | public function getTax() 61 | { 62 | return $this->tax; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Tax.php: -------------------------------------------------------------------------------- 1 | id = $id; 33 | return $this; 34 | } 35 | 36 | /** 37 | * Identifier of the resource. 38 | * 39 | * @return string 40 | */ 41 | public function getId() 42 | { 43 | return $this->id; 44 | } 45 | 46 | /** 47 | * Name of the tax. 10 characters max. 48 | * 49 | * @param string $name 50 | * 51 | * @return $this 52 | */ 53 | public function setName($name) 54 | { 55 | $this->name = $name; 56 | return $this; 57 | } 58 | 59 | /** 60 | * Name of the tax. 10 characters max. 61 | * 62 | * @return string 63 | */ 64 | public function getName() 65 | { 66 | return $this->name; 67 | } 68 | 69 | /** 70 | * Rate of the specified tax. Range of 0.001 to 99.999. 71 | * 72 | * @param string|double $percent 73 | * 74 | * @return $this 75 | */ 76 | public function setPercent($percent) 77 | { 78 | NumericValidator::validate($percent, "Percent"); 79 | $percent = FormatConverter::formatToPrice($percent); 80 | $this->percent = $percent; 81 | return $this; 82 | } 83 | 84 | /** 85 | * Rate of the specified tax. Range of 0.001 to 99.999. 86 | * 87 | * @return string 88 | */ 89 | public function getPercent() 90 | { 91 | return $this->percent; 92 | } 93 | 94 | /** 95 | * Tax in the form of money. Cannot be specified in a request. 96 | * 97 | * @param \PayPal\Api\Currency $amount 98 | * 99 | * @return $this 100 | */ 101 | public function setAmount($amount) 102 | { 103 | $this->amount = $amount; 104 | return $this; 105 | } 106 | 107 | /** 108 | * Tax in the form of money. Cannot be specified in a request. 109 | * 110 | * @return \PayPal\Api\Currency 111 | */ 112 | public function getAmount() 113 | { 114 | return $this->amount; 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Transaction.php: -------------------------------------------------------------------------------- 1 | transactions = $transactions; 28 | return $this; 29 | } 30 | 31 | /** 32 | * Additional transactions for complex payment scenarios. 33 | * 34 | * @return self[] 35 | */ 36 | public function getTransactions() 37 | { 38 | return $this->transactions; 39 | } 40 | 41 | /** 42 | * Identifier to the purchase unit corresponding to this sale transaction 43 | * 44 | * @param string $purchase_unit_reference_id 45 | * 46 | * @return $this 47 | */ 48 | public function setPurchaseUnitReferenceId($purchase_unit_reference_id) 49 | { 50 | $this->purchase_unit_reference_id = $purchase_unit_reference_id; 51 | return $this; 52 | } 53 | 54 | /** 55 | * Identifier to the purchase unit corresponding to this sale transaction 56 | * 57 | * @return string 58 | */ 59 | public function getPurchaseUnitReferenceId() 60 | { 61 | return $this->purchase_unit_reference_id; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /lib/PayPal/Api/TransactionBase.php: -------------------------------------------------------------------------------- 1 | related_resources = $related_resources; 30 | return $this; 31 | } 32 | 33 | /** 34 | * List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment. 35 | * 36 | * @return \PayPal\Api\RelatedResources[] 37 | */ 38 | public function getRelatedResources() 39 | { 40 | return $this->related_resources; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /lib/PayPal/Api/Transactions.php: -------------------------------------------------------------------------------- 1 | amount = $amount; 30 | return $this; 31 | } 32 | 33 | /** 34 | * Amount being collected. 35 | * 36 | * @return \PayPal\Api\Amount 37 | */ 38 | public function getAmount() 39 | { 40 | return $this->amount; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /lib/PayPal/Api/WebhookEventTypeList.php: -------------------------------------------------------------------------------- 1 | event_types = $event_types; 28 | return $this; 29 | } 30 | 31 | /** 32 | * A list of Webhooks event-types 33 | * 34 | * @return \PayPal\Api\WebhookEventType[] 35 | */ 36 | public function getEventTypes() 37 | { 38 | return $this->event_types; 39 | } 40 | 41 | /** 42 | * Append EventTypes to the list. 43 | * 44 | * @param \PayPal\Api\WebhookEventType $webhookEventType 45 | * @return $this 46 | */ 47 | public function addEventType($webhookEventType) 48 | { 49 | if (!$this->getEventTypes()) { 50 | return $this->setEventTypes(array($webhookEventType)); 51 | } else { 52 | return $this->setEventTypes( 53 | array_merge($this->getEventTypes(), array($webhookEventType)) 54 | ); 55 | } 56 | } 57 | 58 | /** 59 | * Remove EventTypes from the list. 60 | * 61 | * @param \PayPal\Api\WebhookEventType $webhookEventType 62 | * @return $this 63 | */ 64 | public function removeEventType($webhookEventType) 65 | { 66 | return $this->setEventTypes( 67 | array_diff($this->getEventTypes(), array($webhookEventType)) 68 | ); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lib/PayPal/Api/WebhookList.php: -------------------------------------------------------------------------------- 1 | webhooks = $webhooks; 28 | return $this; 29 | } 30 | 31 | /** 32 | * A list of Webhooks 33 | * 34 | * @return \PayPal\Api\Webhook[] 35 | */ 36 | public function getWebhooks() 37 | { 38 | return $this->webhooks; 39 | } 40 | 41 | /** 42 | * Append Webhooks to the list. 43 | * 44 | * @param \PayPal\Api\Webhook $webhook 45 | * @return $this 46 | */ 47 | public function addWebhook($webhook) 48 | { 49 | if (!$this->getWebhooks()) { 50 | return $this->setWebhooks(array($webhook)); 51 | } else { 52 | return $this->setWebhooks( 53 | array_merge($this->getWebhooks(), array($webhook)) 54 | ); 55 | } 56 | } 57 | 58 | /** 59 | * Remove Webhooks from the list. 60 | * 61 | * @param \PayPal\Api\Webhook $webhook 62 | * @return $this 63 | */ 64 | public function removeWebhook($webhook) 65 | { 66 | return $this->setWebhooks( 67 | array_diff($this->getWebhooks(), array($webhook)) 68 | ); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lib/PayPal/Common/ArrayUtil.php: -------------------------------------------------------------------------------- 1 | $v) { 22 | if (is_int($k)) { 23 | return false; 24 | } 25 | } 26 | return true; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/PayPal/Common/PayPalUserAgent.php: -------------------------------------------------------------------------------- 1 | 0, 'TWD' => 0); 50 | if ($currency && array_key_exists($currency, $currencyDecimals)) { 51 | if (strpos($value, ".") !== false && (floor($value) != $value)) { 52 | //throw exception if it has decimal values for JPY and TWD which does not ends with .00 53 | throw new \InvalidArgumentException("value cannot have decimals for $currency currency"); 54 | } 55 | $decimals = $currencyDecimals[$currency]; 56 | } else if (strpos($value, ".") === false) { 57 | // Check if value has decimal values. If not no need to assign 2 decimals with .00 at the end 58 | $decimals = 0; 59 | } 60 | return self::formatToNumber($value, $decimals); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/PayPal/Core/PayPalConstants.php: -------------------------------------------------------------------------------- 1 | url = $url; 37 | } 38 | 39 | /** 40 | * Sets Data 41 | * 42 | * @param $data 43 | */ 44 | public function setData($data) 45 | { 46 | $this->data = $data; 47 | } 48 | 49 | /** 50 | * Gets Data 51 | * 52 | * @return string 53 | */ 54 | public function getData() 55 | { 56 | return $this->data; 57 | } 58 | 59 | /** 60 | * Gets Url 61 | * 62 | * @return string 63 | */ 64 | public function getUrl() 65 | { 66 | return $this->url; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/PayPal/Exception/PayPalInvalidCredentialException.php: -------------------------------------------------------------------------------- 1 | getLine() . ' in ' . $this->getFile() 32 | . ': ' . $this->getMessage() . ''; 33 | return $errorMsg; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lib/PayPal/Exception/PayPalMissingCredentialException.php: -------------------------------------------------------------------------------- 1 | getLine() . ' in ' . $this->getFile() 32 | . ': ' . $this->getMessage() . ''; 33 | 34 | return $errorMsg; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /lib/PayPal/Handler/IPayPalHandler.php: -------------------------------------------------------------------------------- 1 | secretKey = $secretKey; 24 | } 25 | 26 | /** 27 | * Encrypts the input text using the cipher key 28 | * 29 | * @param $input 30 | * @return string 31 | */ 32 | function encrypt($input) 33 | { 34 | // Create a random IV. Not using mcrypt to generate one, as to not have a dependency on it. 35 | $iv = substr(uniqid("", true), 0, Cipher::IV_SIZE); 36 | // Encrypt the data 37 | $encrypted = openssl_encrypt($input, "AES-256-CBC", $this->secretKey, 0, $iv); 38 | // Encode the data with IV as prefix 39 | return base64_encode($iv . $encrypted); 40 | } 41 | 42 | /** 43 | * Decrypts the input text from the cipher key 44 | * 45 | * @param $input 46 | * @return string 47 | */ 48 | function decrypt($input) 49 | { 50 | // Decode the IV + data 51 | $input = base64_decode($input); 52 | // Remove the IV 53 | $iv = substr($input, 0, Cipher::IV_SIZE); 54 | // Return Decrypted Data 55 | return openssl_decrypt(substr($input, Cipher::IV_SIZE), "AES-256-CBC", $this->secretKey, 0, $iv); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/PayPal/Transport/PayPalRestCall.php: -------------------------------------------------------------------------------- 1 | apiContext = $apiContext; 41 | $this->logger = PayPalLoggingManager::getInstance(__CLASS__); 42 | } 43 | 44 | /** 45 | * @param array $handlers Array of handlers 46 | * @param string $path Resource path relative to base service endpoint 47 | * @param string $method HTTP method - one of GET, POST, PUT, DELETE, PATCH etc 48 | * @param string $data Request payload 49 | * @param array $headers HTTP headers 50 | * @return mixed 51 | * @throws \PayPal\Exception\PayPalConnectionException 52 | */ 53 | public function execute($handlers = array(), $path, $method, $data = '', $headers = array()) 54 | { 55 | 56 | $config = $this->apiContext->getConfig(); 57 | $httpConfig = new PayPalHttpConfig(null, $method, $config); 58 | $headers = $headers ? $headers : array(); 59 | $httpConfig->setHeaders($headers + 60 | array( 61 | 'Content-Type' => 'application/json' 62 | ) 63 | ); 64 | 65 | /** @var \Paypal\Handler\IPayPalHandler $handler */ 66 | foreach ($handlers as $handler) { 67 | if (!is_object($handler)) { 68 | $fullHandler = "\\" . (string)$handler; 69 | $handler = new $fullHandler($this->apiContext); 70 | } 71 | $handler->handle($httpConfig, $data, array('path' => $path, 'apiContext' => $this->apiContext)); 72 | } 73 | $connection = new PayPalHttpConnection($httpConfig, $config); 74 | $response = $connection->execute($data); 75 | 76 | return $response; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /lib/PayPal/Validation/ArgumentValidator.php: -------------------------------------------------------------------------------- 1 | get('validation.level'); 26 | if (!empty($mode) && $mode != 'disabled') { 27 | //Check if $attributeName is string 28 | if (gettype($attributeName) !== 'string') { 29 | return false; 30 | } 31 | //If the mode is disabled, bypass the validation 32 | foreach (array('set' . $attributeName, 'get' . $attributeName) as $methodName) { 33 | if (get_class($class) == get_class(new PayPalModel())) { 34 | // Silently return false on cases where you are using PayPalModel instance directly 35 | return false; 36 | } 37 | //Check if both getter and setter exists for given attribute 38 | elseif (!method_exists($class, $methodName)) { 39 | //Delegate the error based on the choice 40 | $className = is_object($class) ? get_class($class) : (string)$class; 41 | $errorMessage = "Missing Accessor: $className:$methodName. You might be using older version of SDK. If not, create an issue at https://github.com/paypal/PayPal-PHP-SDK/issues"; 42 | PayPalLoggingManager::getInstance(__CLASS__)->debug($errorMessage); 43 | if ($mode == 'strict') { 44 | trigger_error($errorMessage, E_USER_NOTICE); 45 | } 46 | return false; 47 | } 48 | } 49 | return true; 50 | } 51 | return false; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/PayPal/Validation/NumericValidator.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | 22 | .pp-method-express > .config-heading .button-container { background: url("../images/selo_pp_configs.png") no-repeat transparent; height: 29px; padding: 0 0 0 230px; width: 90px; } 23 | .pp-method-general > .config-heading .button-container { background: url("../images/aceitacao_paypal.png") no-repeat -8px 2px transparent; height: 28px; padding: 8px 0 0 180px; } 24 | .pp-method-ppplus> .config-heading .heading strong{ background: url("../images/selo_ppplus.png") no-repeat scroll 0 2px rgba(0, 0, 0, 0); padding-left: 84px; } 25 | .pp-method-invoice> .config-heading .heading strong{ background: url("../images/selo_pp.png") no-repeat scroll 0 2px rgba(0, 0, 0, 0); padding-left: 56px; } 26 | .pp-method-express> .config-heading .heading strong{ background: url("../images/selo_pp.png") no-repeat scroll 0 2px rgba(0, 0, 0, 0); padding-left: 56px; } 27 | 28 | label[for="p_method_paypal_invoice"] { background: url('../../../images/paypal/logo-paypal.png') no-repeat; padding-left: 56px;} 29 | 30 | .pp-method-ppplus .comment { padding: 0px; } -------------------------------------------------------------------------------- /skin/adminhtml/default/default/esmart/paypalbrasil/images/selo_pp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/adminhtml/default/default/esmart/paypalbrasil/images/selo_pp.png -------------------------------------------------------------------------------- /skin/adminhtml/default/default/esmart/paypalbrasil/images/selo_pp_configs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/adminhtml/default/default/esmart/paypalbrasil/images/selo_pp_configs.png -------------------------------------------------------------------------------- /skin/adminhtml/default/default/esmart/paypalbrasil/images/selo_ppplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/adminhtml/default/default/esmart/paypalbrasil/images/selo_ppplus.png -------------------------------------------------------------------------------- /skin/adminhtml/default/default/esmart/paypalbrasil/paypal-in-context-cart-product.js: -------------------------------------------------------------------------------- 1 | document.observe("dom:loaded", function() { 2 | 3 | if (typeof window.paypalCheckoutReady === "undefined"){ 4 | 5 | window.paypalCheckoutReady = function() { 6 | 7 | if (typeof PayPalLightboxConfig == "undefined"){ 8 | return; 9 | } 10 | if(typeof PayPalLightboxConfig != "object"){ 11 | PayPalLightboxConfig = JSON.parse(PayPalLightboxConfig); 12 | } 13 | if (PayPalLightboxConfig.isActive==0){ 14 | return; 15 | } 16 | 17 | paypal.checkout.setup(PayPalLightboxConfig.merchantid, { 18 | environment: PayPalLightboxConfig.environment, 19 | button: IDS, 20 | click: function (e) { 21 | e.preventDefault(); 22 | 23 | /* to incontext Works needs a product on cart */ 24 | if ($('product_addtocart_form')) { 25 | new Ajax.Request($('product_addtocart_form').action,{ 26 | method: 'post', 27 | async: false 28 | }); 29 | } 30 | 31 | var urlConnect = PayPalLightboxConfig.setExpressCheckout 32 | 33 | paypal.checkout.initXO(); 34 | 35 | new Ajax.Request(urlConnect,{ 36 | method: 'get', 37 | async: true, 38 | crossDomain: false, 39 | 40 | onSuccess: function (token) { 41 | 42 | if (token.responseText.indexOf('cart') != -1 || token.responseText.indexOf('login')!= -1){ 43 | paypal.checkout.closeFlow(); 44 | setLocation(token.responseText); 45 | 46 | }else{ 47 | var url = paypal.checkout.urlPrefix + token.responseText; 48 | paypal.checkout.startFlow(url); 49 | } 50 | 51 | }, 52 | onFailure: function (responseData, textStatus, errorThrown) { 53 | alert("Error in ajax post"+responseData.statusText); 54 | //Gracefully Close the minibrowser in case of AJAX errors 55 | paypal.checkout.closeFlow(); 56 | } 57 | }); 58 | } 59 | }); 60 | }; 61 | }; 62 | }); -------------------------------------------------------------------------------- /skin/frontend/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/.DS_Store -------------------------------------------------------------------------------- /skin/frontend/base/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/.DS_Store -------------------------------------------------------------------------------- /skin/frontend/base/default/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/.DS_Store -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/.DS_Store -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/.DS_Store -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/css/inovarti_onestepcheckout.css: -------------------------------------------------------------------------------- 1 | #onestepcheckout-payment-method label{ 2 | padding: 6px 10px 6px 23px !important; 3 | } 4 | #onestepcheckout-payment-method input{ 5 | margin-left: 0px !important; 6 | } -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/css/moip_onestepcheckout.css: -------------------------------------------------------------------------------- 1 | #paypal_plus_iframe iframe { 2 | width: 100% !important; 3 | } 4 | 5 | #paypal_plus_iframe , #paypal_plus_iframe iframe { 6 | min-height: 573px 7 | } 8 | -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/loading.gif -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/login-paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/login-paypal.png -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/compra_express.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/compra_express.png -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/paypal_nf_v01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/paypal_nf_v01.png -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado10x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado10x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado10x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado10x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado11x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado11x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado11x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado11x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado12x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado12x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado12x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado12x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado2x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado2x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado2x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado2x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado3x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado3x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado3x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado3x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado4x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado4x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado4x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado4x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado5x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado5x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado5x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado5x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado6x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado6x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado6x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado6x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado7x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado7x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado7x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado7x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado8x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado8x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado8x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado8x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado9x_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado9x_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado9x_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_parcelado9x_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_rodape_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_rodape_01.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_rodape_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/logos/selo_pp_rodape_02.jpg -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/image/paypal_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/skin/frontend/base/default/esmart/paypalbrasil/image/paypal_rgb.png -------------------------------------------------------------------------------- /skin/frontend/base/default/esmart/paypalbrasil/js/inovarti-form-rewrite.js: -------------------------------------------------------------------------------- 1 | // Override onComplete method 2 | OnestepcheckoutForm.prototype.onComplete = function (transport) { 3 | if (transport && transport.responseText) { 4 | try { 5 | response = eval('(' + transport.responseText + ')'); 6 | } catch (e) { 7 | response = {}; 8 | } 9 | if (response.redirect) { 10 | if (response.redirect.match('/paypal/express/')) { 11 | 12 | let urlConnect = response.redirect; 13 | 14 | paypal.checkout.initXO(); 15 | 16 | new Ajax.Request(urlConnect, { 17 | method: 'get', 18 | async: true, 19 | crossDomain: false, 20 | 21 | onSuccess: function (token) { 22 | let url = token.request.url; 23 | paypal.checkout.startFlow(url); 24 | }, 25 | onFailure: function (responseData, textStatus, errorThrown) { 26 | alert("Error in ajax post" + responseData.statusText); 27 | //Gracefully Close the minibrowser in case of AJAX errors 28 | paypal.checkout.closeFlow(); 29 | } 30 | }); 31 | 32 | } else { 33 | setLocation(response.redirect); 34 | } 35 | return; 36 | } 37 | if (response.success) { 38 | setLocation(this.successUrl); 39 | } else if ("is_hosted_pro" in response && response.is_hosted_pro) { 40 | this.popup.showPopupWithDescription(response.update_section.html); 41 | var iframe = this.popup.contentContainer.select('#hss-iframe').first(); 42 | iframe.observe('load', function () { 43 | $('hss-iframe').show(); 44 | $('iframe-warning').show(); 45 | }); 46 | } else { 47 | var msg = response.messages || response.message; 48 | if (typeof (msg) == 'object') { 49 | msg = msg.join("\n"); 50 | } 51 | if (msg) { 52 | alert(msg); 53 | } 54 | this.enablePlaceOrderButton(); 55 | this.hidePleaseWaitNotice(); 56 | this.hideOverlay(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /tutorial/Credenciais_API.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/br-paypaldev/magento-module/6be26b075184c106fa6d4163eb92dda378558c3c/tutorial/Credenciais_API.pdf --------------------------------------------------------------------------------