Skip to content

CLHuah/RevenueMonsterHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RevenueMonsterHelper

A .NET library for integrating with Revenue Monster's payment API services. This library provides helper functions for authentication, signature generation, and payment processing.

Features

  • Base64 encoding/decoding utilities
  • RSA key handling (PEM format support)
  • Digital signature generation and verification
  • Payment transaction models

Installation

Add the library to your .NET project:

dotnet add package RevenueMonsterLibrary

Usage

Generating Signatures

using RevenueMonsterLibrary.Helper;

// Generate signature for API requests
string signature = SignatureHelper.GenerateSignature(
    data: payload,
    method: "POST", 
    nonceStr: "RANDOM_STRING",
    privateKey: "YOUR_PRIVATE_KEY",
    requestUrl: "API_ENDPOINT",
    signType: "SHA256",
    timestamp: "TIMESTAMP"
);

Verifying Signatures

using RevenueMonsterLibrary.Helper;

bool isValid = SignatureHelper.VerifySignature(
    data: receivedData,
    method: "POST",
    nonceStr: "RECEIVED_NONCE",
    publicKey: "MERCHANT_PUBLIC_KEY",
    requestUrl: "CALLBACK_URL",
    signType: "SHA256", 
    timestamp: "RECEIVED_TIMESTAMP",
    signature: "RECEIVED_SIGNATURE"
);

Requirements

  • .NET 8.0 or higher
  • Newtonsoft.Json 13.0.3 or higher

Testing

  • The project includes MSTest unit tests. Run tests using:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages