Closed vickymessii closed 6 years ago
It's very strange to see Call to undefined method Braintree\Gateway::webhookNotification()
in your error logs, because that is definitely defined: https://github.com/braintree/braintree_php/blob/1307b7c7ab0fc05a0dc8f2492acd9003a06ca298/lib/Braintree/Gateway.php#L255
I would have expected to see Call to undefined method Braintree\Gateway::webhookTesting()
, which is currently missing and I'm working on adding it.
Are you sure it says webhookNotification
and not webhookTesting
?
If I change $sampleNotification = $gateway->webhookTesting()->sampleNotification(
to $sampleNotification = Braintree_WebhookTesting()->sampleNotification(
, it proceeds past that point. Not sure why you're trying to pull a subscription id off of the merchant account approved webhok, but if I remove that line, the rest works with the modification.
I got both errors
[14-Mar-2018 14:44:17 UTC] PHP Fatal error: Call to undefined method Braintree\Gateway::webhookTesting() in /checkout.php on line 47
[14-Mar-2018 14:44:17 UTC] PHP Fatal error: Call to undefined method Braintree\Gateway::webhookNotification() in /webhook.php on line 9
You means to say i have to remove subscription id ?? am i right ??
have a look at Webhook.php
<?php
ini_set('display_errors', 1);
require_once("../includes/braintree_init.php");
if (
isset($_POST["bt_signature"]) &&
isset($_POST["bt_payload"])
) {
$webhookNotification = $gateway->webhookNotification()->parse(
$_POST["bt_signature"], $_POST["bt_payload"]
);
// Example values for webhook notification properties
$message = $webhookNotification->kind; // "subscription_went_past_due"
$message = $webhookNotification->timestamp->format('D M j G:i:s T Y'); // "Sun Jan 1 00:00:00 UTC 2012"
file_put_contents("/tmp/webhook.log", $message, FILE_APPEND);
}
I'm unable to reproduce and nothing in that file looks wrong to me, so my guess is something isn't being set correctly braintree_init.php
. Please contact our support team and reference this github issue so we can further dig into what's wrong with your integration.
I have setup the braintree_init.php
properly because if the incorrect is in braintree_init.php
I can't create the submerchant account. but its creating the submerchant and also doing payment if i skip the webhook step.
I thing i need to know can i do the payment without Webhook??
I still recommend contacting our support team. They'll be better equipped to help you debug your integration.
Ok Thanks
Hey,
Now I got new Error
Uncaught exception 'Braintree\Exception\Configuration' with message 'Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway).
Question is that if my merchant ID is not how its creating sub merchant because i able to see sub merchant account in my dashboard but i am going to call this method:
$webhookNotification = Braintree\WebhookNotification::parse($sampleNotification['bt_signature'], $sampleNotification['bt_payload']);
it says
Uncaught exception 'Braintree\Exception\Configuration' with message 'Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway).
That suggests to me that your configuration is not set up correctly. I noticed that you're using Braintree\WebhookNotification
instead of the $gateway
variable, so you'll need to set up the global configuration:
Braintree\Configuration::environment('sandbox'); // or production
Braintree\Configuration::merchantId('your_merchant_id');
Braintree\Configuration::publicKey('your_public_id');
Braintree\Configuration::privateKey('your_private_key');
I still think this is an issue with your specific integration, and not the SDK, so it's better handled by contacting support. They can help you dig into the specifics of your integration.
General information
Issue description
I am using PHP SDK for Braintree Market Place Payment,Need to Webhook Notifications , I tried to implement webhook but I can't figure out this. I got this error
Call to undefined method Braintree\Gateway::webhookNotification()
I am using this Code The Amount and payment_method_nonce is Coming from Dropin Ui braintree For Single Payment and also without Webhook Notification its working fine.
In My Error Log I got this Error
Call to undefined method Braintree\Gateway::webhookNotification()
Anyone can help?