Skip to content

Commit

Permalink
Merge pull request #19 from buckaroo-it/v1.0
Browse files Browse the repository at this point in the history
v1.0
  • Loading branch information
vildanbina authored Nov 20, 2023
2 parents 1d56447 + edc296b commit 9e47892
Show file tree
Hide file tree
Showing 348 changed files with 11,731 additions and 4,256 deletions.
16 changes: 16 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{
"targets": {
"node": "6.9"
}
}
]
]
}
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[*]
charset = utf-8
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = false
max_line_length = 200
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_visual_guides = none
ij_wrap_on_typing = false
20 changes: 20 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]
name: SonarQube PR Analysis
jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dist/
*.lock
*.cache
package-lock.json
*.js
*.map
*.d.ts
.idea/
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dist
dist
10 changes: 6 additions & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"printWidth": 100,
"bracketSpacing": true,
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 4,
"singleQuote": true,
"bracketSameLine": true,
"trailingComma": "none",
"semi": false
"singleAttributePerLine": true,
"htmlWhitespaceSensitivity": "ignore",
"bracketSameLine": false
}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Changelog

All notable changes to this project will be documented in this file.

---

## [Released]

## [1.0.0]

- Refactor method calls.
- Batch api calls.
- Response and push validation.
- Add general models.
- Add PayByBank
- Add In3 new

## [0.9.0]

- Beta release.
23 changes: 12 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

### Repository setup:

- Fork the repository to your account
- more details about [how to fork a repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) can be found [here](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo):
- Fork the repository to your account
- more details about [how to fork a repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) can be
found [here](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo):

### Making changes:

- create a branch from develop branch
- name of the branch shoul be something like: `feature/GITHUB-ISSUE-ID-slug` (eg: `feature/50-configprovider-update`)
- including unit tests is encouraged
- create a branch from develop branch
- name of the branch shoul be something like: `feature/GITHUB-ISSUE-ID-slug` (eg: `feature/50-configprovider-update`)
- including unit tests is encouraged

### Pull Request:

- open the PR to develop branch
- if there is no issue referenced, add a description about the problem and the way it is being solved
- Allow edits from maintainers
- open the PR to develop branch
- if there is no issue referenced, add a description about the problem and the way it is being solved
- Allow edits from maintainers

### Contribution to refactoring:

- include unit tests
- open the Pull Request
- check that git workflows checks have passed
- include unit tests
- open the Pull Request
- check that git workflows checks have passed
70 changes: 46 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@

<p align="center">
<img src="https://user-images.githubusercontent.com/105488705/233078855-473c45d4-34a6-492a-a5af-05752c803f6b.png" width="200px" position="center">
</p>

# Node SDK

