Builder Methods
To start using builder methods, you first need to create a builder instance:
use PayHere\PayHere; $builder = PayHere::builder();guest()
The guest method set the transaction as a guest.
$builder->guest();title()
The title method set the order title for the transaction.
$builder->title('Taxi Hire');recurring()
The recurring method set the transaction as a recurring payment. You can specify the recurrence period (e.g., 6 Month, 1 Year) and the duration to charge (e.g., 1 Year, Forever).
$builder->recurring(recurrence: '1 Month', duration: '1 Year');startupFee()
The startupFee method sets an additional fee or discount for the first payment occurrence in a recurring payment.
$builder->startupFee(1000);authorize()
The authorize method set the transaction as an authorize payment.
$builder->authorize();preapprove()
The preapprove method set the transaction as a pre-approved payment.
$builder->preapprove();amount()
The amount method set the amount for the transaction.
$builder->amount(100);checkout()
The checkout method redirects customer to the payment gateway.
$builder->checkout();You must call this method at the end of builder method chain.