Skip to content

Instantly share code, notes, and snippets.

@mackignacio
Last active July 22, 2022 04:19
Show Gist options
  • Save mackignacio/73e8945d10177aba65828f8a20bf2e11 to your computer and use it in GitHub Desktop.
Save mackignacio/73e8945d10177aba65828f8a20bf2e11 to your computer and use it in GitHub Desktop.
Payment Provider
@xunylpay
Copy link

xunylpay commented Jul 22, 2022

https://developers.paymongo.com/reference/create-a-link

const options = {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Basic ${base64(env.secretAPIkey)}'
},
body: JSON.stringify({
data: {
attributes: {
amount: 10000,
description: 'Your ',
remarks: 'custom_param1=<USER_ID>&custom_param2=<VIDEO_ID>'
}
}
})
};

fetch('https://api.paymongo.com/v1/links', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment