The LazerPay .NET SDK makes it easy to add Lazerpay crypto payment features to your .NET applications.
Install via .NET CLI
dotnet add package LazerPay.NET --version 1.1.0
Install via Package Manager
Install-Package LazerPay.NET -Version 1.1.0
Install via Package Reference
<PackageReference Include="LazerPay.NET" Version="1.1.0" />
Other installation methods can be found here
Add namespace directive
using LazerPayNET;
Initialize
var lazerPay = new LazerPay(publicKey: "YOUR-PUBLIC-KEY-GOES-HERE", secretKey: "YOUR-SECRET-KEY-GOES-HERE");
Initializes a payment transaction and returns the address to be used in completing the payment.
var result = lazerPay.InitializePayment(request);
{
"reference": "string",
"customer_name": "string",
"customer_email": "string",
"coin": "string",
"currency": "string",
"amount": "string",
"accept_partial_payment": false
}
{
"message": "string",
"status": "string",
"data": {
"reference": "string",
"businessName": "string",
"businessEmail": "string",
"businessLogo": "string",
"customerName": "string",
"customerEmail": "string",
"address": "string",
"coin": "string",
"cryptoAmount": 0,
"currency": "string",
"fiatAmount": 0,
"feeInCrypto": 0,
"network": "string",
"acceptPartialPayment": false
},
"statusCode": 0
}
Checks if a payment has been completed and returns a state to show the status of the payment. Payment status can either be confirmed or incomplete. A confirmed payment is a payment that the user has sent the exact amount needed to complete the transaction, if he sends less than the needed amount the transaction is in an incomplete status. It takes an object with the address property whose value is the address returned from the initialise payment function.
var result = lazerPay.ConfirmPayment(reference: "TRANSACTION-REFERENCE-GOES-HERE");
{
"status": "string",
"statusCode": 0,
"message": "string",
"data": {
"id": "string",
"reference": "string",
"senderAddress": "string",
"recipientAddress": "string",
"actualAmount": 0,
"amountPaid": "string",
"fiatAmount": 0,
"coin": "string",
"currency": "string",
"hash": "string",
"blockNumber": "string",
"type": "string",
"acceptPartialPayment": true,
"status": "string",
"network": "string",
"blockchain": "string",
"customer": {
"id": "string",
"customerName": "string",
"customerEmail": "string",
"customerPhone": "string",
"network": "string"
},
"feeInCrypto": 0
}
}
Gets the list of coins supported by Lazerpay. Using a mainnet API key returns accepted coins on the mainnet and using a testnet API key returns the accepted coins on the testnet.
var result = lazerPay.GetAcceptedCoins();
{
"message": "string",
"data": [
{
"id": "string",
"name": "string",
"symbol": "string",
"logo": "string",
"address": "string",
"network": "string",
"blockchain": "string",
"status": "string",
"createdAt": "2022-03-03T08:10:38.122Z",
"updatedAt": "2022-03-03T08:10:38.122Z"
}
],
"status": "string",
"statusCode": 0
}
Transfers crypto amount from businesses lazerpay balance to external crypto wallet
var result = lazerPay.Transfer(request);
{
"amount": 0,
"recipient": "string",
"coin": "string",
"blockchain": "string"
}
{
"message": "string",
"status": "string",
"data": {
"id": "string",
"createdAt": "2022-03-03T08:11:31.991Z",
"updatedAt": "2022-03-03T08:11:31.991Z",
"transactionHash": "string",
"walletAddress": "string",
"coin": "string",
"amount": 0,
"reference": "string"
},
"statusCode": 0
}
With Payment Links, you can create a payment page and share a link to it with your customers
var result = lazerPay.CreatePaymentLink(request);
{
"title": "string",
"description": "string",
"logo": "string",
"currency": "string",
"type": "string",
"amount": 0
}
{
"message": "string",
"data": {
"id": "string",
"reference": "string",
"title": "string",
"description": "string",
"amount": "string",
"currency": "string",
"redirectUrl": "string",
"logo": "string",
"type": "string",
"network": "string",
"status": "string",
"paymentUrl": "string",
"createdAt": "2022-04-09T17:49:49.233Z",
"updatedAt": "2022-04-09T17:49:49.233Z"
},
"statusCode": 0,
"status": "string"
}
With Payment Links, you can create a payment page and share a link to it with your customers
var result = lazerPay.UpdatePaymentLink(reference: reference, status: status);
{
"message": "string",
"data": {
"id": "string",
"reference": "string",
"title": "string",
"description": "string",
"amount": "string",
"currency": "string",
"redirectUrl": "string",
"logo": "string",
"type": "string",
"network": "string",
"status": "string",
"paymentUrl": "string",
"createdAt": "2022-04-09T17:49:49.233Z",
"updatedAt": "2022-04-09T17:49:49.233Z"
},
"statusCode": 0,
"status": "string"
}
With Payment Links, you can create a payment page and share a link to it with your customers
var result = lazerPay.GetPaymentLink(reference);
{
"message": "string",
"data": {
"id": "string",
"reference": "string",
"title": "string",
"description": "string",
"amount": "string",
"currency": "string",
"redirectUrl": "string",
"logo": "string",
"type": "string",
"network": "string",
"status": "string",
"paymentUrl": "string",
"createdAt": "2022-04-09T17:49:49.233Z",
"updatedAt": "2022-04-09T17:49:49.233Z"
},
"statusCode": 0,
"status": "string"
}
With Payment Links, you can create a payment page and share a link to it with your customers
var result = lazerPay.GetAllPaymentLink();
{
"message": "string",
"data": [
{
"id": "string",
"reference": "string",
"title": "string",
"description": "string",
"amount": "string",
"currency": "string",
"redirectUrl": "string",
"logo": "string",
"type": "string",
"network": "string",
"status": "string",
"paymentUrl": "string",
"createdAt": "2022-04-09T17:52:35.350Z",
"updatedAt": "2022-04-09T17:52:35.350Z"
}
],
"statusCode": 0,
"status": "string"
}
For more information, refer to the official LazerPay documentation