Discussions

Ask a Question

Webhook keeps on getting disabled

Hello guys, I am not sure how I can fix these errors. My webhook gets disabled everytime there is a successful purchase on my website. This is paymongo's email to me 1. Your endpoint is blocking the request. Your endpoint should allow POST requests on SSL port 443 2. Your endpoint is not public. Your endpoint should be publicly visible so PayMongo can send events. I am not sure how to fix it. My webhost (namecheap) can't help me unless they can replicate the error. I tried disabling the plugins except for (Events Calendar, Event Tickets, Woocommerce). I even set my theme to the default 2024 but still I get the error. Anyone that know how to fix this? Thanks,

Redirect Customer after paying

Hi, Would it be possible to direct my client to my (New link) booking Page after paying me?

CORS error

Hi, our paymongo integration was working fine but now we're suddenly getting this CORS error - we didn't make any code changes. Is there anything that was changed to Paymongo API on your side? What can we do to resolve this? Access to fetch at '<https://api.paymongo.com/v1/merchants/capabilities/payment_methods'> from origin '<http://127.0.0.1:5173'> has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. Thanks!

Need help with my webhook signature on laravel/PHP

public function test(Request $request){ ``` $signingSecret = 'sk_test_UVzt5mdhyRgoZxK1C7YimXaV'; $header_signature = $request->header('Paymongo_Signature'); $header_signature_res =preg_split("/,/",$header_signature); $header_time_no_equal = preg_split("/=/",$header_signature_res[0]); //contains the time ex: 1716800978 $header_time_no_equal_res = $header_time_no_equal[1]; $header_string_no_equal = preg_split("/=/",$header_signature_res[1]); //contains the test mode signature without the 'te=' ex: 1447a89e7ecebeda32sffs62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd $header_string_no_equal_res = $header_string_no_equal[1]; $payload= $request->getContent(); //concatinated the time and $request->getContent() ex:1716800978{json response data} and the second value is my secret key ex: sk_test_UVzt5mdhyRgoZxK1C7YimXaV $computedSignature = hash_hmac('sha256',$header_time_no_equal_res.$payload, $signingSecret); $signature = hash_equals($header_string_no_equal_res.$header_string_no_equal_res,$computedSignature); if($signature == 1 || $signature == true){ WebhookCall::insert([ 'payload' =>'valid', ]); }else{ WebhookCall::insert([ 'payload' =>'Invalid' ]); } } ``` May I ask you guys how to construc a signature validator in paymongo? when I try running this program, the has_hmac() return value always return 0 instead of true. any help from you guys. Thanks in advance

Securing a Webhook.

I did not understand this part of instruction. Could you elaborate further and provide an example of how the data should be look? <br /> 2. Concatenate the following to create your own signature: a. The timestamp as a string, e.g. 1496734173 b. A . character c. The JSON payload of the request you received. NOTE: You must get the raw payload of the request. Check your programming language or frameworks on how to get the raw payload of an API request.

What should I do if I encounter a 429 error?

Error code: 429

sandbox

how to access the sandbox environment in paymongo and how to use it? can you helpme?

Why is my webhook not working on Livemode?

Webhook is fine when I'm testing it out using TEST API but when I use LIVE API KEYS it does not work?

TypeError: paymongo.paymentMethods.create is not a function

i got this code from paymongo-node sdks github repo. <https://github.com/paymongo/paymongo-node> const paymongo = require('paymongo-node')(process.env.NODE_ENV_PAYMONGO_SECRET); const createPayIntent = async (amount) => { const result = await paymongo.paymentIntents.create({ amount: amount,is not a function payment_method_allowed: ['paymaya', 'gcash'], payment_method_options: {card: {request_three_d_secure: 'any'}}, currency: 'PHP', capture_type: 'automatic', description: 'gcash and paymaya only' }) return result; } this line of code actually works but when i try this. paymongo.paymentMethods.create it does not work. //the code: const createPayMethod = async (name, email, phone, method) => { const result = await paymongo.paymentMethods.create({ billing: {name: name, email: email, phone: phone}, type: method }); return result; } same with paymongo.paymentIntents.attach //the code: const attachPayIntent = async (payIntId, payMetId) => { const result = paymongo.paymentIntents.attach({ payment_method: payMetId, return_url: '<https://www.paymongo.com/academy/the-paymongo-dashboard'> },{id: payIntId}) return result; } it both producess the same error. is not a function please help.

create wallet account

how to create wallet id