Support

Home Forums Event Espresso Premium Problem with mandatory state field in "Pay By Credit Card"

Problem with mandatory state field in "Pay By Credit Card"

Posted: October 6, 2015 at 6:42 am


simone

October 6, 2015 at 6:42 am

Hello to everyone,

i’m not sure how set the state’s field in the checkout page with user country others than USA or Canada.
For example, When an italian user fill in the form with his personal informations and credit card, the state is mandatory and it shows only Usa and Canada states. In Europe that field is not mandatory for bank gateway and also for paypal.
Also, Disabling that field is not allowed because that form belongs to a system group.

What is the right solution?
Very Thanks in advance.
Simone


simone

October 6, 2015 at 8:08 am

After a google search, i have found out the state field is mandatory for credit card payment in USA and Canada and optional in Europe.
I think i have to add additional conditional control in the registration page to check if state is optional or not depending on country selection.
Is this the right way?
thank you again for your help


Josh

  • Support Staff

October 6, 2015 at 12:25 pm

Hi Simone,

I’m not 100% sure if you’re referring to the credit card billing form, the registration form, or both. So I’ll give you some information about both forms.

For the registration form, you can set the state/province field to be Optional in the Event Espresso question editor where it asks Required Question?

Then on the credit card billing form, you can change the default behavior to display a text field instead of a dropdown selector (where it might not have all the relevant choices). You can also change it so it’s not required. Here’s some example code that can be added to a function plugin:

add_filter( 'FHEE__EE_Billing_Attendee_Info_Form__state_field', 'ee_billing_locale_text_field', 10, 1 );
add_filter( 'FHEE__EE_Billing_Attendee_Info_Form__country_field', 'ee_billing_locale_text_field', 10, 1 );
function ee_billing_locale_text_field( $original_field ) {
    return new EE_Text_Input( 
     array( 
     'required' => false, // make it optional
     'html_class' => 'ee-billing-qstn' // make it a text field
    ));
}


simone

October 8, 2015 at 7:51 am

Thanks Josh,
I wsa reffering to the credit card billing form
ok, now the field is optional, thought is a text imput and not a select. The problem now is that it has a zero as default value. Can i remove it?
Also, i need to have the zip field optional, but the following code doesn’t work:

add_filter( 'FHEE__EE_Billing_Attendee_Info_Form__zip_field', 'ee_billing_locale_text_field', 10, 1 );
function ee_billing_locale_text_field( $original_field ) {
    return new EE_Text_Input( 
     array( 
     'required' => false // make it optional
    ));
}

thanks for helping me,
Simone


Lorenzo Orlando Caum

  • Support Staff

October 8, 2015 at 10:39 am

Hi Simone,

I think I know what is happening with the zero and I’ve asked our development team for feedback. Zip/postal code is currently required and doesn’t have a filter to override.

I’ve asked about introducing one. We’ll update this support post once we have more information.

Thanks


Lorenzo


Lorenzo Orlando Caum

  • Support Staff

October 8, 2015 at 1:33 pm

Hello again Simone,

Could you tell us more about what happens if a registrant/attendee is registering and paying from a country that does not use state/provinces and/or zip/postal codes?

The issue that we are seeing is that some payment processors such as Authorizenet require some of those fields for Europe.

Thanks


Lorenzo


simone

October 9, 2015 at 2:40 am

Hello Lorenzo,

payment by credit card is available thanks to PayPalPro payment methods activated in wp-admin/EE4 settings. Now, i have set the field optional, thanks to your helps, but i didn’t test the payment. In Europe, state, zip and other address field are not mandatory, I can pay everything olly with credit card information and my name and last name.
But I’m going to test the payment and I will inform you about it.

Hope this will be usefull,
Simone


simone

October 9, 2015 at 3:06 am

I have done a test with the optional field and the response at the end of transaction was : the transaction cannot be processed due to an invalid merchant configuration.


simone

October 9, 2015 at 3:32 am

Dear All,

