/**
  * Sets the initial payment method properties (including extra meta)
  *
  * @param EE_Payment_Method $payment_method
  * @return EE_Payment_Method
  * @throws \EE_Error
  */
 public function initialize_payment_method($payment_method)
 {
     $pm_type_obj = $payment_method->type_obj();
     $payment_method->set_description($pm_type_obj->default_description());
     if (!$payment_method->button_url()) {
         $payment_method->set_button_url($pm_type_obj->default_button_url());
     }
     //now add setup its default extra meta properties
     $extra_metas = $pm_type_obj->settings_form()->extra_meta_inputs();
     if (!empty($extra_metas)) {
         //verify the payment method has an ID before adding extra meta
         if (!$payment_method->ID()) {
             $payment_method->save();
         }
         foreach ($extra_metas as $meta_name => $input) {
             $payment_method->update_extra_meta($meta_name, $input->raw_value());
         }
     }
     return $payment_method;
 }