Skip to content

Commit 99d5ea3

Browse files
committed
v0.0.4 release
0 parents  commit 99d5ea3

24 files changed

+1093
-0
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BUX_API_KEY=api_key
2+
BUX_CLIENT_ID=0000000001
3+
BUX_API_SECRET=secret
4+
BUX_SANDBOX=true

.github/workflows/main.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test / OS ${{ matrix.os }} / Node ${{ matrix.node }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
node: ["12"]
16+
sdk: [stable, beta, dev]
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Checks-out repo
22+
uses: actions/checkout@v2
23+
24+
- name: Setup Dart
25+
uses: dart-lang/setup-dart@v1
26+
with:
27+
sdk: ${{ matrix.sdk }}
28+
29+
- name: Install dependencies
30+
run: pub get
31+
32+
- name: dartfmt
33+
run: dart format lib test -l 80 --set-exit-if-changed
34+
35+
- name: analyzer
36+
run: dart analyze --fatal-warnings --fatal-infos .
37+
38+
- name: Run tests
39+
run: pub run test test

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Miscellaneous
2+
.DS_Store
3+
4+
# Files and directories created by pub
5+
.dart_tool/
6+
.packages
7+
8+
# Omit commiting pubspec.lock for library packages:
9+
# https://dart.dev/guides/libraries/private-files#pubspeclock
10+
pubspec.lock
11+
12+
# Conventional directory for build outputs
13+
build/
14+
15+
# Directory created by dartdoc
16+
doc/api/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
**/.vscode/**
22+
!**/.vscode/launch.json
23+
24+
**/docs/**
25+
26+
**/.fvm/**
27+
!**/.fvm/fvm_config.json
28+
29+
**/example/**
30+
!**/example/main.dart
31+
!**/example/README.md
32+
*.bak

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Dart Run All Test",
6+
"request": "launch",
7+
"type": "dart",
8+
"program": "./test/"
9+
},
10+
],
11+
}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## 0.0.4
2+
- Export Classes that is Not Available for import
3+
## 0.0.3
4+
- Fix UnAuthorized Request on Correct Credentials and Inputs
5+
## 0.0.2
6+
7+
- Added Bux Checkout API
8+
9+
## 0.0.1
10+
11+
Drafted Initial Release

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 GOLDCODERS CORP
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Bux.ph Dark SDK
2+
3+
4+
## Checkout API
5+
- Allows you to checkout
6+
7+
All the parameters that can be used on Checkout Api in JSON
8+
```json
9+
{
10+
"req_id": "TEST123d",
11+
"client_id": "0000001", // Set this up in your .env
12+
"amount": "50",
13+
"description": "test",
14+
"expiry": 2,
15+
"email": "[email protected]",
16+
"contact": "9161234567",
17+
"name": "Juan Dela Cruz",
18+
"notification_url": "https://example.ph/bux_notif/",
19+
"redirect_url": "https://example.ph/sample_redirect/",
20+
"param1": "referral link",
21+
"param2": "delivery address"
22+
}
23+
```
24+
25+
## Usage
26+
27+
1. Set up .env
28+
29+
for production use `https://api.bux.ph/v1/api` as your BUX_BASE_URL
30+
31+
```toml
32+
BUX_API_KEY=api_key
33+
BUX_BASE_URL=https://api.bux.ph/v1/api/sandbox
34+
BUX_CLIENT_ID=0000000001
35+
BUX_API_SECRET=secret
36+
```
37+
38+
Initialize dotenv on your main function
39+
40+
```dart
41+
import 'package:flutter_dotenv/flutter_dotenv.dart';
42+
43+
Future<void> main() async {
44+
await dotenv.load();
45+
runApp(MyApp());
46+
}
47+
```
48+
49+
Add to Your pubspec.yaml
50+
51+
```yaml
52+
flutter:
53+
assets:
54+
- .env
55+
```
56+
57+
58+
2. Create CheckoutPayload
59+
60+
```dart
61+
import 'package:buxdotph/models/api/checkout_payload.dart';
62+
import 'package:flutter_dotenv/flutter_dotenv.dart';
63+
...
64+
65+
66+
final CheckoutPayload payload = CheckoutPayload(
67+
amount: 1000,
68+
req_id: 'uuid_from_backend',
69+
client_id: dotenv.env['BUX_CLIENT_ID']!,
70+
description: 'subscription',
71+
notification_url: 'https://google.com',
72+
expiry: 2,
73+
74+
contact: '09155555555',
75+
name: 'John Dela Cruz',
76+
redirect_url: 'https://goldcoders.dev',
77+
param1: 'username',
78+
param2: 'address',
79+
);
80+
```
81+
82+
- Pass the Payload to Bux.checkout()
83+
84+
```dart
85+
import 'package:buxdotph/buxdotph.dart';
86+
87+
...
88+
await Bux.checkout(payload);
89+
```
90+
91+
the returned response is a `String?` type , you can `json_encode` it if there is no errors

analysis_options.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
include: package:lint/analysis_options.yaml
2+
3+
analyzer:
4+
exclude:
5+
- /**/*.g.dart
6+
- /**/*.mocks.dart
7+
- lib/generated_plugin_registrant.dart
8+
errors:
9+
todo: ignore
10+
11+
linter:
12+
rules:
13+
prefer_single_quotes: true
14+
unnecessary_getters_setters: false
15+
always_put_required_named_parameters_first: false
16+
lines_longer_than_80_chars: true
17+
argument_type_not_assignable: true
18+
avoid_print: false
19+
avoid_type_to_string: true
20+
always_require_non_null_named_parameters: true
21+
avoid_classes_with_only_static_members: false
22+
annotate_overrides: true
23+
avoid_field_initializers_in_const_classes: true
24+
always_declare_return_types: true
25+
cancel_subscriptions: true
26+
close_sinks: true
27+
comment_references: true
28+
only_throw_errors: true
29+
sort_child_properties_last: true
30+
await_only_futures: true
31+
always_specify_types: true
32+
constant_identifier_names: false
33+
non_constant_identifier_names: false

example/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#### Examples
2+
3+
- Flutter user management: https://github.com/supabase/supabase/tree/master/examples/flutter-user-management
4+
- Extended flutter user management with web support, github login, recovery password flow
5+
- https://github.com/phamhieu/supabase-flutter-demo
6+
- Spot, open source geo based video sharing social app created with Flutter
7+
- https://github.com/dshukertjr/spot
8+
- Notes app: https://github.com/bigblackclock/supabase_notes

example/main.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import 'dart:async';
2+
3+
Future<void> main() async {}

0 commit comments

Comments
 (0)