0

How to get customer billing agreement data. I can't find a table in the database. can someone guide me to get data or query?

1 Answer 1

1

You can access it from this method :

/**
 * Retrieve billing agreements collection
 *
 * @return \Magento\Paypal\Model\ResourceModel\Billing\Agreement\Collection
 */
public function getBillingAgreements()
{
    if ($this->_billingAgreements === null) {
        $this->_billingAgreements = $this->_agreementCollection->create()->addFieldToFilter(
            'customer_id',
            $this->_customerSession->getCustomerId()
        )->setOrder(
            'agreement_id',
            'desc'
        );
    }
    return $this->_billingAgreements;
}

Defined here: vendor\magento\module-paypal\Block\Billing\Agreements.php

3
  • Do you know where the database been stored? I can't find anything in the database this using a collection right so this has to be stored in somewhere but not sure where exactly. Commented Sep 30, 2019 at 9:57
  • 1
    you can find it here - paypal_billing_agreement and you can find the relevant orders here - paypal_billing_agreement_order
    – Arif Ahmad
    Commented Sep 30, 2019 at 10:09
  • thank you @arif Commented Sep 30, 2019 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.