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
Copy file name to clipboardExpand all lines: CustomUiImplementation.md
+23-22Lines changed: 23 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Custom UI Implementation
2
-
The Flutterwave SDK can be used with your custom UI where you handle the entire User Interface. This doc shows how to do so.
2
+
The Flutterwave SDK can be integrated with your custom UI, allowing you to manage the entire User Interface. This section provides guidance on how to implement this.
3
3
4
4
### 1. Create a `RaveNonUIManager` instance
5
-
Set the public key, encryption key and other required parameters.
5
+
Begin by creating an instance of `RaveNonUIManager` and setting the public and encryption key, along with other required parameters.
6
6
7
7
RaveNonUIManager raveNonUIManager =
8
8
new RaveNonUIManager()
@@ -30,22 +30,23 @@ Set the public key, encryption key and other required parameters.
30
30
31
31
| Function | Parameter | Type | Required |
32
32
| ------------- |:-------------:| -----:| -----:|
33
-
| setAmount(amount) | This is the amount to be charged from card/account | `double` | Required
34
-
| setCurrency(currency) | This is the specified currency to charge the card in | `String` | Required
35
-
| setfName(fName) | This is the first name of the card holder or the customer | `String` | Required
36
-
| setlName(lName) | This is the last name of the card holder or the customer | `String` | Required
37
-
| setEmail(email) | This is the email address of the customer | `String` | Required
38
-
| setNarration(narration) | This is a custom description added by the merchant. For `Bank Transfer` payments, this becomes the account name of the account to be paid into. See more details [here](https://developer.flutterwave.com/v2.0/reference#pay-with-bank-transfer-nigeria). | `String` | Not Required
39
-
| setPublicKey(publicKey) | Merchant's public key. Get your merchant keys here for [ staging](https://flutterwavedevelopers.readme.io/blog/how-to-get-your-staging-keys-from-the-rave-sandbox-environment) and [live](https://flutterwavedevelopers.readme.io/blog/how-to-get-your-live-keys-from-the-rave-dashboard)| `String` | Required
40
-
| setEncryptionKey(encryptionKey) | Merchant's encryption key. Get your merchant keys here for [ staging](https://flutterwavedevelopers.readme.io/blog/how-to-get-your-staging-keys-from-the-rave-sandbox-environment) and [live](https://flutterwavedevelopers.readme.io/blog/how-to-get-your-live-keys-from-the-rave-dashboard) | `String` | Required
41
-
| setTxRef(txRef) | This is the unique reference, unique to the particular transaction being carried out. It is generated by the merchant for every transaction | `String` | Required
42
-
| setPhoneNumber(phoneNumber) | This sets the customer's phone number. This functions is also overloaded to allow you specify whether the customer can edit their phone number as such: `setPhoneNumber(phoneNumber,false)`. When set to false, the user will not be able to change the number you set here.| `String`<br/><br/>Optional overloads:<br/>`String`, `boolean` | Not Required
43
-
| onStagingEnv(boolean) | Set to `true` if you want your transactions to run in the staging environment otherwise set to `false`. Defaults to false | `boolean` | Not Required
44
-
| setMeta(`List<Meta>`) | Pass in any other custom data you wish to pass. It takes in a `List` of `Meta` objects | List<Meta> | Not Required
45
-
| setSubAccounts(`List<SubAccount>`) | Pass in a `List` of `SubAccount`,if you want to split transaction fee with other people. Subaccounts are your vendors' accounts that you want to settle per transaction. To initialize a `SubAccount` class, do `SubAccount(String subAccountId,String transactionSplitRatio)` or `SubAccount(String subAccountId,String transactionSplitRatio,String transactionChargeType, String transactionCharge)` to also charge the subaccount a fee. [Learn more about split payments and subaccounts](https://developer.flutterwave.com/docs/split-payment).| `List<SubAccount>`| Not Required
46
-
| setIsPreAuth(boolean) | Set to `true` to preauthorise the transaction amount. [Learn more about preauthourization](https://developer.flutterwave.com/v2.0/reference#introduction-1). | `int` | Not Required
47
-
| setPaymentPlan(payment_plan) | If you want to do recurrent payment, this is the payment plan ID to use for the recurring payment, you can see how to create payment plans [here](https://flutterwavedevelopers.readme.io/v2.0/reference#create-payment-plan) and [here](https://flutterwavedevelopers.readme.io/docs/recurring-billing). This is only available for card payments | `String` | Not Required
48
-
| initialize() | Returns the prepared `RaveNonUiManager` that can be used with any of the payment managers for the different payment methods | N/A | Required
33
+
| setAmount(amount) | This sets the amount to be charged from the customer. | `double` | Required
34
+
| setCurrency(currency) | This sets the specified currency to charge the customer in. | `String` | Required
35
+
| setfName(fName) | This sets the first name of the customer. | `String` | Required
36
+
| setlName(lName) | This sets the last name of the customer. | `String` | Required
37
+
| setEmail(email) | This sets the email address of the customer. | `String` | Required
38
+
| setNarration(narration) | This sets a custom description added by the merchant. For `Bank Transfer` payments, this will be shown to the customer as the account name when the account number is resolved. | `String` | Not Required
39
+
| setPublicKey(publicKey) | This sets the Merchant's public key. Get your live and test public key from your dashboard [here](https://app.flutterwave.com/login). For further information on how to retrieve your keys, visit [here](https://flutterwave.com/gh/support/my-account/getting-your-api-keys).| `String` | Required
40
+
| setEncryptionKey(encryptionKey) | This sets the Merchant's encryption key. Get your live and test encryption key from your dashboard [here](https://dashboard.flutterwave.com/login). For further information on how to retrieve your keys, visit [here](https://flutterwave.com/gh/support/my-account/getting-your-api-keys). | `String` | Required
41
+
| setTxRef(txRef) | This is the unique reference, specific to the particular transaction being carried out. It should be generated by the merchant for each transaction. | `String` | Required
42
+
| setPhoneNumber(phoneNumber) | This sets the customer's phone number. This functions has an overload to specify whether the customer can edit their phone number. `setPhoneNumber(phoneNumber,false)`. When set to false, the customer is unable to change the phone number provided.| `String`<br/><br/>Optional overloads:<br/>`String`, `boolean` | Not Required
43
+
| onStagingEnv(boolean) | Set to `true` to carry out test transactions in the staging environment; otherwise the default value
44
+
is `false`. | `boolean` | Not Required
45
+
| setMeta(`List<Meta>`) | Adds custom data to be passed. It accepts a `List` of `Meta` objects | List<Meta> | Not Required
46
+
| setSubAccounts(`List<SubAccount>`) | Accepts a `List` of `SubAccount`, if you want to split transaction fee with other accounts. Subaccounts are vendors' accounts to be settled per transaction. To initialize a `SubAccount` class, use `SubAccount(String subAccountId, String transactionSplitRatio)` or `SubAccount(String subAccountId, String transactionSplitRatio, String transactionChargeType, String transactionCharge)` to also charge the subaccount a fee. [Learn more about split payments and subaccounts](https://flutterwave.com/eg/support/payments/split-payments-with-sub-accounts).| `List<SubAccount>`| Not Required
47
+
| setIsPreAuth(boolean) | Set to `true` to preauthorise the transaction amount. [Learn more about preauthourization](https://flutterwave.com/ci/blog/a-developers-guide-to-implementing-card-pre-authorization-charges-with-flutterwave). | `int` | Not Required
48
+
| setPaymentPlan(payment_plan) | If you want set up recurrent payments, this is the payment plan ID to use. For guidance on creating payment plans visit [here](https://flutterwave.com/gb/support/my-account/creating-and-cancelling-payment-plans). Reucurring payment is only available for card payments | `String` | Not Required
49
+
| initialize() | Returns the prepared `RaveNonUiManager` that can be used with any of the payment managers for the different payment methods. | N/A | Required
49
50
</details>
50
51
51
52
### 2. Initiate a charge
@@ -63,7 +64,7 @@ Use the payment method's manager to initiate a charge. For example to charge car
63
64
cardPayManager.chargeCard(card);
64
65
65
66
### 3. Implement callbacks
66
-
We have predefined callback classes for each payment method. Make your Fragment/Activity (or other class handling the payment interaction) implement the specified callback for the payment method you'd like to use, and override the specified callback functions. For example to charge cards, implement the `CardPaymentCallback`
67
+
We have predefined callback classes for each payment method. Make your Fragment/Activity (or other class handling the payment interaction) implement the specified callback for the payment method you'd like to use, and override the specified callback functions. For example to charge cards, implement the `CardPaymentCallback`.
67
68
<details>
68
69
<summary>See Example</summary>
69
70
@@ -140,14 +141,14 @@ We have predefined callback classes for each payment method. Make your Fragment/
140
141
| Zambia Mobile Money | `ZmMobileMoneyPaymentManager` | `ZmMobileMoneyPaymentCallback`
141
142
</details>
142
143
143
-
> We worked on a module to simplify charge verification when using the No-UI approach. You can read about using it [here](ChargeVerificationUtils.md)
144
+
> We worked on a module to simplify charge verification when using the No-UI approach. You can read about using it [here](ChargeVerificationUtils.md).
144
145
145
146
> Due to the multiple payment methods available, all the methods of the different payment callback classes could not be documented here. Please refer to the individual Javadocs in the code if clarification is needed.
146
147
147
-
> To see a more practical way of using the sdk, head to our sample app in the repository [here](https://github.com/Flutterwave/rave-android/tree/master/app)
148
+
> To see a more practical way of using the SDK, head to our sample app in the repository [here](https://github.com/Flutterwave/rave-android/tree/master/app).
148
149
149
150
## Configuring Proguard
150
-
To configure Proguard, add the following lines to your proguard configuration file. These will keep files related to this sdk
151
+
To configure Proguard, add the following lines to your proguard configuration file. These will keep files related to this SDK.
151
152
```
152
153
keepclasseswithmembers public class com.flutterwave.raveandroid.** { *; }
0 commit comments