-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds, funding, withdrawl features
- Loading branch information
1 parent
fcc09de
commit d6d7371
Showing
6 changed files
with
549 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return await knex.schema.createTable('paymentMethods', (table) => { | ||
table.increments('id'); | ||
table.string('authorizationCode', 50).nullable(); | ||
table.json('card').nullable(); /* | ||
This must store the card's | ||
- Last4: '0456' | ||
- exp_month: '12' | ||
- exp_year: '2050' | ||
- type: 'visa' | ||
- brand: 'visa' | ||
- account_name | ||
- customer_code: 'CUS_i5yosncbl8h2kvc' | ||
*/ | ||
table.string('recipientCode', 255).nullable(); | ||
table.json('bank').nullable(); /* | ||
This must store the customer's bank's details | ||
{ | ||
"authorization_code": null, | ||
"account_number": "0001234567", | ||
"account_name": null, | ||
"bank_code": "058", | ||
"bank_name": "Guaranty Trust Bank" | ||
} | ||
*/ | ||
table.integer('customer').references('id').inTable('users').unsigned(); | ||
table.timestamps(true, true, true); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return await knex.schema.dropTable('paymentMethods'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import { registerAs } from '@nestjs/config'; | ||
|
||
export default registerAs('app', () => ({ | ||
envName: process.env.NODE_ENV, | ||
apiPrefix: 'api', | ||
port: parseInt(process.env.APP_PORT || process.env.PORT, 10) || 3000, | ||
payments: { | ||
email: process.env.PAYMENTS_EMAIL, | ||
paystackSecretKey: process.env.PAYSTACK_SECRET_KEY, | ||
paystackPublicKey: process.env.PAYSTACK_PUBLIC_KEY | ||
} | ||
})); | ||
export default registerAs('app', () => { | ||
const PORT = parseInt(process.env.APP_PORT || process.env.PORT, 10) || 3000; | ||
|
||
return { | ||
envName: process.env.NODE_ENV, | ||
apiPrefix: 'api', | ||
port: PORT, | ||
appURL: | ||
process.env.NODE_ENV === 'production' | ||
? process.env.APP_URL + '/api' | ||
: `http://localhost:${PORT}/api`, | ||
payments: { | ||
email: process.env.PAYMENTS_EMAIL, | ||
paystackSecretKey: process.env.PAYSTACK_SECRET_KEY, | ||
paystackPublicKey: process.env.PAYSTACK_PUBLIC_KEY | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.