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

Add local payments for donations 💱 #41

Open
MedouneSGB opened this issue Jul 6, 2023 · 5 comments
Open

Add local payments for donations 💱 #41

MedouneSGB opened this issue Jul 6, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@MedouneSGB
Copy link
Member

Hello team,
J'ai remarqué que la partie faire un don redirigeait juste vers Ko-fi.
Je pense qu'intégrer des moyens de paiements locaux serait une bonne idée.

Ko-Fi :
image

@NDOY3M4N
Copy link
Member

NDOY3M4N commented Jul 6, 2023

Hi master @MedouneSGB, tu as raison hein ajouter un moyen de paiement local pour les dons serait une bonne idée pour faciliter les dons. Faudra juste trouver l'API idéale à nos besoins

@NDOY3M4N NDOY3M4N added the help wanted Extra attention is needed label Jul 6, 2023
@daoodaba975
Copy link
Member

Yes @MedouneSGB je pense qu'on va essayer de voir avec Paytech et l'intégrer directement dans le site.

@MedouneSGB
Copy link
Member Author

Yeah ça serait super !

@daoodaba975 daoodaba975 added enhancement New feature or request and removed help wanted Extra attention is needed labels Sep 17, 2023
@hakimLyon
Copy link
Contributor

hakimLyon commented Nov 2, 2023

Je me suis amuser un peu avec l'api Paytech, surtout qu'il n'ya pas de doc pour typescript.

import type {
	PayDataProps,
	PayTech,
	PayTechOptions,
	PaymentResponse,
} from '~/types'
import { getRequiredServerEnvVar } from '~/utils/misc'

declare global {
	interface Window {
		PayTech: {
			new (options: PayTechOptions): PayTech
			OPEN_IN_POPUP: number
		}
	}
}

export async function pay(params: PayDataProps) {
	try {
		const result = await fetch(
			getRequiredServerEnvVar('PAYTECH_REQUEST_URL'),

			{
				method: 'POST',
				body: JSON.stringify(params),
				headers: {
					Accept: 'application/json',
					'Content-Type': 'application/json',
					API_KEY: getRequiredServerEnvVar('PAYTECH_API_KEY'),
					API_SECRET: getRequiredServerEnvVar('PAYTECH_API_SECRET'),
				},
			},
		)
		const data: PaymentResponse = await result.json()
		return data
	} catch (e) {
		console.error(e)
	}
}

@daoodaba975
Copy link
Member

Nice @hakimLyon !
Je pense qu'on va bientôt essayer de l'implémenter.

@daoodaba975 daoodaba975 changed the title Add local payments for donations Add local payments for donations 💱 Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants