# Rave

Flutterwave's Rave payment gateway PHP SDK

author | Olufemi Olanipekun iolufemi@ymail.com
version | 1.0
package | Default

### Methods

## Construct

    __construct(string $publicKey, string $secretKey, string $prefix, string $env = 'staging', boolean $overrideRefWithPrefix = false) : object

### Arguments

#### $publicKey

`string`

Your Rave publicKey. Sign up on https://rave.flutterwave.com to get one from your settings page

#### $secretKey

`string`

Your Rave secretKey. Sign up on https://rave.flutterwave.com to get one from your settings page

#### $prefix

`string`

This is added to the front of your transaction reference numbers

#### $env

`string`

This can either be 'staging' or 'live'

#### $overrideRefWithPrefix

`boolean`

Set this parameter to true to use your prefix as the transaction reference

### Response

`object`

## Generates a checksum value for the information to be sent to the payment gateway

    createCheckSum() : object

### Response

`object`

## Generates a transaction reference number for the transactions

    createReferenceNumber() : object

### Response

`object`

## Sets the event hooks for all available triggers

    eventHandler(object $handler) : object

### Arguments

#### $handler

`object`

This is a class that implements the Event Handler Interface

### Response

`object`

## gets the transaction amount

    getAmount() : string

### Response

`string`

## gets the transaction country

    getCountry() : string

### Response

`string`

## gets the transaction currency

    getCurrency() : string

### Response

`string`

## gets the transaction description

    getDescription() : string

### Response

`string`

## gets the customer email

    getEmail() : string

### Response

`string`

## gets the customer firstname

    getFirstname() : string

### Response

`string`

## gets the customer lastname

    getLastname() : string

### Response

`string`

## gets the payment page logo

    getLogo() : string

### Response

`string`

## gets the transaction meta data

    getMetaData() : string

### Response

`string`

## gets payment page button text

    getPayButtonText() : string

### Response

`string`

## gets the allowed payment methods

    getPaymentMethod() : string

### Response

`string`

## gets the customer phonenumber

    getPhoneNumber() : string

### Response

`string`

## gets the transaction redirect url

    getRedirectUrl() : string

### Response

`string`

## gets the current transaction reference number for the transaction

    getReferenceNumber() : string

### Response

`string`

## gets the payment page title

    getTitle() : string

### Response

`string`

## Generates the final json to be used in configuring the payment call to the rave payment gateway

    initialize() : string

### Response

`string`

## Handle canceled payments with this method

    paymentCanceled(string $referenceNumber) : object

### Arguments

#### $referenceNumber

`string`

This should be the reference number of the transaction that was canceled

### Response

`object`

## Requerys a previous transaction from the Rave payment gateway

    requeryTransaction(string $referenceNumber) : object

### Arguments

#### $referenceNumber

`string`

This should be the reference number of the transaction you want to requery

### Response

`object`

## Sets the transaction amount

    setAmount(integer $amount) : object

### Arguments

#### $amount

`integer`

Transaction amount

### Response

`object`

## Sets transaction country

    setCountry(string $country) : object

### Arguments

#### $country

`string`

The transaction country. Can be NG, US, KE, GH and ZA

### Response

`object`

## Sets the transaction currency

    setCurrency(string $currency) : object

### Arguments

#### $currency

`string`

The transaction currency. Can be NGN, GHS, KES, ZAR, USD, EUR and GBP

### Response

`object`

## Sets the transaction description

    setDescription(string $customDescription) : object

### Arguments

#### $customDescription

`string`

The description of the transaction

### Response

`object`

## Sets the customer email

    setEmail(string $customerEmail) : object

### Arguments

#### $customerEmail

`string`

This is the paying customer's email

### Response

`object`

## Sets the customer firstname

    setFirstname(string $customerFirstname) : object

### Arguments

#### $customerFirstname

`string`

This is the paying customer's firstname

### Response

`object`

## Sets the customer lastname

    setLastname(string $customerLastname) : object

### Arguments

#### $customerLastname

`string`

This is the paying customer's lastname

### Response

`object`

## Sets the payment page logo

    setLogo(string $customLogo) : object

### Arguments

#### $customLogo

`string`

Your Logo

### Response

`object`

## Sets the transaction meta data. Can be called multiple time to set multiple meta data

    setMetaData(array $meta) : object

### Arguments

#### $meta

`array`

This are the other information you will like to store with the transaction. It is a key => value array. eg. PNR for airlines, product colour or attributes. Example. array('name' => 'femi')

### Response

`object`

## Sets the payment page button text

    setPayButtonText(string $payButtonText) : object

### Arguments

#### $payButtonText

`string`

This is the text that should appear on the payment button on the Rave payment gateway.

### Response

`object`

## Sets the allowed payment methods

    setPaymentMethod(string $paymentMethod) : object

### Arguments

#### $paymentMethod

`string`

The allowed payment methods. Can be card, account or both

### Response

`object`

## Sets the customer phonenumber

    setPhoneNumber(string $customerPhone) : object

### Arguments

#### $customerPhone

`string`

This is the paying customer's phonenumber

### Response

`object`

## Sets the transaction redirect url

    setRedirectUrl(string $redirectUrl) : object

### Arguments

#### $redirectUrl

`string`

This is where the Rave payment gateway will redirect to after completing a payment

### Response

`object`

## Sets the payment page title

    setTitle(string $customTitle) : object

### Arguments

#### $customTitle

`string`

A title for the payment. It can be the product name, your business name or anything short and descriptive

### Response

`object`

### Properties

## publicKey

    publicKey :

### Type(s)

``

## secretKey

    secretKey :

### Type(s)

``

## amount

    amount :

### Type(s)

``

## paymentMethod

    paymentMethod :

### Type(s)

``

## customDescription

    customDescription :

### Type(s)

``

## customLogo

    customLogo :

### Type(s)

``

## customTitle

    customTitle :

### Type(s)

``

## country

    country :

### Type(s)

``

## currency

    currency :

### Type(s)

``

## customerEmail

    customerEmail :

### Type(s)

``

## customerFirstname

    customerFirstname :

### Type(s)

``

## customerLastname

    customerLastname :

### Type(s)

``

## customerPhone

    customerPhone :

### Type(s)

``

## txref

    txref :

### Type(s)

``

## integrityHash

    integrityHash :

### Type(s)

``

## payButtonText

    payButtonText :

### Type(s)

``

## redirectUrl

    redirectUrl :

### Type(s)

``

## meta

    meta :

### Type(s)

``

## env

    env :

### Type(s)

``

## transactionPrefix

    transactionPrefix :

### Type(s)

``

## logger

    logger :

### Type(s)

``

## handler

    handler :

### Type(s)

``

## stagingUrl

    stagingUrl :

### Type(s)

``

## liveUrl

    liveUrl :

### Type(s)

``

## baseUrl

    baseUrl :

### Type(s)

``

## transactionData

    transactionData :

### Type(s)

``

## overrideTransactionReference

    overrideTransactionReference :

### Type(s)

``

## requeryCount

    requeryCount :

### Type(s)

``