Disable a recurring contract

@param string $recurringDetailReference
@param string $shopperReference
@param int|Mage_Core_model_Store|null $store

@throws Adyen_Payment_Exception
@return bool
14709
public function disableRecurringContract($recurringDetailReference, $shopperReference, $store = null)
    {
        $merchantAccount = $this->_helper()->getConfigData('merchantAccount', null, $store);

        $request = array(
            "action" => "Recurring.disable",
            "disableRequest.merchantAccount" => $merchantAccount,
            "disableRequest.shopperReference" => $shopperReference,
            "disableRequest.recurringDetailReference" => $recurringDetailReference
        );

        $result = $this->_doRequest($request, $store);

        // convert result to utf8 characters
        $result = utf8_encode(urldecode($result));

        if ($result != "disableResult.response=[detail-successfully-disabled]") {
            Adyen_Payment_Exception::throwException(Mage::helper('adyen')->__($result));
        }

        return true;
    }
1262065
@Override
	public void clearCache(CommerceOrderPayment commerceOrderPayment) {
		entityCache.removeResult(CommerceOrderPaymentModelImpl.ENTITY_CACHE_ENABLED,
			CommerceOrderPaymentImpl.class, commerceOrderPayment.getPrimaryKey());

		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}
75537
public static com.liferay.commerce.model.CommerceOrderPayment deleteCommerceOrderPayment(
		com.liferay.commerce.model.CommerceOrderPayment commerceOrderPayment) {
		return getService().deleteCommerceOrderPayment(commerceOrderPayment);
	}
154795
protected void unsetLocalTransactionCurrent(ServiceReference<LocalTransactionCurrent> ref) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "unsetLocalTransactionCurrent", "unsetting " + ref);
        }
        localTransactionCurrentRef.unsetReference(ref);
    }
698654
protected function _updateExistingBillingAgreementsStatus($customerReference, $recurringReferencesList)
    {
        $billingAgreements = Mage::getResourceModel('adyen/billing_agreement_collection')
            ->addFieldToFilter('customer_id', $customerReference);

        foreach ($billingAgreements as $billingAgreement) {
            if (!in_array($billingAgreement->getReferenceId(), $recurringReferencesList)) {
                $billingAgreement->setStatus(Adyen_Payment_Model_Billing_Agreement::STATUS_CANCELED);
            } else {
                $billingAgreement->setStatus(Adyen_Payment_Model_Billing_Agreement::STATUS_ACTIVE);
            }

            $billingAgreement->save();
        }
    }
784322
@Override
	public void cacheResult(
		CommercePaymentMethodGroupRel commercePaymentMethodGroupRel) {
		entityCache.putResult(CommercePaymentMethodGroupRelModelImpl.ENTITY_CACHE_ENABLED,
			CommercePaymentMethodGroupRelImpl.class,
			commercePaymentMethodGroupRel.getPrimaryKey(),
			commercePaymentMethodGroupRel);

		finderCache.putResult(FINDER_PATH_FETCH_BY_G_E,
			new Object[] {
				commercePaymentMethodGroupRel.getGroupId(),
				commercePaymentMethodGroupRel.getEngineKey()
			}, commercePaymentMethodGroupRel);

		commercePaymentMethodGroupRel.resetOriginalValues();
	}
220792
public function hasReference( $reference, &$referenceDetail = null )
    {

        $referenceDetail = null;

        foreach( $this->__get('references') as $name => $detail ) {

            if( $name == $reference or $detail[0] == $reference ) {
                $referenceDetail = $detail;
                return $name;
            }

        }

        return null;

    }
106772
public function getTransactionInvoiceReference($invoiceReference)
    {
        if (empty($invoiceReference)) {
            throw new InvalidArgumentException();
        }

        return $this->getRequest([
            self::API_TRANSACTION_INVOICE_REFERENCE_QUERY,
            ['InvoiceReference' => $invoiceReference]
        ]);
    }
274627
public function removeReference(ViewReference $viewReference)
    {
        $referenceId = $viewReference->getId();
        if ($url = $this->repository->findValueForId('url', $referenceId)) {
            // Remove url
            $this->manager->removeUrl($url, $viewReference->getLocale());
        }
        // Remove reference
        $this->manager->remove($referenceId);
    }
382476
public function disablePaymentInstrument(
        CustomerInterface $customer,
        PaymentInstrumentInterface $paymentInstrument
    ): bool
    {
        $instrumentClient = new PaymentInstrumentClient($this->getContext(), $this->getOptions());
        $instrumentClient->setCustomer($customer);
        $instrumentClient->setToken($this->getToken());
        $response = $instrumentClient->disable($paymentInstrument);
        $this->setLastResponse($instrumentClient->getLastResponse());

        return $response??false;
    }
