Standard – Pay Page

Builds PgPayRequest with PayPage as the payment instrument.

Instrument Parameters

ParameterTypeMandatoryDescription
merchantIdmixedYesThe unique identifier of the merchant

merchantTransactionIdmixedYesUnique Transaction ID generated by the merchant to track requests to PhonePe.
Note: – merchantTransactionId length should be less than 35 characters – No Special characters allowed except underscore “_” and hyphen “-“
amountintegerYesThe amount to be paid in paise [100 paise = 1 rupee].
paymentInstrumentPaymentInstrumentYesYou can use the corresponding builder of the PaymentInstruments
merchantUserIdstrYesThe ID assigned to the user by the merchant. Note: – merchantUserId length should be less than 36 characters – No Special characters allowed except underscore “_” and hyphen “-“
redirectUrlstrYesThe URL to which the user should be redirected after the payment is completed.
redirectModestrYesThe mode of redirection after the payment is completed.
callbackUrlstrYesThe URL where PhonePe will send callback notifications after the payment is completed.
callbackModestrYesThe operating system of the device used for the payment.
merchant_order_idmixedNoThe unique identifier of the order
deviceOSPgDeviceContextNoRepresents which OS has been used by the User.

buildPayPageInstrument method from class InstrumentBuilder This function directly returns the Instrument Object and no need to call the build() method on it.

Parameters

Example (Pay Page)

const $MERCHANTID="<merchantId>"; const $SALTKEY="<saltKey>"; const $SALTINDEX="<saltIndex>" const $env=Env::UAT; const $SHOULDPUBLISHEVENTS=true; $phonePePaymentsClient = new PhonePePaymentClient(MERCHANTID, SALTKEY, SALTINDEX, Env::UAT, SHOLDPUBLISHEVENTS); $merchantTransactionId = 'PHPSDK' . date("ymdHis") . "payPageTest"; $request = PgPayRequestBuilder::builder() ->mobileNumber("9999999999") ->callbackUrl("https://webhook.in/test/status") ->merchantId(MERCHANTID) ->merchantUserId("<merchantUserId>") ->amount(<amountInPaise>) ->merchantTransactionId($merchantTransactionId) ->redirectUrl("https://webhook.in/test/redirect") ->redirectMode("REDIRECT") ->paymentInstrument(InstrumentBuilder::buildPayPageInstrument()) ->build(); $response = $phonePePaymentsClient->pay($request); $url=$response->getInstrumentResponse()->getRedirectInfo()->getUrl();