Getting Started REST API - CyberSource

Getting Started Title Page

REST API

February 2018

CyberSource Corporation HQ | P.O. Box 8999 | San Francisco, CA 94128-8999 | Phone: 800-530-9095

CyberSource Contact Information

For general information about our company, products, and services, go to .

For sales questions about any CyberSource Service, email sales@ or call 650-432-7350 or 888-330-2300 (toll free in the United States).

For support information about any CyberSource Service, visit the Support Center:

Copyright

? 2018 CyberSource Corporation. All rights reserved. CyberSource Corporation ("CyberSource") furnishes this document and the software described in this document under the applicable agreement between the reader of this document ("You") and CyberSource ("Agreement"). You may use this document and/or software only in accordance with the terms of the Agreement. Except as expressly set forth in the Agreement, the information contained in this document is subject to change without notice and therefore should not be interpreted in any way as a guarantee or warranty by CyberSource. CyberSource assumes no responsibility or liability for any errors that may appear in this document. The copyrighted software that accompanies this document is licensed to You for use only in strict accordance with the Agreement. You should read the Agreement carefully before using the software. Except as permitted by the Agreement, You may not reproduce any part of this document, store this document in a retrieval system, or transmit this document, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written consent of CyberSource.

Restricted Rights Legends

For Government or defense agencies. Use, duplication, or disclosure by the Government or defense agencies is subject to restrictions as set forth the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and in similar clauses in the FAR and NASA FAR Supplement. For civilian agencies. Use, reproduction, or disclosure is subject to restrictions set forth in subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights clause at 52.227-19 and the limitations set forth in CyberSource Corporation's standard commercial agreement for this software. Unpublished rights reserved under the copyright laws of the United States.

Trademarks

, , and The Power of Payment are registered trademarks of CyberSource Corporation. CyberSource, CyberSource Payment Manager, CyberSource Risk Manager, CyberSource Decision Manager, and CyberSource Connect are trademarks and/or service marks of CyberSource Corporation. All other brands and product names are trademarks or registered trademarks of their respective owners.

2

CONTENTS

Contents

Recent Revisions to This Document 5

About This Guide 6

Audience and Purpose 6 Conventions 6

Note and Important Statements 6 Text and Command Conventions 6 Related Documents 7 Customer Support 7

Chapter 1

Registration 8

Create an Evaluation Account 8

Creating a Certificate or Shared Secret Key 8 Creating a P12 Certificate for JSON Web Token 8 Creating a Shared Secret Key for HTTP Signature 9 Deactivating Shared Secret Keys 10

Chapter 2

Authentication 11

JSON Web Token Authentication 11 Environment Setup 11 Converting the Certificate to PEM Format using OpenSSL 12 HTTP Headers 15 Encoding and Hashing the Digest 17 Preparing the Payload 18 Generating the JWT Token ? Header, Payload and Signature 18

HTTP Signature Authentication 19 Signing a POST Request 20 v-c-merchant-id 20 Host 20 Date 21 Digest 21 Signature 22

Getting Started - REST API | February 2018

3

Signing a GET Request 23 Code Snippet 24 v-c-merchant-id 24 Date 24 Host 25 Signature 25

Code Examples 27 Adding Headers 27 Creating a Signature Header 28

Chapter 3

Testing 30

Go-Live 30

Contents

Getting Started - REST API | February 2018

4

REVISIONS

Recent Revisions to This Document

Release February 2018 September 2017

August 2017

Changes This release contains only formatting and editing updates. Added JSON Web Token (JWT) registration and authentication. For JWT registration, see "Creating a P12 Certificate for JSON Web Token," page 8. For JWT authentication, see "JSON Web Token Authentication," page 11. Initial release of document.

Getting Started - REST API | February 2018

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download