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

add(docs): credit implementaion, contributing guidlines #6

Merged
merged 3 commits into from
Dec 10, 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
1 change: 1 addition & 0 deletions apps/docs/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"installation": "Installation",
"configuration": "Configuration",
"guide": "Guide(Express)",
"contributing": "Contributing",
"about": {
"title": "About",
"type": "page"
Expand Down
44 changes: 44 additions & 0 deletions apps/docs/pages/contributing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Contributing to MaruPay

Thank you for considering contributing to the MaruPay! Contributions help improve the SDK and benefit the entire community. Whether you want to report a bug, suggest an enhancement, or submit code changes, your involvement is valuable.

## Ways to Contribute

### 1. Reporting Issues

If you encounter any bugs, issues, or unexpected behavior, please [open an issue](https://github.com/iamshabell/marupay/issues) on our GitHub repository. Include as much detail as possible, such as the version of the SDK, steps to reproduce the issue, and any relevant code snippets.

### 2. Feature Requests

If you have ideas for new features or improvements, you can [submit a feature request](https://github.com/iamshabell/marupay/issues) on GitHub. Provide a clear description of the proposed feature and the use case it addresses.

### 3. Code Contributions

To contribute code changes:

1. Fork the [MaruPay repository](https://github.com/iamshabell/marupay) on GitHub.
2. Clone your forked repository locally:

```bash
git clone https://github.com/iamshabell/marupay.git
```
3. Create a new branch for your changes:

```bash
git checkout -b feature-name
```

4. Make your changes, commit, and push:

```bash
git add .
git commit -m "Add feature-name"
git push origin feature-name

```
5. Open a pull request on the [MaruPay repository](https://github.com/iamshabell/marupay/pulls)

### Documentation
Improvements to documentation are always welcome! If you find areas that need clarification or have ideas for additional content, you can submit [open an issue](https://github.com/iamshabell/marupay/issues) or [create a pull request)](https://github.com/iamshabell/marupay/pulls).

Thank you for contributing to MaruPay! Your efforts help make this library even better.
31 changes: 31 additions & 0 deletions apps/docs/pages/guide/credit.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Credit Request

*Credit is responsible sending a B2C or B2B based on `accountType` either `CUSTOMER` and `MERCHANT`.*

Once you have configured the payment handlers, you can utilize this configuration when making requests using the Marupay SDK. The configuration ensures that the SDK has the required credentials to interact with the specified payment systems.

Here's a quick example of how you can use the configuration when making a credit request:

```typescript
app.get('/purchase', async (req, res) => {
try {
const chosenHandler: HandlerName = 'edahab';
const handler = getPaymentHandler(chosenHandler)(paymentConfig[chosenHandler]!);

const paymentInfo = await handler.request({
accountNumber: "6512312341",
amount: 500,
currency: "SLSH",
description: "Test purchase",
accountType: 'CUSTOMER'
});

res.send(paymentInfo);
} catch (e) {
console.log(e);
res.status(500).send("Internal Server Error");
}
});


```
6 changes: 3 additions & 3 deletions apps/docs/pages/guide/purchase.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Making Our First Request
Once you have configured the payment handlers, you can utilize this configuration when making requests using the Marupay SDK. The configuration ensures that the SDK has the required credentials to interact with the specified payment systems.
*Request is sending a C2B or charging a customer.*

Here's a quick example of how you can use the configuration when making a purchase request:
Now, let's add a route for making a credit request:

```typescript
app.get('/purchase', async (req, res) => {
app.get('/credit', async (req, res) => {
try {
const chosenHandler: HandlerName = 'edahab';
const handler = getPaymentHandler(chosenHandler)(paymentConfig[chosenHandler]!);
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for choosing Marupay, the versatile payment processing SDK for your ap

## About Marupay SDK

The Marupay SDK is an npm library designed to simplify the integration process with multiple payment systems. It provides an easy-to-use interface, empowering developers to effortlessly incorporate various payment handlers into their applications.
The Marupay SDK is an [npm library](https://www.npmjs.com/package/marupay) designed to simplify the integration process with multiple payment systems. It provides an easy-to-use interface, empowering developers to effortlessly incorporate various payment handlers into their applications.

### Let's Get Started 🚀

5 changes: 5 additions & 0 deletions apps/docs/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const config: DocsThemeConfig = {
footer: {
text: 'MaruPay Docs',
},
useNextSeoProps() {
return {
titleTemplate: '%s – MaruPay'
}
},
}

export default config
Loading