Skip to content

Commit

Permalink
Merge pull request #2 from Flutterwave/master
Browse files Browse the repository at this point in the history
update features and docs from FLW
  • Loading branch information
korneliosyaovi authored Jul 30, 2020
2 parents dacf222 + 34629b2 commit 332527e
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--- Provide a general summary of your changes in the Title above -->

#### Description
<!--- Describe your changes in detail -->

#### Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

#### Motivation and Context
<!--- Why is this change required? What problem does it solve? -->

#### How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

#### Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Refactor (non-breaking change which improves implementation)
- [ ] Performance (non-breaking change which improves performance. Please add associated performance test and results)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Non-functional change (xml comments/documentation/etc)

#### Checklist:
<!--- The following is a checklist of items that MUST be completed before a PR is accepted -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] I have read the **CONTRIBUTING** [document](https://github.com/QuantConnect/Lean/blob/master/CONTRIBUTING.md).
- [ ] I have added tests to cover my changes. <!--- If not applicable, please explain why -->
- [ ] All new and existing tests passed.
- [ ] My branch follows the naming convention `bug-<issue#>-<description>` or `feature-<issue#>-<description>`


@Flutterwave/Corvus97 What do you think about these updates?
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Rave .NET SDK ![Build Status](https://travis-ci.org/Official-kornelios/rave-csharp.svg?branch=master)
<p align="center">
<img title="Flutterwave" height="200" src="https://flutterwave.com/images/logo-colored.svg" width="50%"/>
</p>

# Flutterwave .NET Library ![Build Status](https://travis-ci.org/Official-kornelios/rave-csharp.svg?branch=master)
## Description
The Rave .NET SDK makes it easy to add Rave support to your .NET web application and is built on Rave's REST APIs.
The Flutterwave .NET SDK makes it easy to add our payment features to your .NET web applications.

## Introduction
The Rave .NET Library implements the following payment services:
The Flutterwave .NET Library implements the following payment services:

1. Card Payments
2. Bank Account Payments.
Expand Down
17 changes: 17 additions & 0 deletions Rave/Models/Card/CardParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ public CardParams(string PbfPubKey, string secretKey, string firstName, string l
Cvv = card.Cvv;
Pin = card.Pin;
}

public CardParams(string PbfPubKey, string secretKey, string firstName, string lastName, string email, decimal amount, string currency, Card card, string billingzip, string billingcity, string billingaddress, string billingstate, string billingcountry) : base(PbfPubKey, secretKey, firstName, lastName, email, currency)
{
Amount = amount;
CardNo = card.CardNo;
Expirymonth = card.Expirymonth;
Expiryyear = card.Expiryyear;
Cvv = card.Cvv;
Pin = card.Pin;
BillingZip = billingzip;
BillingCity = billingcity;
BillingAddress = billingaddress;
BillingState = billingstate;
BillingCountry = billingcountry;


}

[JsonProperty("cardno")]
public string CardNo { get; set; }
Expand Down
20 changes: 20 additions & 0 deletions Rave/Models/Charge/ParamsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,25 @@ protected static string GetAuthType(AuthTypes authType)

[JsonProperty("lastname")]
public string LastName { get; set; }


[JsonProperty("billingzip")]
public string BillingZip { get; set; }


[JsonProperty("billingcity")]
public string BillingCity { get; set; }


[JsonProperty("billingaddress")]
public string BillingAddress { get; set; }


[JsonProperty("billingstate")]
public string BillingState { get; set; }


[JsonProperty("billingcountry")]
public string BillingCountry { get; set; }
}
}
35 changes: 35 additions & 0 deletions RaveTests/RaveTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class UnitTest1
string ScKey = Environment.GetEnvironmentVariable("ScKey");


//Preauth Card charge test
[TestMethod]
public void preauthTest()
{
Expand All @@ -54,7 +55,35 @@ public void preauthTest()


}

//Noauth Card charge test
[TestMethod]
public void avschargetest()
{
var raveConfig = new RaveConfig(PbKey, ScKey, false);
var cardCharge = new ChargeCard(raveConfig);
var card = new Card("5377283645077450", "09", "21", "789");

var payload = new CardParams(PbKey, ScKey, "Anonymous", "Tester", "[email protected]", 200, "USD", card, "07205", "Hillside", "470 Mundet PI", "NJ", "US");

var res = cardCharge.Charge(payload).Result;

try
{
Assert.IsNotNull(res.Data);
Console.WriteLine(res.Data);
Assert.AreEqual("success", res.Status);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}


}


//Mobile money charge test
[TestMethod]
public void mobileMoneyTest()
{
Expand All @@ -77,6 +106,7 @@ public void mobileMoneyTest()
}
}

//Account charge test
[TestMethod]
public void accountTest()
{
Expand All @@ -99,6 +129,7 @@ public void accountTest()
}


//Subaccount creation test
[TestMethod]
public void CreateSubAccountTest()
{
Expand All @@ -112,6 +143,7 @@ public void CreateSubAccountTest()
Assert.AreEqual("error", chargeResponse.Status);
}

//Tokenized Card charge test suite
[TestMethod]
public void TokenTest()
{
Expand Down Expand Up @@ -140,6 +172,7 @@ public void TokenTest()

}


[TestMethod]
public void VirtualStaticAccountTest()
{
Expand Down Expand Up @@ -215,6 +248,7 @@ public void UpdateEbillsTest()
Assert.AreEqual("success", (string)json.SelectToken("status"));
}

//Subscription list test
[TestMethod]
public void ListSubscriptions()
{
Expand All @@ -229,6 +263,7 @@ public void ListSubscriptions()
Assert.AreEqual("success", (string)json.SelectToken("status"));
}

//Virtual Card creation test
[TestMethod]
public void CreateVirtualCard()
{
Expand Down

0 comments on commit 332527e

Please sign in to comment.