Skip to content

Commit

Permalink
Add split code option (#85)
Browse files Browse the repository at this point in the history
* Split Code Option Added

* Merged

* remove lock

* reset package-lock

* fix number

* Build docs

---------

Co-authored-by: Joe Onyilo <[email protected]>
  • Loading branch information
ashinzekene and onyilo authored Feb 28, 2024
1 parent 7638c69 commit 0cf7b31
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<link rel="stylesheet" href="styles.ef46db3751d8e999.css"></head>
<body>
<app-root></app-root>
<script src="runtime.28d09d76bf1169de.js" type="module"></script><script src="polyfills.359a8d996a1015c2.js" type="module"></script><script src="main.1457c096e037997a.js" type="module"></script>
<script src="runtime.28d09d76bf1169de.js" type="module"></script><script src="polyfills.359a8d996a1015c2.js" type="module"></script><script src="main.3d57e84c18aab1d8.js" type="module"></script>

</body></html>

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class Angular4PaystackEmbedComponent implements OnInit {
@Input() plan: string;
@Input() quantity: string;
@Input() subaccount: string;
@Input() split_code: string;
@Input() transaction_charge: number; // tslint:disable-line
@Input() bearer: string;
@Input() paystackOptions: PaystackOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class Angular4PaystackComponent {
@Input() plan: string;
@Input() quantity: string;
@Input() channels: string[];
@Input() split_code: string;
@Input() subaccount: string;
@Input() transaction_charge: number; // tslint:disable-line
@Input() bearer: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class Angular4PaystackDirective {
@Input() quantity: string;
@Input() subaccount: string;
@Input() channels: string[];
@Input() split_code: string;
@Input() transaction_charge: number; // tslint:disable-line
@Input() bearer: string;
@Input() class: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class Angular4PaystackService {
subaccount: obj.subaccount || '',
transaction_charge: obj.transaction_charge || 0, // tslint:disable-line
bearer: obj.bearer || '',
split_code: obj.split_code || '',
};
return paystackOptions;
}
Expand Down
4 changes: 4 additions & 0 deletions projects/angular4-paystack/src/lib/paystack-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export interface PaystackOptions {
* Send 'card' or 'bank' or 'card','bank' as an array to specify what options to show the user paying
*/
channels?: string[];
/**
* Used to apply multiple Split on Payments
*/
split_code?: string;
}

export interface PrivatePaystackOptions extends PaystackOptions {
Expand Down
4 changes: 3 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
[class]="'btn btn-primary m-3'"
[email]="'[email protected]'"
(paymentInit)="paymentInit()"
[amount]="5000000"
[amount]="50000"
[split_code]="'SPL_K0t6TE0Fmm'"
[ref]="tRef"
(onClose)="paymentCancel()"
(callback)="paymentDone($event)"
Expand Down Expand Up @@ -39,6 +40,7 @@ <h3 class="text-center my-3">Paystack Embed</h3>
<angular4-paystack-embed
angular4-paystack
[email]="'[email protected]'"
[split_code]="'SPL_K0t6TE0Fmm'"
(paymentInit)="paymentInit()"
[amount]="5000000" [ref]="tRef" (onClose)="paymentCancel()" (callback)="paymentDone($event)"
[class]="'btn btn-primary btn-lg'" [channels]="['card']"
Expand Down
1 change: 1 addition & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class AppComponent implements OnInit {
options: PaystackOptions = {
amount: 50000,
email: '[email protected]',
split_code: 'SPL_nZXNafVgCd',
ref: `${Math.ceil(Math.random() * 10e10)}`
};
public results = {
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Angular4PaystackModule } from 'angular4-paystack';
],
imports: [
BrowserModule,
Angular4PaystackModule.forRoot('pk_test_c613fc7d428a64fd1e5daea22f8380551b28c78e')
Angular4PaystackModule.forRoot('pk_test_24673c9637a1bf06e5fb6eb989012747183eb2ae')
],
providers: [],
bootstrap: [AppComponent]
Expand Down

0 comments on commit 0cf7b31

Please sign in to comment.