Skip to content

Cybersource integration RESTful API for mobile app using Laravel8x

License

Notifications You must be signed in to change notification settings

hc0503/laravel-cybersource-restful-api-demo

Repository files navigation

Laravel RESTful API for Cybersource integration

RESTful API endpoint for simple order checkout using Laravel8x and cybersource/rest-client-php package.

Installation

Composer install

composer install

Laravel env

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

Laravel key generate

php artisan key:generate

Laravel passport install

php artisan passport:install

Laravel migrate and seed

php artisan migrate --seed

Auto dumpload

composer dumpautoload

Run server

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"
}

About

Cybersource integration RESTful API for mobile app using Laravel8x

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published