Download the PHP package gridonic/swisscom-easypay without Composer

On this page you can find all versions of the php package gridonic/swisscom-easypay. 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 swisscom-easypay

Swisscom Easypay

A PHP library to manage payments with Swisscom Easypay.

Build Status License: MIT

Installation

Install the library with composer:

Basic Usage

Note: This guide only covers the basics on how to use this library. More details about Easypay can be found in the official documentations.

Environment

Create a new STAGING or PROD environment based on your credentials:

Checkout page

Redirect the user to the Easypay checkout page where the purchase must be confirmed.

  1. Map the user's shopping cart to a CheckoutPageItem. Note that you must provide the success/error/cancel urls for the redirect back to your shop.
  2. In case of a recurrent service, make sure to pass the duration and duration unit to the checkout page item via setDuration() and setDurationUnit().
  3. Call CheckoutPageService::getCheckoutPageUrl() to obtain the redirect url.

Handling the checkout page response

After confirming the purchase on the checkout page, the user is redirected back to the shop. In order to complete the purchase, the payment must be committed via Easypay's REST API. Use the CheckoutPageResponseService to get the payment-ID or subscription-ID required to commit the payment:

Commit payments

One-time (direct) payments need to be committed via Easypay's REST API. Use the RestApiService to do so:

In case of a service subscription, the procedure is similar:

Easypay REST API

The RestApiService class offers an abstraction of Easypay's REST API to manage payments.


directPayment(string $paymentId, $operation = 'COMMIT') : DirectPaymentResponse

Commit/Reject or Refund a direct payment.


getDirectPayment(string $paymentId) : DirectPaymentResponse

Get all information about a direct payment.


authorizeSubscription(string $authSubscriptionId, $operation = 'COMMIT') : AuthSubscriptionResponse

Commit/Reject/Refund/Renew or Cancel an authorized subscription.


getAuthorizeSubscription(string $authSubscriptionId) : AuthSubscriptionResponse

Get all information about an authorized subscription.


Run tests

Make sure that the dev-dependencies are installed, then execute phpunit from the vendor directory:


All versions of swisscom-easypay with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
guzzlehttp/guzzle Version ^6.3
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 gridonic/swisscom-easypay contains the following files

Loading the files please wait ....