mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1319-email-optin
This commit is contained in:
commit
0340bf1305
11
CHANGELOG.md
11
CHANGELOG.md
@ -4,8 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d
|
|||||||
|
|
||||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||||
|
|
||||||
|
#### [1.6.1](https://github.com/gradido/gradido/compare/1.6.0...1.6.1)
|
||||||
|
|
||||||
|
- Check if user email is activated to make a creation. [`#1356`](https://github.com/gradido/gradido/pull/1356)
|
||||||
|
- fix: Creation Confirmation User Ids [`#1345`](https://github.com/gradido/gradido/pull/1345)
|
||||||
|
- fix and improve test [`1c833d3`](https://github.com/gradido/gradido/commit/1c833d394f502a7aed2b5a648c0171a2fe4ee1e6)
|
||||||
|
- rewrote elopage hook to handle actual elopage hook [`65bc347`](https://github.com/gradido/gradido/commit/65bc3479fa169920eff57b5a2fa662a4090d7364)
|
||||||
|
- simple test for mass creation, improved test for single creation [`ffc4727`](https://github.com/gradido/gradido/commit/ffc4727e7a7105ac5dc97515b901be8dbe415627)
|
||||||
|
|
||||||
#### [1.6.0](https://github.com/gradido/gradido/compare/1.5.1...1.6.0)
|
#### [1.6.0](https://github.com/gradido/gradido/compare/1.5.1...1.6.0)
|
||||||
|
|
||||||
|
> 27 January 2022
|
||||||
|
|
||||||
|
- v1.6.0 [`#1357`](https://github.com/gradido/gradido/pull/1357)
|
||||||
- fix updatePendingCreation method [`#1346`](https://github.com/gradido/gradido/pull/1346)
|
- fix updatePendingCreation method [`#1346`](https://github.com/gradido/gradido/pull/1346)
|
||||||
- klicktipp_config [`#1348`](https://github.com/gradido/gradido/pull/1348)
|
- klicktipp_config [`#1348`](https://github.com/gradido/gradido/pull/1348)
|
||||||
- 1351 form to create incorrect due to change of bootstrap version [`#1352`](https://github.com/gradido/gradido/pull/1352)
|
- 1351 form to create incorrect due to change of bootstrap version [`#1352`](https://github.com/gradido/gradido/pull/1352)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"description": "Administraion Interface for Gradido",
|
"description": "Administraion Interface for Gradido",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Moriz Wahl",
|
"author": "Moriz Wahl",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"bookmark": "bookmark",
|
"bookmark": "bookmark",
|
||||||
"confirmed": "bestätigt",
|
"confirmed": "bestätigt",
|
||||||
"creation_form": {
|
"creation_form": {
|
||||||
"creation_for": "Schöpfung für",
|
"creation_for": "Aktives Grundeinkommen für",
|
||||||
"enter_text": "Text eintragen",
|
"enter_text": "Text eintragen",
|
||||||
"form": "Schöpfungsformular",
|
"form": "Schöpfungsformular",
|
||||||
"min_characters": "Mindestens 10 Zeichen eingeben",
|
"min_characters": "Mindestens 10 Zeichen eingeben",
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"bookmark": "Remember",
|
"bookmark": "Remember",
|
||||||
"confirmed": "confirmed",
|
"confirmed": "confirmed",
|
||||||
"creation_form": {
|
"creation_form": {
|
||||||
"creation_for": "Creation for",
|
"creation_for": "Active Basic Income for",
|
||||||
"enter_text": "Enter text",
|
"enter_text": "Enter text",
|
||||||
"form": "Creation form",
|
"form": "Creation form",
|
||||||
"min_characters": "Enter at least 10 characters",
|
"min_characters": "Enter at least 10 characters",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-backend",
|
"name": "gradido-backend",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
|
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/backend",
|
"repository": "https://github.com/gradido/gradido/backend",
|
||||||
|
|||||||
@ -55,8 +55,8 @@ const createServer = async (context: any = serverContext): Promise<any> => {
|
|||||||
|
|
||||||
// bodyparser json
|
// bodyparser json
|
||||||
app.use(express.json())
|
app.use(express.json())
|
||||||
// bodyparser text for elopage
|
// bodyparser urlencoded for elopage
|
||||||
app.use(express.text())
|
app.use(express.urlencoded({ extended: true }))
|
||||||
|
|
||||||
// Log every request
|
// Log every request
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -39,65 +39,40 @@ export const elopageWebhook = async (req: any, res: any): Promise<void> => {
|
|||||||
res.status(200).end() // Responding is important
|
res.status(200).end() // Responding is important
|
||||||
const loginElopageBuyRepository = await getCustomRepository(LoginElopageBuysRepository)
|
const loginElopageBuyRepository = await getCustomRepository(LoginElopageBuysRepository)
|
||||||
const loginElopageBuy = new LoginElopageBuys()
|
const loginElopageBuy = new LoginElopageBuys()
|
||||||
let firstName = ''
|
|
||||||
let lastName = ''
|
const {
|
||||||
const entries = req.body.split('&')
|
payer,
|
||||||
entries.forEach((entry: string) => {
|
product,
|
||||||
const keyVal = entry.split('=')
|
publisher,
|
||||||
if (keyVal.length > 2) {
|
// eslint-disable-next-line camelcase
|
||||||
throw new Error(`Error parsing entry '${entry}'`)
|
order_id,
|
||||||
}
|
// eslint-disable-next-line camelcase
|
||||||
const key = keyVal[0]
|
product_id,
|
||||||
const val = decodeURIComponent(keyVal[1]).replace('+', ' ').trim()
|
// eslint-disable-next-line camelcase
|
||||||
switch (key) {
|
payment_state,
|
||||||
case 'product[affiliate_program_id]':
|
// eslint-disable-next-line camelcase
|
||||||
loginElopageBuy.affiliateProgramId = parseInt(val)
|
success_date,
|
||||||
break
|
event,
|
||||||
case 'publisher[id]':
|
membership,
|
||||||
loginElopageBuy.publisherId = parseInt(val)
|
} = req.body
|
||||||
break
|
|
||||||
case 'order_id':
|
loginElopageBuy.affiliateProgramId = parseInt(product.affiliate_program_id)
|
||||||
loginElopageBuy.orderId = parseInt(val)
|
loginElopageBuy.publisherId = parseInt(publisher.id)
|
||||||
break
|
loginElopageBuy.orderId = parseInt(order_id)
|
||||||
case 'product_id':
|
loginElopageBuy.productId = parseInt(product_id)
|
||||||
loginElopageBuy.productId = parseInt(val)
|
|
||||||
break
|
|
||||||
case 'product[price]':
|
|
||||||
// TODO: WHAT THE ACTUAL FUK? Please save this as float in the future directly in the database
|
// TODO: WHAT THE ACTUAL FUK? Please save this as float in the future directly in the database
|
||||||
loginElopageBuy.productPrice = Math.trunc(parseFloat(val) * 100)
|
loginElopageBuy.productPrice = Math.trunc(parseFloat(product.price) * 100)
|
||||||
break
|
loginElopageBuy.payerEmail = payer.email
|
||||||
case 'payer[email]':
|
loginElopageBuy.publisherEmail = publisher.email
|
||||||
loginElopageBuy.payerEmail = val
|
// eslint-disable-next-line camelcase
|
||||||
break
|
loginElopageBuy.payed = payment_state === 'paid'
|
||||||
case 'publisher[email]':
|
loginElopageBuy.successDate = new Date(success_date)
|
||||||
loginElopageBuy.publisherEmail = val
|
loginElopageBuy.event = event
|
||||||
break
|
|
||||||
case 'payment_state':
|
|
||||||
loginElopageBuy.payed = val === 'paid'
|
|
||||||
break
|
|
||||||
case 'success_date':
|
|
||||||
loginElopageBuy.successDate = new Date(val)
|
|
||||||
break
|
|
||||||
case 'event':
|
|
||||||
loginElopageBuy.event = val
|
|
||||||
break
|
|
||||||
case 'membership[id]':
|
|
||||||
// TODO this was never set on login_server - its unclear if this is the correct value
|
// TODO this was never set on login_server - its unclear if this is the correct value
|
||||||
loginElopageBuy.elopageUserId = parseInt(val)
|
loginElopageBuy.elopageUserId = parseInt(membership.id)
|
||||||
break
|
|
||||||
case 'payer[first_name]':
|
const firstName = payer.first_name
|
||||||
firstName = val
|
const lastName = payer.last_name
|
||||||
break
|
|
||||||
case 'payer[last_name]':
|
|
||||||
lastName = val
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
// this is too spammy
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
// console.log(`Unknown Elopage Value '${entry}'`)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Do not process certain events
|
// Do not process certain events
|
||||||
if (['lesson.viewed', 'lesson.completed', 'lesson.commented'].includes(loginElopageBuy.event)) {
|
if (['lesson.viewed', 'lesson.completed', 'lesson.commented'].includes(loginElopageBuy.event)) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-database",
|
"name": "gradido-database",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "Gradido Database Tool to execute database migrations",
|
"description": "Gradido Database Tool to execute database migrations",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/database",
|
"repository": "https://github.com/gradido/gradido/database",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bootstrap-vue-gradido-wallet",
|
"name": "bootstrap-vue-gradido-wallet",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node run/server.js",
|
"start": "node run/server.js",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido",
|
"name": "gradido",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "Gradido",
|
"description": "Gradido",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "git@github.com:gradido/gradido.git",
|
"repository": "git@github.com:gradido/gradido.git",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user