Download the PHP package jihel/spreedly-bridge without Composer

On this page you can find all versions of the php package jihel/spreedly-bridge. 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 spreedly-bridge

OmnipaySpreedlyBridge

SpreedlyBridge for Omnipay

1- Install

Choose a receiver bridge then add the packages Add plugin to your composer.json require:

{
    "require": {
        "jihel/spreedly-bridge": "1.0",
        "jihel/spreedly-[brand]-receiver": "1.0",
    }
}

or

php composer.phar require jihel/spreedly-[brand]-receiver

Add bundle to your AppKernel.php

public function registerBundles()
{
    $bundles = array(
        ...
        new Jihel\OmnipaySpreedlyBridgeBundle\JihelOmnipaySpreedlyBridgeBundle(),
    );
}

2- Configure

config.yml

[bridge]:
    accounts:
        default:
            password: %viking_pass%
            userId: %viking_user%
            entityId: %viking_entity_id%

omnipay:
    default_gateway: SpreedlyBridge
    methods:
        SpreedlyBridge:
            user: %spreedly_user%
            secret: %spreedly_secret%
            testMode: "%kernel.debug%"

routing.yml

JihelOmnipaySpreedlyBridgeBundle:
    resource: '@JihelOmnipaySpreedlyBridgeBundle/Resources/config/routing.yaml'
    prefix: /_jihel/omnipay

Generate entities

php bin/console doctrine:schema:update --force

3- Usage (Viking pay exemple)

Create a new receiver on /_jihel/omnipay/

The payment method is Omnipay standard BUT you do have to setup the receiver

/form-submit

use Omnipay\SpreedlyBridge\Gateway;

// ...

/** @var ReceiverManager $receiverManager */
$receiverManager = $this->get('jihel.omnipay.manager.receiver');
/** @var TransactionManager $transactionManager */
$transactionManager = $this->get('jihel.omnipay.manager.transaction');

// Works with float, not cents
$initialAmount /= 100;
$gatewayName = Gateway::NAME;

$paymentRequest = new \Jihel\OmnipaySpreedlyBridgeBundle\Model\PaymentRequest();
$paymentRequest
    ->setAmount($initialAmount)
    ->setCurrency($order->getConfig()->getCurrency())
;

$receiver = $receiverManager->findByDomain($domain->getName());

$transaction = $transactionManager->create($paymentRequest, $receiver);
$order->setTransaction($transaction);
$m->persist($order->getTransaction());
$m->persist($order);
$m->flush();

// Redirect to /create

/create

// Finish to setup the gateway
$gateway->setReceiver($payment->getTransaction()->getReceiver());
$response = $gateway->purchase([
    'landingUrl' => $this->generateUrl('FrontTransactionBundle_payment_finish', [
        'uuid' => $order->getUuid(),
        'id' => $payment->getId(),
    ], UrlGeneratorInterface::ABSOLUTE_URL),
    'bin' => $payment->getTransaction()->getCreditCard()->getFirstSixDigits(),
    'currency' => $payment->getTransaction()->getCurrency(),
    'amount' => $payment->getTransaction()->getAmount(),
    'cardReference' => $payment->getTransaction()->getCreditCard()->getToken(),
])->send();

if ($response->isRedirect()) {
    $transactionManager->pendingPayment($payment);

    $response->redirect();
    die;
} elseif (!$response->isSuccessful()) {
    $transactionManager->failPayment($payment);
    $this->addFlash('danger', $response->getMessage());

    // Redirect to form
}

// Else it's success
$transactionManager->depositPayment($payment, $response);

// Redirect to after payment page

/3ds

$gateway->setReceiver($payment->getTransaction()->getReceiver());
$response = $gateway->completePurchase([
    '3ds' => $request->query->get('id'),
])->send();

Then handle as standard omnipay response

4- Thanks

Thanks to my cat to keep meowing me. Thanks to me for giving my free time doing class for lazy developers. You can access read CV here


All versions of spreedly-bridge with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
symfony/symfony Version >=2.8
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 jihel/spreedly-bridge contains the following files

Loading the files please wait ....