Download the PHP package dhavalsagepaypi/sagepay-pi without Composer
On this page you can find all versions of the php package dhavalsagepaypi/sagepay-pi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dhavalsagepaypi/sagepay-pi
More information about dhavalsagepaypi/sagepay-pi
Files in dhavalsagepaypi/sagepay-pi
Package sagepay-pi
Short Description Opayo PI (formerly SagePay PI) PHP API that uses PSR7, PSR17, PSR18 standards.
License MIT
Homepage https://gitlab.com/lumnn/sagepay-pi
Informations about the package sagepay-pi
Laravel SagePayPi
SagePayPi (Opayo)
Insiperd by sagepay-pi
Update
Issue with error resolve with response error.
Opayo PI PHP Client
PHP client for Opayo PI (formerly Sagepay PI) payment API.
Installation
composer require dhavalsagepaypi/sagepay-pi
You'll also need packages providing:
psr/http-message-implementation
(PSR7)psr/http-factory-implementation
(PSR17)psr/http-client-implementation
(PSR18)
Before Using
Generally I'd recommend looking into tests/
directory and Opayo PI API Reference.
This library aims to be as close as it's possible to API docs in terms of implementation.
Every interface used by this library has default implementation in same namespace.
Methods Reference
API endpoints and their library methods:
Obtain Merchant Session Key
POST /merchant-session-keys/
Lumnn\SagePayPi\SagePayPi::getMerchantSessionKey(): string
Will return previously created key if it's not expired or used. Not neccessarily needed for anything as library handles the generation and authentication
Validate MSK
GET /merchant-session-keys/{merchantSessionKey}
Will return bool whether key is valid
Create Card Identifier
POST /card-identifiers
Link Reusable Security Code
POST /card-identifiers/{cardIdentifier}/security-code
Create Transaction (Payment/Refund/Repeat)
POST /transactions
Depending on $transaction
class this will either create payment, refund or repeat transaction
-
@param $transaction
- can be either of following:Lumnn\SagePayPi\Transaction\PaymentRequestInterface
Lumnn\SagePayPi\Transaction\RefundRequestInterface
Lumnn\SagePayPi\Transaction\RepeatRequestInterface
-
@param $options['save_card']
- optional,bool
, default:false
whether save card for future usages. Only when creating payments, not for refund or repeat transactions @return AbstractResponse
- All possible respones are inLumnn\SagePayPi\Transaction\Resopnse
namespace and are created byLumnn\SagePayPi\Transaction\Response\ResponseFactory
Retrieve Transaction
GET /transactions/{transactionId}
Create 3D Secure Object (3DSv1)
POST /transactions/{transactionId}/3d-secure
Returns status string
Create 3D Secure Challenge (3DSv2)
POST /transactions/{transactionId}/3d-secure-challenge
Returns PaymentResponse
Create an Instruction
POST /transactions/{transactionId}/instructions
not implemented
Examples
Constructing client and using resources
The SagePayPi
class is a basic client that is able to perform authenticated requests to API.
It's also in charge of merchant session key and authenticating requests.
Generally, unless you want to speak directly with API it's only required for instantiating other resource classes.
After getting a client you can instantiate resource classes
Creating Card Identifier
This example creates a credit card representation and POST-s that to Opayo for retrieving the card identifier.
This step can (should?) be done in customer browser to avoid deling with credit card details directly. Documentation: https://developer-eu.elavon.com/docs/opayo/integrate-your-own-form#step-3
Processing Telephone Payment (without 3D Secure)
3D Secure Payment
All versions of sagepay-pi with dependencies
psr/http-client Version ^1.0
psr/http-client-implementation Version ^1.0
psr/http-factory-implementation Version ^1.0
psr/http-message Version ^1.0
psr/http-message-implementation Version ^1.0
php-http/discovery Version ^1.14