コード例 #1
0
 /**
  * Gets the form for displaying to attendees where they can enter their billing info
  * which will be sent to teh gateway (can be null)
  *
  * @param \EE_Transaction $transaction
  * @param array $extra_args
  * @return \EE_Billing_Attendee_Info_Form|\EE_Billing_Info_Form|null
  */
 public function billing_form(EE_Transaction $transaction = NULL, $extra_args = array())
 {
     // has billing form already been regenerated ? or overwrite cache?
     if (!$this->_billing_form instanceof EE_Billing_Info_Form || !$this->_cache_billing_form) {
         $this->_billing_form = $this->generate_new_billing_form($transaction, $extra_args);
     }
     //if we know who the attendee is, and this is a billing form
     //that uses attendee info, populate it
     if ($this->_billing_form instanceof EE_Billing_Attendee_Info_Form && $transaction instanceof EE_Transaction && $transaction->primary_registration() instanceof EE_Registration && $transaction->primary_registration()->attendee() instanceof EE_Attendee) {
         $this->_billing_form->populate_from_attendee($transaction->primary_registration()->attendee());
     }
     return $this->_billing_form;
 }