Test Your Setup {#restgs-jwt-shared-secret-test}
================================================

![](/content/dam/documentation/cybs/en-us/topics/platform/rest/getting-started/images/flow-keys-sharedsecret-5-750x175.svg/jcr:content/renditions/original)  
`Bank of America` recommends that you test and verify that your payment system can securely send and receive REST API messages before transitioning to a production account. Use the test examples provided in this section to test your set up. You should also test any additional API requests that you will use in your live environment.

Troubleshooting Using the REST SDK {#restgs-jwt-shared-secret-test_d10e28}
--------------------------------------------------------------------------

You can also use the REST Client SDK to review how the SDK constructs, sends and receives JWT messages with MLE. If you are receiving unsuccessful responses from your custom integration, comparing how your system sends and receives messages to the REST SDK can be helpful. For more information about how to install the REST Client SDK into your system, see the [Install the REST SDK](/docs/bofa/en-us/platform/developer/all/rest/rest-getting-started/restgs-sdk-intro/restgs-sdk-install-intro.md "") section.

Test Your REST--API Response MLE Key {#restgs-jwt-shared-secret-mle-dev-center}
===============================================================================

Follow these steps to verify that your API response MLE key is working. If you have not already created or submitted an API response MLE certificate, see the Create or Submit a REST---API Response MLE Key section in [Enable Message-Level Encryption](/docs/bofa/en-us/platform/developer/all/rest/rest-getting-started/restgs-jwt-shared-secret-intro/restgs-mle-shared-secret-intro.md "").

1. Go to the REST API Reference page in the `Bank of America` Developer Center:

2. On the left navigation panel, choose an API that supports MLE. For testing purposes, you can choose **Intelligent Commerce \&gt; Intelligent Commerce Product \&gt; Enroll a Card** .  
   MLE support is indicated by **Request MLE** and **Response MLE** at the top of the screen.  
   ![](/content/dam/documentation/cybs/en-us/topics/platform/rest/getting-started/images/restgs-mle-tags.png/jcr:content/renditions/original)

3. Choose the **MLE Configuration** tab.

4. In the Message Level Encryption Credentials section, enter your API response MLE key credentials:

   * **Response encryption:** Enter the key ID of your REST---API response MLE key.  
     You saved this key ID in Step 10 in the Create or Submit a REST---API Response MLE Key section in [Enable Message-Level Encryption](/docs/bofa/en-us/platform/developer/all/rest/rest-getting-started/restgs-jwt-shared-secret-intro/restgs-mle-shared-secret-intro.md "").
   * **Response decryption:** Click **Browse** to submit your own private decryption key from your local system. Only *.p12* files are supported.

   {#restgs-jwt-shared-secret-mle-dev-center_ul_xhx_ncx_s3c}  
   ![](/content/dam/documentation/cybs/en-us/topics/platform/rest/getting-started/images/restgs-mle-dev-center-upload.png/jcr:content/renditions/original) {#restgs-jwt-shared-secret-mle-dev-center_step-4}
   {#restgs-jwt-shared-secret-mle-dev-center_step-4}

5. Click **Update Credentials**.

6. From the **Send** drop-down menu, choose **Send Request with Message Level Encryption**.

7. Click **Send** .  
   ![](/content/dam/documentation/cybs/en-us/topics/platform/rest/getting-started/images/restgs-mle-dev-center-send.png/jcr:content/renditions/original)

8. If a *Success: HTTP Status Code: 201* message displays in the Response section, your REST---API response MLE key is verified as properly configured.  
   ![](/content/dam/documentation/cybs/en-us/topics/platform/rest/getting-started/images/restgs-mle-ebc-success.png/jcr:content/renditions/original)
   {#restgs-jwt-shared-secret-mle-dev-center_ol_cvb_jcx_s3c}

Completing a Test Transaction {#restgs-jwt-shared-secret-test-transaction}
==========================================================================

After setting up your system to be REST compliant, you can send these test requests to verify that you can send and receive REST API messages.

> IMPORTANT  
> Depending on your payment processor, you may be required to send additional fields that are not shown in these examples.  
> Follow these steps to verify that you can complete a test transaction:

1. **Authorize a Payment**

2. You send this POST request to the `https://apitest.merchant-services.bankofamerica.com``/pts/v2/payments` endpoint:

   ```keyword
   {
       "orderInformation": {
           "billTo": {
               "country": "US",
               "lastName": "Kim",
               "address1": "201 S. Division St.",
               "postalCode": "48104-2201",
               "locality": "Ann Arbor",
               "administrativeArea": "MI",
               "firstName": "Kyong-Jin",
               "email": "test@bankofamerica.com"
           },
           "amountDetails": {
               "totalAmount": "100.00",
               "currency": "USD"
           }
       },
       "paymentInformation": {
           "card": {
               "expirationYear": "2031",
               "number": "4111111111111111",
               "expirationMonth": "12",
               "type": "001"
           }
       }
   }
   ```
3. You receive a successful response and store the authorization transaction ID in the id field. A successful response is indicated by a 201 HTTP status code.

   ```
   "id" : "6461731521426399003473"
   ```
4. **Capture an Authorized Payment**

5. You send this POST request to the `https://apitest.sa.cybersource.com``/pts/v2/payments/`*{id}*`/captures` endpoint and include the authorization transaction ID as the *`{id}`*:

   ```keyword
   https://apitest.sa.cybersource.com/pts/v2/payments/6461731521426399003473/captures
   ```

   ```
   {
       "clientReferenceInformation": {
           "code": "ABC123"
       },
       "orderInformation": {
           "amountDetails": {
               "totalAmount": "100.00",
               "currency": "USD"
       }
   }
   ```
6. You receive a successful response and store the capture transaction ID in the id field. A successful response is indicated by a 201 HTTP status code.

   ```
   "id": "6772994431376681303954"
   ```
7. **Refund a Captured Payment**

8. You send this POST request to the `https://apitest.merchant-services.bankofamerica.com``/pts/v2/payments/`*{id}*`/refunds` endpoint and include the capture transaction ID as the *{id}*:

   ```keyword
   https://apitest.merchant-services.bankofamerica.com/pts/v2/payments/6772994431376681303954/refunds
   ```

   ```
   {
       "orderInformation": {
           "amountDetails": {
               "totalAmount": "100.00",
               "currency": "USD"
           }
       }
   }
   ```
9. You receive a successful response, which verifies that your system can complete a transaction. A successful response is indicated by a 201 HTTP status code.

