Skip to content

PaymentResponse

Raziul Islam edited this page Sep 5, 2024 · 1 revision

PaymentResponse Class

Namespace

Raziul\Sslcommerz\Data

Overview

The PaymentResponse class represents the response received from SSLCommerz after initiating payment via Raziul\Sslcommerz\Facades\Sslcommerz::makePayment(). It provides methods to retrieve various information related to the payment/transaction, such as its status, failure reasons, URLs for payment redirection, and more.

List of the available methods

status(): ?string

public function status(): ?string
  • Description: Returns the status of the payment response in lowercase.
  • Returns: string|null - The status of the payment or null if not set.

success(): bool

public function success(): bool
  • Description: Determines if the payment was successful.
  • Returns: bool - true if the payment was successful, otherwise false.

failed(): bool

public function failed(): bool
  • Description: Determines if the payment failed.
  • Returns: bool - true if the payment failed, otherwise false.

failedReason(): ?string

public function failedReason(): ?string
  • Description: Gets the reason for the payment failure.
  • Returns: string|null - The reason for the payment failure or null if not applicable.

sessionKey(): ?string

public function sessionKey(): ?string
  • Description: Gets the session key of the payment response.
  • Returns: string|null - The session key or null if not set.

gatewayList(): ?array

public function gatewayList(): ?array
  • Description: Gets the list of available gateways.
  • Returns: array|null - An array of available gateways or null if not available.

gatewayPageURL(): ?string

public function gatewayPageURL(): ?string
  • Description: Gets the gateway page URL where the user can complete the payment. Users should be redirected to this URL.
  • Returns: string|null - The URL of the gateway page or null if not available.

redirectGatewayURL(): ?string

public function redirectGatewayURL(): ?string
  • Description: Gets the URL to redirect to the gateway.
  • Returns: string|null - The redirection URL to the gateway or null if not available.

directPaymentURLBank(): ?string

public function directPaymentURLBank(): ?string
  • Description: Gets the direct payment URL for bank payments.
  • Returns: string|null - The direct payment URL for bank payments or null if not available.

directPaymentURLCard(): ?string

public function directPaymentURLCard(): ?string
  • Description: Gets the direct payment URL for card payments.
  • Returns: string|null - The direct payment URL for card payments or null if not available.

directPaymentURL(): ?string

public function directPaymentURL(): ?string
  • Description: Gets the direct payment URL.
  • Returns: string|null - The direct payment URL or null if not available.

redirectGatewayURLFailed(): ?string

public function redirectGatewayURLFailed(): ?string
  • Description: Gets the URL to redirect to if the gateway fails.
  • Returns: string|null - The URL to redirect in case of gateway failure or null if not available.

storeBanner(): ?string

public function storeBanner(): ?string
  • Description: Gets the store banner URL.
  • Returns: string|null - The URL of the store banner or null if not available.

storeLogo(): ?string

public function storeLogo(): ?string
  • Description: Gets the store logo URL.
  • Returns: string|null - The URL of the store logo or null if not available.

description(): ?array

public function description(): ?array
  • Description: Gets the description array.
  • Returns: array|null - An array of descriptions or null if not available.

toArray(): ?array

public function toArray(): ?array
  • Description: Gets the raw response data.
  • Returns: array|null - The raw response data or null if not available.