Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 2.46 KB

File metadata and controls

55 lines (34 loc) · 2.46 KB

Customer Payments

Customer Payments API is included in the Projects API and uses Stripe under the hood.

General Idea

Customer Payments API allows customers to create payment holds and we can associate them with any entity like project, challenge, phase and so on. For example, to associated payment with a project we could set reference=project and referenceId=12345 (project id) during creating of the payment or after creating using PATCH /customer-payments/{id} endpoint.

Then in any Topcoder's API we could retrieve payments associated with any entity using endpoint GET /customer-payments?reference=project&referenceId=12345.

See references to learn more details about the implementation.

Deployment Guide

  • When deploying Customer Payments API on the server we have to set STRIPE_SECRET_KEY with a Stripe's secret key.
  • When implementing client side, we would have to use Public Stripe Key as shown in the React Demo App.

Quick Demo

The easier way to check it out is to run React Demo App which demonstrate how to use Customer Payments API:

react demo app screenshot

To run the React Demo App:

  1. Run Project Service API

  2. Copy folder react-stripe-js OUTSIDE of tc-project-service folder, and then run inside react-stripe-js:

    # install dependencies
    npm i
    
    # run React Demo App
    npm start
  3. Then you can test payments as shown in the demo video.

Test Data

Several test cards are available for you to use in test mode to make sure this integration is ready. Use them with any CVC and an expiration date in the future.

NUMBER DESCRIPTION
4242424242424242 Succeeds and immediately processes the payment.
4000002500003155 Requires authentication. Stripe triggers a modal asking for the customer to authenticate.
4000000000009995 Always fails with a decline code of insufficient_funds.

For the full list of test cards see the Stripe's guide on testing.

References