i was able to apply the PayPalPro payment from the EE4admin/transaction/apply payment with paypal pro selected. EE4 said me that the payment was applied and it updated the status, but i’m not sure if the transaction was effectively completed.
From the billing form page any test transactions works, and the response was always: the transaction cannot be processed due to an invalid merchant configuration.

What can be wrong in the configuration?

I’m a little confused.


Tony

  • Support Staff

October 9, 2015 at 5:14 am

From the billing form page any test transactions works, and the response was always: the transaction cannot be processed due to an invalid merchant configuration.

Do you have a PayPal Pro account and included the API details within the PayPal Pro payment method settings within EE?

Or do you have a PayPal Standard account?

A PayPal pro account will will be paying a monthly fee to PayPal for (separate from the transaction costs)


simone

October 12, 2015 at 9:14 am

Dear Tony,

thanks for your reply, yes my customer has a paypal pro account, but for know i disabled and ask to customer to pay via PayPal standard and choose pay without registering.

I use that account also for another plugin and it seems it works fine, but i haven’t test in the last two months, but it’is online. I asked to my customer to check if effectivly pay fee to PayPal.

Thank for support,
Simone


Lorenzo Orlando Caum

  • Support Staff

October 12, 2015 at 9:36 am

Thanks Simone, please do keep us updated as an active PayPal Pro account should process without the merchant configuration error.


Lorenzo


simone

October 14, 2015 at 5:30 am

Hello to everyone,

I have checked PayPalPro account and it is working. So, i don’t know why. There are a way to have a detailed paypal response when payment falls?

As I mentioned before, I preferred to disable PayPalPro and use only PayPal standard to let users registering on the event.

Thanks,
Simone


Tony

  • Support Staff

October 14, 2015 at 10:11 am

the transaction cannot be processed due to an invalid merchant configuration

That error only happens with PayPal Pro and generally means the PayPal account details you are using within Event Espresso -> Payment Methods -> PayPal Pro are either incorrect OR the account you are using within those setting is not setup for PayPal Pro.

EE4admin/transaction/apply payment with paypal pro selected. EE4 said me that the payment was applied and it updated the status, but i’m not sure if the transaction was effectively completed.

That is a manual payment and does NOT run the payment through PayPal themselves, it is basically availabel to provide you with a way to reference payments made outside of Event Espresso.

There are a way to have a detailed paypal response when payment falls?

The error message from above is the wrror sent directly from PayPal, that is the full error. Unfortunately there is no way to get further details from this.

As I mentioned before, I preferred to disable PayPalPro and use only PayPal standard to let users registering on the event.

What happens when you use PayPal Standard currently?


simone

October 19, 2015 at 7:05 am

Thank you Tony for the full explanation.

What happens when you use PayPal Standard currently?

Simply users are redirected to paypal.com and they can choose to pay without have a paypal account. I have added a short note in the event page to suggest them to choose paypal payment also to pay with credit card.

That is a manual payment and does NOT run the payment through PayPal themselves, it is basically availabel to provide you with a way to reference payments made outside of Event Espresso.

I have imagined it, so i reserve to perform additional test whit paypalpro when i have enough time! 🙂

Thank for prompt help,
really appreciated

Simone


Lorenzo Orlando Caum

  • Support Staff

October 19, 2015 at 10:58 am

Hello again Simone,

If it does not work again when you re-test, then could you try regenerating your API credentials for PayPal through PayPal.com and then update those in Event Espresso payment settings for PayPal Pro in your WP dashboard?


Lorenzo


Lorenzo Orlando Caum

  • Support Staff

November 18, 2015 at 7:38 am

Hi Simone,

The zero appearing on the auto-fill fields for state/province was resolved in a current version of Event Espresso.


Lorenzo


simone

November 18, 2015 at 7:40 am

Dear Lorenzo,

thanks for the news!

Simone

The support post ‘Problem with mandatory state field in "Pay By Credit Card"’ 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.

Event Espresso