Volume Selector
The VolumeSelectorWidget provides customers with a clear view of which banks are available for payment.
It is designed to be seamlessly integrated into your checkout flow, particularly in scenarios where multiple payment methods are offered (for example, when using radio buttons to let customers choose their preferred option).
Flutter Implementation
To integrate Volume in Flutter:
Initialize the
VolumeProviderclass the same way as with the regular Volume Button.Add the
VolumeSelectorWidgetto your application where you want to render it as a payment option.
child: ClipRRect( borderRadius: BorderRadius.circular(10), child: Container( color: const Color(0xFFDCDDE8), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0), child: Row( mainAxisSize: MainAxisSize.max, children: [ VolumeSelectorWidget( country: country, currency: currency, size: 35.0, ), const SizedBox(width: 10), const Text( "Pay With Bank App", style: TextStyle( fontSize: 18, fontFamily: 'Noto Sans', fontWeight: FontWeight.w500, ), ), const SizedBox(width: 10), const VolumeInfoWidget(size: 20), const Expanded(child: SizedBox()), Radio<String>( value: 'option1', groupValue: 'option1', onChanged: (String? value) {}, ), ], ), ), ), )
Properties
Key | Type | Example | Description |
|---|---|---|---|
country | String | "GB" | Shows banks only from the specified country |
currency | String | "GBP" | Shows banks that support the given currency |
size | double | 35.0 | Size of the component |
</details>
iOS Implementation
Initialize the
VolumeProviderclass as you would with the Volume Button.Add the
VolumeSelectorwidget in your UI.
ZStack { Rectangle() .foregroundColor(Color(hex: "#DCDDE8")) .cornerRadius(5) .frame(maxWidth: .infinity, maxHeight: 54) HStack(alignment: .center) { VolumeSelector( country: country, currency: currency, size: 35.0 ).padding() Text("Pay With Bank App") .fontWeight(.semibold) .font(.custom("NotoSans-Regular", size: 18)) .frame(maxWidth: .infinity) VolumeInfo(size: 20.0) Image(systemName: "largecircle.fill.circle") .padding() } .frame(maxWidth: .infinity, idealHeight: 54, alignment: .leading) } .padding(.horizontal, 12.0)
Properties
<details> <summary><b>VolumeSelector</b> properties</summary>
Key | Type | Example | Description |
|---|---|---|---|
country | String | "GB" | Shows banks only from the specified country |
currency | String | "GBP" | Shows banks that support the given currency |
size | Double | 35.0 | Size of the component |
</details>
Android Implementation
Initialize the
VolumeProviderclass as with the regular Volume Button.Add the
VolumeSelectorViewin your XML layout:
<com.volume.sdk.payment.VolumeSelectorView android:id="@+id/volumeSelectorView" android:layout_width="45dp" android:layout_height="45dp" />
Set the currency and country in your Kotlin code:
binding.contentMain.volumeSelectorView.setCurrency("GBP") binding.contentMain.volumeSelectorView.setCountry("GB")
Properties
<details> <summary><b>VolumeSelector</b> properties</summary>
Key | Type | Example | Description |
|---|---|---|---|
country | String | "GB" | Shows banks only from the specified country |
currency | String | "GBP" | Shows banks that support the given currency |
</details>
React Native Implementation
Import and render the VolumeSelector component:
import { VolumeSelector } from "@getvolume/react-native"; function MyComponent() { return ( <View> <VolumeSelector currency="GBP" country="GB" height={40} /> </View> ); }
Properties
Prop | Type | Example | Description |
|---|---|---|---|
currency | string | "GBP" | Currency of the payment |
country | string | "GB" | Country of origin of the payment |
height | number | 40 | Optional: Total height of the component in pixels |
Why Country and Currency Matter
The VolumeSelector only displays banks that support the specified country and currency, ensuring your customers see only valid payment options.