From cb4851b189c55257e0032cfca907c105945a6359 Mon Sep 17 00:00:00 2001 From: iamshabell <91321698+iamshabell@users.noreply.github.com> Date: Sat, 16 Dec 2023 01:37:09 +0300 Subject: [PATCH] ref: renaming of purchase in docs, readme files and examples --- README.md | 4 ++-- apps/docs/pages/guide/credit.mdx | 4 ++-- apps/docs/pages/guide/purchase.mdx | 10 +++++----- examples/express-ts/index.ts | 2 +- packages/marupay/README.md | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bd901d9..2a38027 100644 --- a/README.md +++ b/README.md @@ -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, @@ -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. diff --git a/apps/docs/pages/guide/credit.mdx b/apps/docs/pages/guide/credit.mdx index b234a18..0104656 100644 --- a/apps/docs/pages/guide/credit.mdx +++ b/apps/docs/pages/guide/credit.mdx @@ -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, diff --git a/apps/docs/pages/guide/purchase.mdx b/apps/docs/pages/guide/purchase.mdx index 80eeb78..fbffa63 100644 --- a/apps/docs/pages/guide/purchase.mdx +++ b/apps/docs/pages/guide/purchase.mdx @@ -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, diff --git a/examples/express-ts/index.ts b/examples/express-ts/index.ts index aac182e..1ca9983 100644 --- a/examples/express-ts/index.ts +++ b/examples/express-ts/index.ts @@ -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, diff --git a/packages/marupay/README.md b/packages/marupay/README.md index a09125a..1dc1785 100644 --- a/packages/marupay/README.md +++ b/packages/marupay/README.md @@ -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, @@ -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.