Customer Payments API is included in the Projects API and uses Stripe under the hood.
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.
- 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.
The easier way to check it out is to run React Demo App which demonstrate how to use Customer Payments API:
To run the React Demo App:
-
Run Project Service API
-
Copy folder react-stripe-js OUTSIDE of
tc-project-service
folder, and then run insidereact-stripe-js
:# install dependencies npm i # run React Demo App npm start
-
Then you can test payments as shown in the demo video.
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.
- Challenge Specification which was used to implement Customer Payments functionality.
- Place a hold on a card Stripe's official guide.
- Finalize payments on the server Stripe's official guide.