762664
@Override
	public void cacheResult(CommerceOrderPayment commerceOrderPayment) {
		entityCache.putResult(CommerceOrderPaymentModelImpl.ENTITY_CACHE_ENABLED,
			CommerceOrderPaymentImpl.class,
			commerceOrderPayment.getPrimaryKey(), commerceOrderPayment);

		commerceOrderPayment.resetOriginalValues();
	}
4424
public function delete(RecurringApplicationCharge $recurringApplicationCharge)
    {
        $endpoint= '/admin/recurring_application_charges/'.$recurringApplicationCharge->id.'.json';
        $response = $this->request($endpoint, 'DELETE');
    }
208360
public function PaymentOrderDetailByMerchant($merchantOrderId, array $addElements = array())
    {
        $request = new Request();
        $request->setMethod('GET');

        if (null == $merchantOrderId) {
            throw new InvalidArgumentException('merchantOrderId');
        }

        $qs = array(
            'MerchantOrderId' => $merchantOrderId,
            'MerchantId'      => $this->options['merchantId']
        );

        if ($addElements) {
            $qs['AddElements'] = implode(',', $addElements);
        }

        return $this->doRequest('PaymentOrder/Detail', $request, $qs)->getContentJson();
    }
869773
public function isPaymentOnlyCheckoutEnabled($store = null)
    {
        return $this->getScopeConfig()->isSetFlag(
            self::XML_PATH_PAYMENT_ONLY_CHECKOUT,
            ScopeInterface::SCOPE_STORE,
            $store
        );
    }
886646
protected function setExpressCheckoutRecurringPaymentConfig($data, $subscription = false)
    {
        $billingType = $this->billingType;

        // Overwrite billing type if $subscription flag is enabled
        if ($subscription) {
            $billingType = 'RecurringPayments';
        }

        // Send L_BILLINGTYPE0 and L_BILLINGAGREEMENTDESCRIPTION0 only if there is billing type
        if (isset($billingType)) {
            $this->post = $this->post->merge([
                'L_BILLINGTYPE0'                 => $billingType,
                'L_BILLINGAGREEMENTDESCRIPTION0' => !empty($data['subscription_desc']) ?
                    $data['subscription_desc'] : $data['invoice_description'],
            ]);
        }
    }
1306187
public function recurring($schedule, $amount, $cardOrTokenOrPMKey, $cardHolder = null, $oneTime = false, $details = null)
    {
        $this->_amount = HpsInputValidation::checkAmount($amount);

        $xml = new DOMDocument();
        $hpsTransaction = $xml->createElement('hps:Transaction');
        $hpsRecurringBilling = $xml->createElement('hps:RecurringBilling');
        $hpsBlock1 = $xml->createElement('hps:Block1');

        $hpsBlock1->appendChild($xml->createElement('hps:AllowDup', 'Y'));
        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $amount));
        if ($cardHolder != null) {
            $hpsBlock1->appendChild($this->_hydrateCardHolderData($cardHolder, $xml));
        }
        if ($details != null) {
            $hpsBlock1->appendChild($this->_hydrateAdditionalTxnFields($details, $xml));
        }

        if ($cardOrTokenOrPMKey instanceof HpsCreditCard) {
            $cardData = $xml->createElement('hps:CardData');
            $cardData->appendChild($this->_hydrateManualEntry($cardOrTokenOrPMKey, $xml));
            $hpsBlock1->appendChild($cardData);
        } else if ($cardOrTokenOrPMKey instanceof HpsTokenData) {
            $cardData = $xml->createElement('hps:CardData');
            $cardData->appendChild($this->_hydrateTokenData($cardOrTokenOrPMKey, $xml));
            $hpsBlock1->appendChild($cardData);
        } else {
            $hpsBlock1->appendChild($xml->createElement('hps:PaymentMethodKey', $cardOrTokenOrPMKey));
        }

        $id = $schedule;
        if ($schedule instanceof HpsPayPlanSchedule) {
            $id = $schedule->scheduleIdentifier;
        }
        $recurringData = $xml->createElement('hps:RecurringData');
        $recurringData->appendChild($xml->createElement('hps:ScheduleID', $id));
        $recurringData->appendChild($xml->createElement('hps:OneTime', ($oneTime ? 'Y' : 'N')));

        $hpsBlock1->appendChild($recurringData);
        $hpsRecurringBilling->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsRecurringBilling);

        return $this->_submitTransaction($hpsTransaction, 'RecurringBilling', (isset($details->clientTransactionId) ? $details->clientTransactionId : null), $cardOrTokenOrPMKey);
    }
1327950
public function setRepositoryReference(RepositoryReference $repositoryReference)
    {
        parent::setRepositoryReference($repositoryReference);
        $this
            ->repository
            ->setRepositoryReference($repositoryReference);
    }