This repository provides simple examples demonstrating usage of the Unified checkout flows. For more details visit our Developer Guide at Unified Checkout: https://developer.cybersource.com/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-intro.html
This project has been created using the Laravel framework and hosted on Herd. Alternatively, feel free to use XAMPP set up for starting a secure server on https using Apache.
If using Herd, please make sure to start the server on https on https://cybersource-unified-checkout-sample-php.test/
- Clone or download this repository.
- cd into unified-checkout-sample-php directory
- Update json/js configuration files in the resource/data folder with your CyberSource sandbox credentials.
- Run npm install
- Run composer update
- Php 8.4
- Node/npm
❗️ This application uses Cybersource's test environment, and should be used with mock data.
All information is secured to our production standards, but please use a test card number such as 4111 1111 1111 1111 and false name / address information on the /checkout page (where information is entered into Unified Checkout's UI) to limit usage of any unnecessary personal information.
Unified Checkout requires an HTTPS URL, so navigate to https://cybersource-unified-checkout-sample-php.test/ and proceed through the various screens to understand how things work under the hood. Note that you may receive a warning about the certificate's validity, and can simply proceed.
To serve from a different domain, or change other request attributes, see default capture context request.
The targetOrigins field in this request controls where your checkout page is served.
Follow the steps outlined in the Unified Checkout developer guide to create a portfolio-level merchant with the proper configurations, upload a public encryption key, and create a transacting merchant as a child of this portfolio. Uncomment the following properties in resources/data ExternalConfiguration.php in addition to the merchant properties specified in Setup Instructions. $this->merchantID = MERCHANT ID $this->apiKeyID = MERCHANT KEY ID $this->secretKey = MERCHANT SECRET