relynolli-server/services/validate.go

28 lines
677 B
Go
Raw Normal View History

2024-03-15 21:27:45 +03:00
package services
2024-03-26 02:21:35 +03:00
//
//func YookassaValidate(paymentId string, status string) {
// stmt := fmt.Sprintf(`select t1.order_id as order_id, t2.ID as payment_id from api_youkassa_payment t1 join b_sale_order_payment t2 on t1.order_id = t2.ORDER_ID where t1.payment_id = '%s';`, paymentId)
// db := internal.InitDatabase()
// rows := db.Query(stmt)
//
// var (
// orderId int
// paymentIdBitrix int
// )
//
// rows.Next()
// rows.Scan(&orderId, &paymentIdBitrix)
//
// api := bitrix.Initialize()
// if status == "succeeded" {
// api.ApprovePayment(paymentIdBitrix, 8)
// return
// }
// if status == "canceled" {
// api.CancelOrder(orderId)
// return
// }
// return
//}