Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

API example: PHP + Slim

This small application demonstrates how you might set up a web server using PHP and Slim with RESTful routes to accept your Recurly.js form submissions and use the tokens to create and update customer billing information without having to handle credit card data.

This example makes use of the official Recurly PHP client library for API v3.

Note that it is not necessary to use the Slim framework. In this example it is used to organize various API actions into distinct application routes, but one could just as easily implement these API actions in separate PHP scripts or within another application framework altogehter.

Routes

Use

Docker

  1. If you haven't already, install docker.

  2. Update the values in docker.env at the (root of the repo)[https://github.com/recurly/recurly-integration-examples/blob/main/docker.env]

  3. Run docker-compose up --build

  4. Open http://localhost:9001

Local

  1. Install dependencies using Composer. These instructions assume a global composer executable.
$ composer install
  1. Set your environment variables.
  2. Run PHP's built-in server.
$ php -S localhost:9001 -t ../../public app.php