This package allows you to invoke the CinetPay counter, make a payment and wait for the status of the payment to be initiated to the second after the payment is completed
The use of the package is the simplest possible, in its use, it is to invoke it with :
The initialization parameters of the counter
The data related to the payment
The callback waiting for the payment return
The callback for listening to the execution error
Some prerequisites are needed to make the package work properly.
Add the following permissions to the file. android/app/src/main/AndroidManifest.xml
<application
...
android:usesCleartextTraffic="true">
...
</application>
...
<uses-permission android:name="android.permission.INTERNET"/>
minSdkVersion 17
Add the following permission to the file ios/Runner/Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
To function, the counter must receive data such as :
Mandatory
Obligatory
Mandatory
In order to make the payment, some data must be submitted to prepare the counter. Thus, we have :
(>= 100 XOF)
| Integer | Obligatory
Obligatory
Obligatory
.Obligatory
.ALL
- MOBILE_MONEY
- CREDIT_CARD
- WALLET
. Default: 'ALL'
Any combination is applicable to comma separated: 'MOBILE_MONEY, WALLET'
| Character string | Optional*
| Character string | Optional*
| String | Optional*
| String | Optional*
| String | Optional*
| Character string | Optional*
| String | Optional*
| Character string | Optional
Note :
*
Mandatory if using the banking universe (CREDIT_CARD)
When the payment is initiated, the package waits for the final status of the payment. Thus, at the end of the payment the package receives the status, which it transmits through the callback that will be defined. The expected return format is the following:
ACCEPTED
or REFUSED)
| Character stringDuring processing, certain types of errors may occur such as, some parameters for the payment are missing. The expected return format is as follows:
In summary, the package is used through a widget call:
CinetPayCheckout(
title: 'Guichet de paiement',
configData: <String, dynamic> {
'apikey': 'YOUR_API_KEY',
'site_id': YOUR_SITE_ID,
'notify_url': 'https://mondomaine.com/notify/'
},
paymentData: <String, dynamic> {
'transaction_id': 'YOUR_TRANSACTION_ID',
'amount': 100,
'currency': 'XOF',
'channels': 'ALL',
'description': 'Test de paiement'
},
waitResponse: (response) {
print(response);
}
onError: (error) {
print(error);
}
);