PHPackages                             tarekhammad/faw-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tarekhammad/faw-sdk

ActiveLibrary[API Development](/categories/api)

tarekhammad/faw-sdk
===================

Fawaterk API Integration made easier.

0101PHP

Since Nov 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tekkahammadxo/fawaterak-sdk)[ Packagist](https://packagist.org/packages/tarekhammad/faw-sdk)[ RSS](/packages/tarekhammad-faw-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

fawaterk-sdk
============

[](#fawaterk-sdk)

Fawaterk API Integration made easy.

How to use?
===========

[](#how-to-use)

It's quite simple;

First we need to require the SDK via composer.

`composer require fawaterk/fawaterk-sdk`

Then, in your PHP code, you need to create an object of the class \\Fawaterk\\Fawaterk then you can call several methods to set the correct data required by the API.

what are the required data? how to format them?
-----------------------------------------------

[](#what-are-the-required-data-how-to-format-them)

We have several required pieces of information for us to create an invoice for you and your customer:

1. vendorKey =&gt; for you to have one, you'll need to create an account on  it's absolutely free!
2. customer =&gt; this is some information about the customer that is trying to pay for his order.

- The customer is an array that has 4 keys:

\-- name

\-- email

\-- phone

\-- address

3. currency =&gt; it is the currency which the invoice is going to be in ( the currency your customer will pay in ).

\-- currently we support 3 currencies which are EGP, SAR and EUR. More to be added in the future.

4. cartItems =&gt; An array of order items. each item is an array that has 3 keys:

\-- name

\-- quantity

\-- price

5. shipping =&gt; a float of the shipping value
6. cartTotal =&gt; a float of the total amount of the cart that the customer should pay ( with taxes and shipping applied )
7. redirectUrl =&gt; a string of the url that the customer should be redirected to after a successful invoice payment.

---

Working Example
===============

[](#working-example)

Below is a fully-working example with actual code.

```
