Support

Home Forums Event Espresso Premium Developing Custom Payment Method EE4 – Access extra_meta_inputs from Gateway

Developing Custom Payment Method EE4 – Access extra_meta_inputs from Gateway

Posted: September 22, 2020 at 12:13 am


tfkcc

September 22, 2020 at 12:13 am

public function generate_new_settings_form() {
$form = new EE_Payment_Method_Form(array(

'extra_meta_inputs'=>array(
'public_key'=>new EE_Text_Input(array(
'html_label_text'=> "Secure Submit Public Key"
)),
'secret_key'=>new EE_Text_Input(array(
'html_label_text'=> "Secure Submit Secret Key"
))
)
));
return $form;
}

How do I access these saved setting values from the gateway class and the pm form builder class?

I tried this, but it doesn’t work:


$this->_public_key = $this->_pm_instance->get_extra_meta("public_key");


Tony

  • Support Staff

September 23, 2020 at 3:59 am

Hi there,

I don’t think it’s possible to pull the instance of a payment method from within that class currently, not easily a least.

I can double check on this, may I ask why you need those values within the gateway class?


tfkcc

October 31, 2020 at 6:36 pm

Sorry for the late reply, but I need to access these values as they are ultimately used by the payment processor:

https://github.com/own3mall/secure-submit-heartland-payments-event-espresso-4-payment-plugin/blob/f0408f077d5f97de5d1882c87b54b6b3d215506f/src/event-espresso-4-secure-submit/payment_methods/Secure_Submit_Payment_Method_Onsite/EE_PMT_Secure_Submit_Payment_Method_Onsite.pm.php#L38


tfkcc

October 31, 2020 at 6:37 pm

I did create a work-around as shown in the code, but I was hoping it was going to be a lot easier.

The support post ‘Developing Custom Payment Method EE4 – Access extra_meta_inputs from Gateway’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: closed

Updated by  tfkcc 2 months, 4 weeks ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!