Skip to content

Commit

Permalink
ref: renaming of purchase in docs, readme files and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
iamshabell committed Dec 15, 2023
1 parent a889a94 commit cb4851b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.get('/purchase', async (req, res) => {
const handler = getPaymentHandler(chosenHandler)(paymentConfig[chosenHandler]!);

// Make a purchase request
const paymentInfo = await handler.request({
const paymentInfo = await handler.purchase({
accountNumber: "+2526512312341", // must start with `+` followed by country code
amount: 500,
currency: Currency.SLSH,
Expand Down Expand Up @@ -99,7 +99,7 @@ app.listen(port, () => {

### Responses

The `credit` and `request` methods both returns a `PaymentInfo` object. It'll return these details:
The `credit` and `purchase` methods both returns a `PaymentInfo` object. It'll return these details:

- **`transactionId`:** This identifier is obtained from the vendor's transaction ID. It uniquely identifies the transaction in the vendor's system.

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/pages/guide/credit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Once you have configured the payment handlers, you can utilize this configuratio
Here's a quick example of how you can use the configuration when 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]!);

const paymentInfo = await handler.request({
const paymentInfo = await handler.credit({
accountNumber: "+2526512312341", // must start with `+` followed by country code
amount: 500,
currency: Currency.SLSH,
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/pages/guide/purchase.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Making Our First Request
*Request is sending a C2B or charging a customer.*
# Making Our First Purchase
*Purchase is sending a C2B or charging a customer.*

Now, let's add a route for making a credit request:
Now, let's add a route for making a purchase request:

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

const paymentInfo = await handler.request({
const paymentInfo = await handler.purchase({
accountNumber: "+2526512312341", // must start with `+` followed by country code
amount: 500,
currency: Currency.SLSH,
Expand Down
2 changes: 1 addition & 1 deletion examples/express-ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ app.get('/purchase', async (req, res) => {
const handler = getPaymentHandler(chosenHandler)(paymentConfig[chosenHandler]!);

// Make a purchase request
const paymentInfo = await handler.request({
const paymentInfo = await handler.purchase({
accountNumber: "+2526512312341", // must start with `+` followed by country code
amount: 500,
currency: Currency.SLSH,
Expand Down
4 changes: 2 additions & 2 deletions packages/marupay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.get('/purchase', async (req, res) => {
const handler = getPaymentHandler(chosenHandler)(paymentConfig[chosenHandler]!);

// Make a purchase request
const paymentInfo = await handler.request({
const paymentInfo = await handler.purchase({
accountNumber: "+2526512312341", // must start with `+` followed by country code
amount: 500,
currency: Currency.SLSH,
Expand Down Expand Up @@ -98,7 +98,7 @@ app.listen(port, () => {
```
### Responses

The `credit` and `request` methods both returns a `PaymentInfo` object. It'll return these details:
The `credit` and `purchase` methods both returns a `PaymentInfo` object. It'll return these details:

- **`transactionId`:** This identifier is obtained from the vendor's transaction ID. It uniquely identifies the transaction in the vendor's system.

Expand Down

0 comments on commit cb4851b

Please sign in to comment.