Skip to content

Commit

Permalink
payments: log first
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz0u committed Aug 20, 2024
1 parent a5b9913 commit 6bc3369
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/4/payments.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ async Task OnUpdate(Update update)
await bot.AnswerPreCheckoutQueryAsync(preCheckoutQuery.Id, "Invalid order");
break;
case { Message.SuccessfulPayment: { } successfulPayment }:
if (successfulPayment.InvoicePayload is "unlock_X")
await bot.SendTextMessageAsync(update.Message.Chat, "Thank you! Feature X is unlocked");
System.IO.File.AppendAllText("payments.log", $"\n{DateTime.Now}: User {update.Message.From} " +
$"paid for {successfulPayment.InvoicePayload}: " +
$"{successfulPayment.ProviderPaymentChargeId} {successfulPayment.TelegramPaymentChargeId}");
$"{successfulPayment.TelegramPaymentChargeId} {successfulPayment.ProviderPaymentChargeId}");
if (successfulPayment.InvoicePayload is "unlock_X")
await bot.SendTextMessageAsync(update.Message.Chat, "Thank you! Feature X is unlocked");
break;
};
}
Expand Down

0 comments on commit 6bc3369

Please sign in to comment.