Skip to content

Commit

Permalink
Enable multi-currency for transaction intializer.
Browse files Browse the repository at this point in the history
* Inspired by @django101 PR #14.
  • Loading branch information
adebisi-fa committed Sep 7, 2019
1 parent f42247f commit 29265a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/Apis/Transactions/ITransactionsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace PayStack.Net
{
public interface ITransactionsApi
{
TransactionInitializeResponse Initialize(string email, int amountInKobo, string reference = null, bool makeReferenceUnique = false);
TransactionInitializeResponse Initialize(string email, int amountInKobo, string reference = null, bool makeReferenceUnique = false, string currency = "NGN");
TransactionInitializeResponse Initialize(TransactionInitializeRequest request, bool makeReferenceUnique = false);
TransactionVerifyResponse Verify(string reference);
TransactionListResponse List(TransactionListRequest request = null);
Expand Down
3 changes: 3 additions & 0 deletions src/main/Apis/Transactions/Initialize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class TransactionInitializeRequest : RequestMetadataExtender
[JsonProperty("transaction_charge")]
public int TransactionCharge { get; set; }

[JsonProperty("currency")]
public string Currency { get; set; } = "NGN";

public string Bearer { get; set; }
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/Apis/Transactions/TransactionsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ internal TransactionsApi(PayStackApi api)
_api = api;
}

public TransactionInitializeResponse Initialize(string email, int amount, string reference = null, bool makeReferenceUnique = false)
=> Initialize(new TransactionInitializeRequest { Reference = reference, Email = email, AmountInKobo = amount }, makeReferenceUnique);
public TransactionInitializeResponse Initialize(string email, int amount, string reference = null, bool makeReferenceUnique = false, string currency = "NGN")
=> Initialize(new TransactionInitializeRequest { Reference = reference, Email = email, AmountInKobo = amount, Currency = currency }, makeReferenceUnique);

public TransactionInitializeResponse Initialize(TransactionInitializeRequest request, bool makeReferenceUnique = false)
{
Expand Down

0 comments on commit 29265a5

Please sign in to comment.