Flutter SDK - PortOne's Checkout
Open your app’s
pubspec.yaml
file and add the dependencies as following.Add the following Intent Filter to the Launcher Activity of your app which will be in your manifest file. In the data tag there are two parameters
host
andscheme
whose values will be set according the redirection url.Create an instance of
PortOneImpl()
to access the methods of PortOne Package with the appropriate environment.In the root stateful widgets implement two override method name
initState()
anddispose()
then add the following code to receive Intent from other apps.- Add Listener to listen the payment status by callback to
initState()
- Add Listener to listen the payment link by the SDK
- Add Listener to listen the payment status by callback to
Generate SignatureHash and JWT token.
- Add the following packages to the pubspec.yaml.
crypto: ^3.0.1
jaguar_jwt: ^3.0.0
Signature Hash Generation:
JWT Token Generation:
- Add the following packages to the pubspec.yaml.
Create an instance of
WebCheckoutRequest()
, add the required order details in the instance and call a method namedcheckoutUsingWeb
and pass the params.Things to be taken care while generating payload:
Mandatory params in payload:
If items are provided then please verify the values provided should match the total amount:
sum(items price * items quantity) + shipping charge - discount = amount
Keep the
mobile_redirect_url
null if you are not processing checkout from SDK