Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add split code option #85

Merged
merged 7 commits into from
Feb 28, 2024
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
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]="'mailexample@mail.com'"
(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]="'mailexample@mail.com'"
[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: 'user@mail.com',
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
Loading