PhonePeConfig class

Runtime configuration for the PhonePe checkout flow.

This class is provided by the package user when calling PhonePeCheckout.startPayment. It encapsulates environment selection, merchant credentials, and optional flags such as logging and headers.

Example (sandbox):

final config = PhonePeConfig(
  environment: PhonePeEnvironment.sandbox,
  merchantId: 'PGTESTPAYUAT86',
  saltKey: '96434309-7796-489d-8924-ab56988a6076',
  saltIndex: '1',
  enableLogs: true,
);

Constructors

PhonePeConfig.new({required PhonePeEnvironment environment, required String merchantId, required String saltKey, required String saltIndex, Map<String, String> headers = const {}, bool enableLogs = true, String packageName = 'com.phonepe.simulator', String flowId = ''})
Creates a new PhonePeConfig.
const

Properties

enableLogs bool
Whether verbose logging should be enabled.
final
environment PhonePeEnvironment
The environment to use: PhonePeEnvironment.sandbox or PhonePeEnvironment.production.
final
flowId String
Custom flow or user identifier.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Extra HTTP headers to attach to API calls.
final
isProduction bool
Returns true if environment is PhonePeEnvironment.production.
no setter
isSandbox bool
Returns true if environment is PhonePeEnvironment.sandbox.
no setter
merchantId String
The merchant identifier issued by PhonePe.
final
packageName String
Target app package for UPI intent use-cases.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saltIndex String
The salt index (for example, "1").
final
saltKey String
The salt key used for signing requests.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited