Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Call to undefined method Omnipay\PayPal\RestGateway::set() #103

Open
hoegrammer opened this issue Mar 21, 2019 · 14 comments
Open

Error: Call to undefined method Omnipay\PayPal\RestGateway::set() #103

hoegrammer opened this issue Mar 21, 2019 · 14 comments

Comments

@hoegrammer
Copy link

Hi, I'm getting that error when using a webform. The processor is set to "Paypal Checkout"

@hoegrammer
Copy link
Author

Actually I get the same error when using the contribution page directly:

  | Error: Call to undefined method Omnipay\PayPal\RestGateway::set() in CRM_Core_Payment_OmnipayMultiProcessor->setProcessorFields() (line 318 of /var/www/mysite/sites/default/files/civicrm/ext/nz.co.fuzion.omnipaymultiprocessor/CRM/Core/Payment/OmnipayMultiProcessor.php).

@hoegrammer
Copy link
Author

I thought it might be because I was using PHP 7.0 but I am now using 7.2 and getting the same error.

Using the contribution page, I see a nice Paypal button, click it, I get the popup briefly and the popup tries to load, then disappears replaced by an alert saying "the site is not configured correctly to take payments". In watchdog I see the above error.

@eileenmcnaughton
Copy link
Owner

It implies that you have a field filed in in civicrm_payment_processor without a matching value in civicrm_payment_processor_type

@hoegrammer
Copy link
Author

Hello! The fields array is Array ( [Clientid] => myemail+ikm_api1.gmail.com [Secret] => FBM93XJTWAsdfsdZSAB [] => AWkT50gtrA0iXnhXXlAFYAOXzvynv8B4pJTYjDdt44TAJwrSD )

So one of the array keys is blank

@hoegrammer
Copy link
Author

hence $fn = "set{$name}" ending up as "set"

@hoegrammer
Copy link
Author

hoegrammer commented Mar 22, 2019

I've wrapped that bit of code in an if statement checking that $name is not empty.

Now I'm getting this error:

Array
(
    [0] => Authentication failed due to invalid authentication credentials or a missing Authorization header.10,Paypal,46,1,omnipay_PayPal_Rest
)


Which I'm wondering might be due to that thing with the blank array key not being passed?

@eileenmcnaughton
Copy link
Owner

@hoegrammer so the cilentId is not an email in this instance - mine looks like AWzymvrczbgFT9CuhILzNXnXFyLXsxa8lacr_TJbOT4ytdRuaKnr73t1kOIdwbSTmnjTuajgKaiZCjqR

@eileenmcnaughton
Copy link
Owner

& only 2 keys should be set in the payment_processor table username & password

@hoegrammer
Copy link
Author

I generated a client id and secret which are in the right format (using paypal apps section rather than API) and I made a new payment processor and just filled in these fields. Then I made a contribution page and assigned the new processor. The contribution page won't load - I get the error "CRM_Core_Exception: A payment processor configured for this page might be disabled (contact the site administrator for assistance). in /var/www/usdfsdft.crm-dev/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionBase.php on line 349"

It's passing "0" as the processor id I think:

CRM_Core_Form->assignPaymentProcessor('0')

but the id is 2. When I set the payment processor field of the contribution page back to the original processor this doesn't happen

@eileenmcnaughton
Copy link
Owner

0 is the pay later processor -

so you have 2 new entries in civicrm_payment_processor and when you look at the values for processor_id in civicrm_contribution_page it has the id of the live one of those 2?

@hoegrammer
Copy link
Author

Yes

@hoegrammer
Copy link
Author

select * from civicrm_payment_processor where id = 11;
+----+-----------+----------+-------------+---------------------------+-----------+------------+---------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+-------------------+-------------------+-------------------+------------+---------+-------------------------------+--------------+----------+--------------+-----------------------+-----------------------+
| id | domain_id | name | description | payment_processor_type_id | is_active | is_default | is_test | user_name | password | signature | url_site | url_api | url_recur | url_button | subject | class_name | billing_mode | is_recur | payment_type | payment_instrument_id | accepted_credit_cards |
+----+-----------+----------+-------------+---------------------------+-----------+------------+---------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+-------------------+-------------------+-------------------+------------+---------+-------------------------------+--------------+----------+--------------+-----------------------+-----------------------+
| 11 | 1 | Paypal 2 | NULL | 46 | 1 | 1 | 0 | AWg9iMcYVCN-3VltTHKcgYYYU9gip9wGEv1B_wABB4-irwLSdk79VfUXrnsIxXZD9Vig7qA305k9h8Q0 | EKqbOM3UpMKeG8nDaXtLB6JBAURPZ2AvQevS60UpZTBoAKDHudzL1z8xjAsRf89_-7fuiV_wJ23nD1th | NULL | http://unused.com | http://unused.com | http://unused.com | NULL | NULL | Payment_OmnipayMultiProcessor | 4 | 1 | 1 | 1 | {"Visa":"Visa"} |
+----+-----------+----------+-------------+---------------------------+-----------+------------+---------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+-------------------+-------------------+-------------------+------------+---------+-------------------------------+--------------+----------+--------------+-----------------------+-----------------------+
1 row in set (0.00 sec)

select payment_processor from civicrm_contribution_page where id = 2;
+-------------------+
| payment_processor |
+-------------------+
| 11 |
+-------------------+

@eileenmcnaughton
Copy link
Owner

OK - so that looks wrong - the processor id 11 is the test mode processor - the LIVE one should be the one saved into civicrm_contribution_page - presumably number 10? (it then picks up the test one when you are in test mode)

@eileenmcnaughton
Copy link
Owner

Also this patch is required civicrm/civicrm-core#13798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants