Download the PHP package spryker/app-payment without Composer
On this page you can find all versions of the php package spryker/app-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package app-payment
AppPayment Module
Provides SyncAPI and AsyncAPI schema files and the needed code to be used in a Payment Service Provider App.
Installation
Configure
App Identifier
config/Shared/config_default.php
Testing the AppPayment
You can test the AppPayment as usual with Codeception. Before that you need to run some commands:
With these commands you've set up the AppPayment and can start the tests
Plugins
The following plugins can be used inside your Payment Service Provider App.
GlueApplication
\Spryker\Glue\AppPaymentBackendApi\Plugin\GlueApplication\AppPaymentBackendApiRouteProviderPlugin
This plugin provides the routes for the AppPaymentBackendApi module.
Routes provided
- /private/initialize-payment - Used from the Tenant side to initialize a payment.
- /private/confirm-pre-order-payment - Used from the Tenant side to confirm pre-order payment after the order was persisted.
AppKernel
- \Spryker\Zed\AppPayment\Communication\Plugin\AppKernel\ConfigurePaymentMethodsConfigurationAfterSavePlugin
- \Spryker\Zed\AppPayment\Communication\Plugin\AppKernel\DeleteTenantPaymentsConfigurationAfterDeletePlugin
- \Spryker\Zed\AppPayment\Communication\Plugin\AppKernel\SendAddPaymentMethodMessageConfigurationAfterSavePlugin
- \Spryker\Zed\AppPayment\Communication\Plugin\AppKernel\SendDeletePaymentMethodMessagesConfigurationAfterDeletePlugin
AppWebhook
- \Spryker\Zed\AppPayment\Communication\Plugin\AppWebhook\PaymentWebhookHandlerPlugin
MessageBroker
- \Spryker\Zed\AppPayment\Communication\Plugin\MessageBroker\CancelPaymentMessageHandlerPlugin
- \Spryker\Zed\AppPayment\Communication\Plugin\MessageBroker\CapturePaymentMessageHandlerPlugin
- \Spryker\Zed\AppPayment\Communication\Plugin\MessageBroker\RefundPaymentMessageHandlerPlugin
MessageBrokerAws
- \Spryker\Zed\AppPayment\Communication\Plugin\MessageBrokerAws\ConsumerIdHttpChannelMessageReceiverRequestExpanderPlugin
Extensions
- \Spryker\Zed\AppPayment\Dependency\Plugin\AppPaymentPlatformMarketplacePluginInterface
- \Spryker\Zed\AppPayment\Dependency\Plugin\AppPaymentPlatformPaymentMethodsPluginInterface
- \Spryker\Zed\AppPayment\Dependency\Plugin\AppPaymentPlatformPaymentPagePluginInterface
- \Spryker\Zed\AppPayment\Dependency\Plugin\AppPaymentPlatformPluginInterface
- \Spryker\Zed\AppPayment\Dependency\Plugin\AppPaymentPlatformPreOrderPluginInterface
- \Spryker\Zed\AppPayment\Dependency\Plugin\PaymentTransmissionsRequestExtenderPluginInterface
AppPaymentPlatformMarketplacePluginInterface
You can implement this plugin when your PSP App supports Marketplace capabilities.
AppPaymentPlatformPaymentMethodsPluginInterface
This plugin must be implemented to provide the payment methods that the PSP App supports.
AppPaymentPlatformPaymentPagePluginInterface
This plugin can be implemented to provide a payment page that the PSP App supports. This is only needed when using the redirect flows after the order was created.
AppPaymentPlatformPluginInterface
This is the root plugin which must be implemented to provide the PSP App capabilities from the project level.
AppPaymentPlatformPreOrderPluginInterface
This plugin can be implemented to provide the pre-order capabilities that the PSP App supports.
When using the pre-order payment flow, the InitializePayment API endpoint is used before the order gets persisted and it returns the needed data for an headless approach to add the payment page on project side. Usually, this is done via a provided JavaScript that is send to the frontend in the InitializePayment API call response.
On project side the customer than makes the Payment via the provided JavaScripts and the payment page provided by the PSP provider. After the order is persistzed on the project side a call to the ConfirmPreOrderPayment API endpoint is made to confirm the payment and connect it with the orderReference.
PaymentTransmissionsRequestExtenderPluginInterface
This plugin can be implemented to extend the request data that is send to the PSP App when doing payouts to Merchants. This is usually only needed when the PSP App supports Marketplace capabilities.
Configure the MessageBroker
Add this to your project configuration:
Configure Payment Methods
Each PSP implementation has different Payment Methods available. Through the \Spryker\Zed\AppPayment\Dependency\Plugin\AppPaymentPlatformPaymentMethodsPluginInterface
you can provide the available Payment Methods.
Each Payment Method can also have different configuration details.
Add the plugin interface to your implementation and you can configure the payment methods.
Payment Method default configuration
This package adds endpoints to be used from the SCOS side to each of the configured Payment Methods. The default configuration for each Payment Method is:
- The base URL - This is the URL that the SCOS side will use to call the PSP App.
- Endpoints - The endpoints that the SCOS side will call on the PSP App.
authorization
- The endpoint to initialize a Payment,/private/initialize-payment
pre-order-confirmation
- The endpint to confirm a PreOrder payment,/private/confirm-pre-order-payment
pre-order-cancellation
- The endpint to cancel a PreOrder payment,/private/cancel-pre-order-payment
transfer
- The endpoint to transfer money to a Merchant,/private/transfers
These are used on the SCOS side by their names. F.e. when the SCOS side wants to initialize a payment it will call the authorization
endpoint on the PSP App.
Payment Service Provider with only one Payment Method
A simple example for a PSP with only one Payment Method could look like this:
Here we configure exactly one payment method. The payment method is named "Foo" and the provider is named "Bar". The Payment method also has a configuration that will be persisted on the SCOS side.
The strategy is set to "embedded" which means that the payment page will be embedded in the SCOS checkout. The scripts are the scripts that are needed to embed and run the payment page in the SCOS checkout.
This code runs when the PSP App gets configured. After this method call the so configured methods will be persisted on the App sides database, enriched with default configurations, and via the AddPaymentMethod message sent to the SCOS side.
When the App gets reconfigured and a different number of Payment Methods are configured, the DeletePaymentMethod message will be sent to the SCOS side and the previously configured Payment Methods for the current Tenant will be deleted from the database.
When the PaymentMethod configuration has changed the UpdatePaymentMethod message will be sent to the SCOS side.
Payment Service Provider with multiple Payment Methods
In case you have multiple payment methods, you can add multiple PaymentMethodTransfer objects to the PaymentMethodConfigurationResponseTransfer object. For this, you can get the AppConfigTransfer from the PaymentMethodConfigurationRequestTransfer. An example could look like this:
In thie example you would get one PaymentMethod added to SCOS via the AddPaymentMethod message. The PaymentMethod is named "bar" and the provider is named "PaymentProviderName".
All versions of app-payment with dependencies
spryker/application Version ^3.35.0
spryker/app-kernel Version ^2.1.0
spryker/app-webhook Version ^1.1.0
spryker/event-dispatcher Version ^1.6.0
spryker/glue-application-extension Version ^1.0.0
spryker/glue-backend-api-application Version ^1.7.0
spryker/glue-json-api-convention Version ^1.3.0
spryker/kernel Version ^3.30.0
spryker/log Version ^3.0.0
spryker/message-broker Version ^1.11.0
spryker/message-broker-aws-extension Version ^1.0.0
spryker/router Version ^1.19.0
spryker/symfony Version ^3.0.0
spryker/transfer Version ^3.33.0
spryker/translator Version ^1.13.0