Development

Accessing the subscriptions related to a payment

Issue

To create an invoice (or other means of payment record) you need to access all subscriptions tied to a payment record.

Solution

Since each payment can actually be attributed to multiple subscription types (i.e. it's not a 1:1 relationship), the best way is to use the AmbrasubsHelperPayment::getUsers($payment_id); method.

You can locate that code here:

admin/helpers/payment.php

This will return an array of objects for each user/subscription-type associated with the paymnet with the payments. Each object will include subscription type's information (useful for creating an invoice or other payment record)


This development document is valid for AmbraSubscriptions version 1.5.3c+

#6000

Viagra Online Pharmacy