pub struct Charge { /* private fields */ }
Expand description
This struct is used to create a charge body for creating a Charge Authorization using the Paystack API.
IMPORTANT: This class can only be created using the ChargeBuilder.
The struct has the following fields: - amount: Amount should be in the smallest unit of the currency e.g. kobo if in NGN and cents if in USD - email: Customer’s email address - currency (Optional): Currency in which amount should be charged (NGN, GHS, ZAR or USD). Defaults to your integration currency. An enum is used for type safety. - authorizatuin_code: A valid authorization code to charge - reference (Optional): Unique transaction reference. Only -, ., = and alphanumeric characters allowed. - channel (Optional): Send us ‘card’ or ‘bank’ or ‘card’,‘bank’ as an array to specify what options to show the user paying. An enum is used to implement this for type safety - transaction_charge (Optional): A flat fee to charge the subaccount for this transaction (in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR). This overrides the split percentage set when the subaccount was created. Ideally, you will need to use this if you are splitting in flat rates (since subaccount creation only allows for percentage split). e.g. 7000 for a 70 naira