You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multi-Split Payment feature [using the newcode structure in Main Branch] (#172)
* feat: Add the Multi-Split Payment Feature
This adds the Multi-Split Payment Feature as documented by Paystack (https://paystack.com/docs/payments/multi-split-payments/).
This include using split_code and dynamic splits, which comes in handy in creating splits on the fly.
* docs: Update the README file
Update the README file with information on the Multi-Split Payment feature
Copy file name to clipboardExpand all lines: README.md
+22
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,8 @@ function Pay(){
119
119
|`billingMobile`| Billers mobile | default: `nill`|
120
120
|`billingName`| Billers Name | default: `nill`|
121
121
|`subaccount`| Specify subaccount code generated from the Paystack Dashboard or API to enable Split Payment on the transaction. Here's an example of usage: `subaccount: "SUB_ACCOUNTCODE"`| default: `nill`|
122
+
|`split_code`| Specify _split_code_ generated from the Paystack Dashboard under _Transaction Splits menu_ or API to enable Multi-Split Payment on the transaction. According to Paystack's documentation available [here](https://paystack.com/docs/payments/multi-split-payments/), Multi-split enables merchants to split the settlement for a transaction across their payout account, and one or more subaccounts. Here's an example of usage: `split_code: "SPL_xxxxxxx"`| default: `nill`|
123
+
|`split`| Specify _split_ object to enable Dynamic Multi-Split Payment on the transaction. According to Paystack's documentation available [here](https://paystack.com/docs/payments/multi-split-payments/#dynamic-splits), Sometimes, you can't determine a split configuration until later in the purchase flow. With dynamic splits, you can create splits on the fly. The Structure is defined [in the Dynamic Multi-Split Structure below](#dynamic-multi-split-payment-object-structure)| default: `nill`|
122
124
|`channels`| Specify payment options available to users. Available channel options are: ["card", "bank", "ussd", "qr", "mobile_money"]. Here's an example of usage: `channels={["card","ussd"]}`| default: `["card"]`|
123
125
|`onCancel`| callback function if user cancels or payment transaction could not be verified. In a case of not being verified, transactionRef number is also returned in the callback | default: `nill`|
124
126
|`onSuccess`| callback function if transaction was successful and verified (it will also return the transactionRef number in the callback ) | default: `nill`|
@@ -127,6 +129,26 @@ function Pay(){
127
129
|`handleWebViewMessage`| Will be called when a WebView receives a message | default: `true`|
|`type`| Dynamic Multi-Split type. Value can be `flat` or `percentage`|`YES`|
138
+
|`bearer_type`| Defines who bears the charges. Value can be `all`, `all-proportional`, `account` or `subaccount`|`YES`|
139
+
|`subaccounts`| An array of subaccount object as defined [below](#dynamic-multi-split-payment-sub-account-object-structure). e.g. {"subaccount": 'ACCT_xxxxxx', "share": 60} |`YES`|
140
+
|`bearer_subaccount`| Subaccount code of the bearerof the transaction. It should be specified if _bearer_type_ is `subaccount`|`NO`|
141
+
|`reference`| Unique reference of the split. Can be defined by the user |`NO`|
|`subaccount`| Specify subaccount code generated from the Paystack Dashboard or API to enable Split Payment on the transaction. Here's an example of usage: `subaccount: "SUB_ACCOUNTCODE"`|`YES`|
149
+
|`share`| Defines the amount in `percentage (integer)` or `value (decimal allowed)` depending on the type of multi-split defined |`YES`|
Want to help improve this package? [Read how to contribute](https://github.com/just1and0/React-Native-Paystack-WebView/blob/main/CONTRIBUTING.md) and feel free to submit your PR!
constrefNumberString=refNumber ? `ref: '${refNumber}',` : '';// should only send ref number if present, else if blank, paystack will auto-generate one
55
63
56
64
constsubAccountString=subaccount ? `subaccount: '${subaccount}',` : '';// should only send subaccount with the correct subaccoount_code if you want to enable split payment on transaction
57
65
66
+
constsplitCodeString=split_code ? `split_code: '${split_code}',` : '';// should only send split_code with the correct split_code from the split group if you want to enable multi-split payment on transaction
67
+
//Multi-split enables merchants to split the settlement for a transaction across their payout accounts, and one or more subaccounts
68
+
69
+
constdynamicSplitString=dynamicSplitObjectIsValid(split) ? `split: `+JSON.stringify(split)+`,` : '';// should only send split for dynamic multi-account split with the correct split object as defined
70
+
//Sometimes, you can't determine a split configuration until later in the purchase flow. With dynamic splits, you can create splits on the fly. This can be achieved by passing a split object
0 commit comments