[![Latest release](https://badgen.net/github/release/buckaroo-it/BuckarooSDK_Node)](https://github.com/buckaroo-it/BuckarooSDK_Node/releases)

<p align="center">
<img src="https://user-images.githubusercontent.com/7081446/233298897-30274cc8-86cc-4e6f-8200-759c801af19e.png" width="500px" position="center">
</p>

---

### Index

- [About](#about)
- [Requirements](#requirements)
- [Installation](#installation)
- [Example](#example)
- [Contribute](#contribute)
- [Versioning](#versioning)
- [Additional information](#additional-information)

---

### About

Buckaroo is the the Payment Service Provider for all your online payments with more than 15,000 companies relying on Buckaroo's platform to securely process their payments, subscriptions and unpaid invoices. Buckaroo developed their own Node SDK. The SDK is a modern, open-source Node.js library that makes it easy to integrate your Javascript application with Buckaroo's services. Start accepting payments today with Buckaroo.
Buckaroo is the Payment Service Provider for all your online payments with more than 15,000 companies relying on Buckaroo's platform to securely process their payments, subscriptions and unpaid
invoices. Buckaroo developed their own Node SDK. The SDK is a modern, open-source Node.js library that makes it easy to integrate your Javascript application with Buckaroo's services. Start accepting
payments today with Buckaroo.

### Requirements

To use the Buckaroo API client, the following things are required:

- A Buckaroo account ([Dutch](https://www.buckaroo.nl/start) or [English](https://www.buckaroo.eu/solutions/request-form))
- Node.js 6.14.× or greater
- A Buckaroo account ([Dutch](https://www.buckaroo.nl/start) or [English](https://www.buckaroo.eu/solutions/request-form))
- Node.js 6.14.× or greater

### Installation

Expand All @@ -43,37 +48,54 @@ npm install @buckaroo/buckaroo_sdk
Initiate the buckaroo client with your website key and secret key. The keys can be retrieved from your [Buckaroo account](https://plaza.buckaroo.nl/Login).

```javascript
import { initializeBuckarooClient } from './BuckarooClient'
initializeBuckarooClient({ websiteKey: 'KEY', secretKey: 'SECRET' })
import Buckaroo from '@buckaroo/buckaroo_sdk';

const buckarooClient = Buckaroo.InitializeClient(
{
secretKey: 'KEY',
websiteKey: 'SECRET',
},
{
mode: 'TEST', // OR 'LIVE'
currency: 'EUR',
returnURL: 'RETURN_URL',
pushURL: 'PUSH_URL',
}
)
```

Create a payment with all the available payment methods. In this example, we show how to create a credit card payment. Each payment has a slightly different payload.

```javascript
import creditCard from './PaymentMethods/CreditCard'

const payment = await creditCard().pay({
amountDebit: 10,
name: 'Mastercard',
invoice: 'UNIQUE-INVOICE-NO'
})
const payment = await buckarooClient
.method('mastercard')
.pay({
amountDebit: 100,
})
.request();
```

After you create a transaction, you can retrieve several transaction information on demand.

```javascript
const transactionKey = payment.Key
const transaction = buckarooClient.transaction(payment.getTransactionKey());

import { buckarooClient } from './BuckarooClient'

buckarooClient().status(transactionKey) // Retrieve transaction status
buckarooClient().refundInfo(transactionKey) // Retrieve refund info
buckarooClient().cancelInfo(transactionKey) // Retrieve cancellation info
await transaction.status(); // Retrieve transaction status
await transaction.refundInfo(); // Retrieve refund info
await transaction.cancelInfo(); // Retrieve cancellation info
```

Find our full documentation online on [docs.buckaroo.io](https://docs.buckaroo.io/docs/node-sdk).

### Regarding Usage Outside of Node.js
This library is written in JavaScript, a versatile programming language with broad applicability. While it's technically possible to integrate this library into a website or mobile application, it's strongly advised against doing so.

In the standard configuration, you make requests to the Buckaroo API using one of our provided libraries, typically from your server (such as a Node.js server). Your secret key is securely stored on this server, inaccessible to external entities.

However, if you incorporate this library directly into a website or app, your secret key will be exposed to users. This could enable users to take actions on your behalf using that key.

#### Need more examples?

More examples can be found in the [examples folder](https://github.com/buckaroo-it/BuckarooSDK_Node/tree/master/example)

### Contribute
Expand All @@ -87,14 +109,14 @@ If you want to contribute as well, then please follow our [Contribution Guidelin
<img src="https://user-images.githubusercontent.com/7081446/178474134-f4c3976d-653c-4ca1-bcd1-48bf6d489196.png" width="500px" alt="">
</p>

- **MAJOR:** Breaking changes that require additional testing/caution
- **MINOR:** Changes that should not have a big impact
- **PATCHES:** Bug and hotfixes only
- **MAJOR:** Breaking changes that require additional testing/caution
- **MINOR:** Changes that should not have a big impact
- **PATCHES:** Bug and hotfixes only

### Additional information

- **Support:** https://support.buckaroo.eu/contact
- **Contact:** [[email protected]](mailto:[email protected]) or [+31 (0)30 711 50 50](tel:+310307115050)
- **Support:** https://support.buckaroo.eu/contact
- **Contact:** [[email protected]](mailto:[email protected]) or [+31 (0)30 711 50 50](tel:+310307115050)

## License

Expand Down
33 changes: 0 additions & 33 deletions example/BuckarooClient.ts

This file was deleted.

26 changes: 0 additions & 26 deletions example/CreditManagment.ts

This file was deleted.

22 changes: 0 additions & 22 deletions example/ValidateResponse.ts

This file was deleted.

Loading

0 comments on commit 9e47892

Please sign in to comment.