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?

| improve this question | | | | |
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

| improve this answer | | | | |
  • 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. – jibin george Sep 30 '19 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 Sep 30 '19 at 10:09
  • thank you @arif – jibin george Sep 30 '19 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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