Code Monkey home page Code Monkey logo

swedbank-pay-sdk-php's Introduction

Swedbank Pay SDK for PHP

Build status Latest Stable Version Total Downloads Codecov License

Swedbank Pay SDK for PHP

About

UNSUPPORTED: This SDK is at an early stage of development and is not supported as of yet by Swedbank Pay. It is provided as a convenience to speed up your development, so please feel free to play around. However, if you need support, please wait for a future, stable release.

The Swedbank Pay SDK for PHP simplifies integrations against Swedbank Pay's API Platform by providing native PHP interface towards the REST API.

This SDK includes the following payments options:

  • Checkout
  • Credit and debit cards (Visa, Mastercard, Visa Electron, Maestro etc).
  • Invoice
  • Swish
  • Vipps
  • MobilePay Online
  • Trustly

Documentation

Documentation about Swedbank Pay's API Platform can be found on the Swedbank Pay Developer Portal for now.

Installation

The recommended way to install the Swedbank Pay SDK for PHP library is with Composer. You can also download the source code from one of the releases here on GitHub or simply clone this repository.

Composer

The preferred method is via Composer. Follow the installation instructions if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this SDK:

composer require swedbank-pay/swedbank-pay-sdk-php

Examples

You can find examples in /tests directory or check out Swedbank Pay Core for WooCommerce code.

swedbank-pay-sdk-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

swedbank-pay-sdk-php's Issues

How to use the SDK in PHP

Hi,

Maybe a stupid question but if I want to use this in PHP, on the web server, is there any information or example on how to do that? All I see in the SDK is classes so I figured I should have a PHP-file where I call the classes depending on what operations I want to do, obviously. But what file do I require to start the SDK? I have no autoload.php since I just downloaded this in a zip-file and then uploaded to our web server. I am not familiar with composer, git or unit testing and such, I just want to use this SDK on a web site to integrate Swedbank Pay.

Is there any example-PHP-file? And yes I see that there is a tests-folder but this is supposed to be run via unittest i guess so it doesn't really help.

Or maybe I am completely on the wrong track here?

Thanks in advance!

Fix deprecated warning in PHP 8

Fix deprecation warning:
There's problem in class checking if have null instead of string:

        if (class_exists($this->getRequestService()->getResponseResourceFQCN())) {
            $responseResourceFCQN = $this->getRequestService()->getResponseResourceFQCN();
            $responseResource = $this->resourceFactory->createFromFqcn($serviceBaseName, $responseResourceFCQN, $data);
            $this->setResponseResource($responseResource);
            return;
        }

I suggest the follow solution:

        if ($this->getRequestService()->getResponseResourceFQCN() &&
            class_exists($this->getRequestService()->getResponseResourceFQCN())
        ) {
            $responseResourceFCQN = $this->getRequestService()->getResponseResourceFQCN();
            $responseResource = $this->resourceFactory->createFromFqcn($serviceBaseName, $responseResourceFCQN, $data);
            $this->setResponseResource($responseResource);
            return;
        }

Path to composer.lock

I know this SDK is still beta only, but I'm using it as a base for our integration.

One error that occurred to me is that in \SwedbankPay\Api\Client\Version you're trying to locate composer.lock using current working directory (getcwd()). In our case that won't work because that is another folder.

For us, using the Laravel helper base_path('composer.lock') works much better.

Just wanted to leave a note here if someone else having problems with this.

Stable release?

Hello! I was wondering how long it might be before we see a stable release. Could it be weeks, months, or perhaps even years away? Is there a specific release date in mind? Thank you!

Undefined index: version - Exception is thrown in v4.0.0-beta.2

Exception message:

1 exception(s):
Exception #0 (SwedbankPay\Core\Exception\ClientException): Exception: Notice: Undefined index: version in /home/danieln7/staging/vendor/swedbank-pay/swedbank-pay-sdk-php/src/SwedbankPay/Api/Client/Client.php on line 67 in /home/danieln7/staging/vendor/magento/framework/App/ErrorHandler.php:61

Line that caused the exception:
https://github.com/SwedbankPay/swedbank-pay-sdk-php/blob/v4.0.0-beta.2/src/SwedbankPay/Api/Client/Client.php#L65

Reason:
Version does not exist in the composer.json file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.