OSSPhilippines / paymongo

A lightweight Node.js client for Paymongo API

Home Page:https://paymongo.ossph.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about Keys

micahbule opened this issue · comments

As per the documentation, you only need to provide the secret_key to the library for it to work. However, I believe you have to use the public_key to create payment methods, as such resource requires confidential user information (ex. card details) that cannot be sent to the back-end.

Based on your code, I can basically use this library for both client and server, substituting the key parameter with the public_key for client-side use and secret_key for server-side use.

Am I correct with my assumptions?

Hello! Thank you for submitting an issue.

Hello @micahbule we have the same observations actually. Altho I haven't confirmed this part on the frontend yet, it is also not clear in their documentation whether to make a request directly to their api from the client or if it's ok to send it to the backend. Ideally the later would not be the best way to do it. However since they don't have their proprietary checkout library yet, the best way to achieve this would be to make a direct request from client to paymongo api.

I have been integrating similar payment solutions with the same approach, hence the question. I'll probably wait for it to be clarified as well.

Thanks for creating a wrapper library btw. Really useful.

Thanks!

I understand, they really patterned their api with what stripe has, except for the checkout experience. I really wanna see that in the future.

Thanks, I'm glad you liked it.

I will close this for now and will update you here when I get some clarification from them. Stay safe.