Skip to content
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
Patch: Compilation from TS to JS with support for ESM and CJS
  • Loading branch information
damilola-paystack committed Jun 25, 2024
commit edcd260c8c71198e78dd728a80a776511d68fb4e
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm install @paystack/paystack-sdk --save
## Usage
Import and initialize the library:
```javascript
const Paystack = require('@paystack/paystack-sdk')
const { Paystack } = require('@paystack/paystack-sdk')
const paystack = new Paystack("sk_test_xxxxxx")

paystack.transaction.initialize({email: "test@example.com", amount: 20000})
Expand All @@ -24,7 +24,7 @@ paystack.transaction.initialize({email: "test@example.com", amount: 20000})

Import and initialize the library using ES module with `async/await`:
```javascript
import Paystack from '@paystack/paystack-sdk'
import { Paystack } from '@paystack/paystack-sdk'
const paystack = new Paystack("sk_test_xxxxxx")

const initialize = async(email, amount) => {
Expand All @@ -43,7 +43,7 @@ initialize(email, amount)

### Typescript
```typescript
import Paystack from '@paystack/paystack-sdk';
import { Paystack } from '@paystack/paystack-sdk';
const paystack = new Paystack("sk_test_xxxxxx");

const initialize = async(email, amount) => {
Expand Down
Loading