Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor api structure #30

Merged
merged 10 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ return view(view: 'check-out', data: [
'orderAmount' => '', // The value of the transaction
'orderReference' => '', // The merchant order reference. Min8 characters and It has to be alphanumeric
'productType' => '', // Product category
'productDescription' => '' // A brief summary of the product. max 200 characters,
'paymentTimeLimit' => config(key: 'jenga.limit'), // Duration payment is valid.
'productDescription' => '' // A brief summary of the product. max 200 characters,
'customerFirstName' => '', // The customer's First Name
'customerLastName' => '', // The customer's Last Name
'customerEmail' => '', // Customer email
Expand All @@ -209,7 +208,6 @@ Configure your frontend form.
<input type="hidden" id="orderReference" name="orderReference" value="{{ $orderReference }}">
<input type="hidden" id="productType" name="productType" value="{{ $productType }}">
<input type="hidden" id="productDescription" name="productDescription" value="{{ $productDescription }}">
<input type="hidden" id="paymentTimeLimit" name="paymentTimeLimit" value="{{ $paymentTimeLimit }}">
<input type="hidden" id="customerFirstName" name="customerFirstName" value="{{ $customerFirstName }}">
<input type="hidden" id="customerLastName" name="customerLastName" value="{{ $customerLastName }}">
<input type="hidden" id="customerEmail" name="customerEmail" value="{{ $customerEmail }}">
Expand Down Expand Up @@ -265,16 +263,19 @@ Configure your frontend form.
<summary>Get the Equity Bank daily currency conversion rate for major currencies.</summary>

```php
use NjoguAmos\Jenga\ForexRates;

$rates = (new ForexRates())
->convert(
amount: 1042,
currencyCode: "USD",
toCurrency: "KES",
accountNumber: '1450160649886',
countryCode: 'KE'
);
use NjoguAmos\Jenga\Api\GetForexExchangeRates;
use NjoguAmos\Jenga\Dto\ExchangeRatesDto;

// Convert 1042 USD into KES using Equity Bank Kenya rate.
$data = new ExchangeRatesDto(
amount: 1042,
currencyCode: "USD",
toCurrency: "KES",
accountNumber: '1450160649886',
countryCode: 'KE'
);

$rates = (new GetForexExchangeRates())->convert($data);
```

Example success response
Expand Down
Loading