Download the PHP package cashmos/cashmos-php-api without Composer

On this page you can find all versions of the php package cashmos/cashmos-php-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cashmos-php-api

PHP API for Cashmos Payments

The is the official PHP SDK for Cashmos Payment Processing.

Installation

The SDK can be easily installed using composer. To install, run the following command on your terminal or command prompt on Windows (make sure composer is installed and available in your project directory).

 composer require cashmos/cashmos-php-api

If you don't want to use composer, you may directly download a zip file from among the releases.

Authentication & Cashmos Services

To consume any of the services offered by this SDK, you'll need the client id and secret for your business account. These can be viewed under the API tab of your business screen of Cashmos online. Create a business at Cashmos.com if you don't already have an account.

Order Processing

Use the following steps to process an order with Cashmos:

I. Create an order:

   $order = new Cashmos\Services\Order\Order();

   // Add items to order

   $order->addItem(
        new Cashmos\Services\Order\Item($name, $unitPrice, $quantity, $description),
   );

   $order->addItem(
       new Cashmos\Services\Order\Item($name2, $unitPrice2, $quantity2, $description2),
   );

   // Set order total.
   // Note that this is the total amount to be charged to the user.
   // Cashmos does not do any item level calculations for total amount.

   $order->setOrderTotal($orderTotal)

   // You can add any custom data to the order which 
   // could be retrieved later after confirmation.
   // This may be information used to identify the customer
   // making the order, etc.
   $customData = [
     'foo' => 'bar'
   ];
   $order->addCustomData($customData);

   // Set return and cancel urls

   $order->returnUrl('https://business.com/paid'); // Url when payment authorization was successful.
   $order->cancelUrl('https://business.com/canceled'); // Url when payment authorization was canceled.

II. Process Order Authorization:

This step allows the user to choose their payment method and provide authorization for the purchase. However, the user's is NOT actually charged. Use the next step to confirm the order and actually charge the user.

    $cashmos = new Cashmos\Cashmos($clientId, $secret);
    $cashmos->process($order);

If the user authorizes the payment, Cashmos will return to the "returnUrl" provided with a payment token as a query parameter (?token="random-token"). This payment token is used to confirm the payment.

III. Confirm Order:

Prerequisites

Security Vulnerabilities

If you discover a security vulnerability in this API, please email the details of the vulnerability to [email protected].

License


All versions of cashmos-php-api with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.2
illuminate/support Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cashmos/cashmos-php-api contains the following files

Loading the files please wait ....