Laravel RESTful API for Cybersource integration
RESTful API endpoint for simple order checkout using Laravel8x and cybersource/rest-client-php package.
composer install
cp .env.example .env
MERCHANT_ID=<merchantID>
APIKEY_ID=<merchantKeyID>
SECRET_KEY=<merchantSecretKey>
KEY_ALIAS=<merchantID>
KEY_PASS=<merchantID>
KEY_FILE_NAME=<merchantID>
// For TESTING use
RUN_ENV=cyberSource.environment.SANDBOX
// For PRODUCTION use
RUN_ENV=cyberSource.environment.PRODUCTION
php artisan key:generate
php artisan passport:install
php artisan migrate --seed
composer dumpautoload
php artisan serve
URL: http://localhost:8000/api/cybersources/checkout
Method: POST
Params:
{
"number": 4111111111111111,
"expiration_month": 12,
"expiration_year": 2031,
"total_amount": "150",
"currency": "USD",
"first_name": "Firstname",
"last_name": "Lastname",
"address1": "1 Market St",
"locality": "San Francisco",
"administrative_area": "CA",
"postal_code": 94105,
"country": "US",
"email": "example@email.com",
"phone_number": "4158880000"
}