I’ve successfully created a payment link, and my next step is to verify whether the customer has made the payment or not. Here is the code snippet I used to create the payment link:
csharp
var priceMoney = new Money.Builder()
.Amount(priceAmount)
.Currency(currencyCode)
.Build();
var quickPay = new QuickPay.Builder(
name: quickPayName,
priceMoney: priceMoney,
locationId: locationID)
.Build();
var acceptedPaymentMethods = new AcceptedPaymentMethods.Builder()
.ApplePay(true)
.GooglePay(true)
.CashAppPay(true)
.AfterpayClearpay(false)
.Build();
var checkoutOptions = new CheckoutOptions.Builder()
.AllowTipping(false)
.MerchantSupportEmail(merchantSupportEmail)
.AskForShippingAddress(false)
.AcceptedPaymentMethods(acceptedPaymentMethods)
.EnableCoupon(false)
.EnableLoyalty(false)
.Build();
var buyerAddress = new Address.Builder()
.Country(buyerCountry)
.FirstName(buyerFirstName)
.LastName(buyerLastName)
.Build();
var prePopulatedData = new PrePopulatedData.Builder()
.BuyerEmail(buyerEmail)
.BuyerAddress(buyerAddress)
.Build();
var body = new CreatePaymentLinkRequest.Builder()
.Description("Test payment link")
.QuickPay(quickPay)
.CheckoutOptions(checkoutOptions)
.PrePopulatedData(prePopulatedData)
.PaymentNote("Payment ...HHH")
.Build();
try
{
var result = await client.CheckoutApi.CreatePaymentLinkAsync(body: body);
Console.WriteLine("Short Payment Link (URL): " + result.PaymentLink.Url);
Console.WriteLine("Long Payment Link (longURL): " + result.PaymentLink.LongUrl);
Console.WriteLine("PaymentLink.ID: " + result.PaymentLink.Id);
// Return the PaymentLink ID for further processing
return result.PaymentLink.Id;
}
catch (ApiException e)
{
Console.WriteLine("Failed to create the payment link");
Console.WriteLine($"Response Code: {e.ResponseCode}");
Console.WriteLine($"Exception: {e.Message}");
}
Now, I want to create another method in C# that will verify based on result.PaymentLink.Id whether the customer has paid or not.
How can I verify in C# whether the customer has paid using this link or not?
If direct verification is not possible, what alternatives can I use to check the payment status?
when I open the URL to pay . i have this page
after the Checkout Completed , the order State still equale to OPEN . why ?
It should be equale to COMPLETED1.

