Run active mode receiver tests

This tutorial demonstrates how payment receivers can use Test Harness as a mock sender to send themselves payments and verify the integrity of their RPOs.

In the following tests cases, we use the RippleNet Server UI to receive and complete payments. And we create the active mode test by uploading a test profile (not a Project Workbook).

Prepare Test Harness

To run the tests in this tutorial:

  1. Save the provided sample data and upload to Test Harness.
  2. Under Receiver Tests , select Passive Mode > Settings and disable AUTO SETTLE LOCKED PAYMENTS .
Define your Test case ID

To run tests in active mode, the Test case ID must be defined within the payment's user_info and it must be prepended by TCID-. For example, if a Test Profile defines "test_case_id": "1.01" then user_info in the payment must include {"TxId":"TCID-1.01"}.

Sample data

The sample data in this tutorial includes a payment template set (to represent your sending partner) and four test profiles (plus one combined file) that define a total of 14 test cases (1.01 through 1.14).

  • Sample Sender Test Profile (All Combined): 1.01 - 1.14
  • Sample Sender Test Profile (COMPLETED): 1.01 - 1.03
  • Sample Sender Test Profile (FAILED): 1.04 - 1.06
  • Sample Sender Test Profile (RETURNED): 1.07 - 1.10
  • Sample Sender Test Profile (Sub-states): 1.11 - 1.14

The payment template set includes payment data for ten of the 14 tests. This means that four tests use the DEFAULT record in the payment template set.

Test Harness data

To save and upload the provided sample data:

  1. Copy, paste, and save "Sample Payment Template Set" locally as ripple_sample_payment_template_set.csv
  2. Edit the payment data by replacing <RECEIVER_ADDRESS> and <SENDER_ADDRESS> with the proper sending and receiving RippleNet addresses.
  3. Copy, paste, and save the test profiles (that test different payment states):
    • Save "Sample Receiver Test Profile (All Combined)" locally as sample_test_profile_recvtest_all.json
    • Save "Sample Receiver Test Profile (COMPLETED)" locally as sample_test_profile_recvtest_completed.json
    • Save "Sample Receiver Test Profile (FAILED)" locally as sample_test_profile_recvtest_failed.json
    • Save "Sample Receiver Test Profile (RETURNED)" locally as sample_test_profile_recvtest_returned.json
    • Save "Sample Receiver Test Profile (Sub-states)" locally as sample_test_profile_recvtest_substates.json
  4. Log on to a Test Harness instance that sends payments (and runs "receiver tests").
  5. Click Test Content .
  6. On the Payment Template Sets tab, upload the sample payment template set.
  7. On the Test Profiles tab, upload all sample profiles.

Payments

Copy
Copied!
      test_case_id,sub_id,type,end_to_end_id,quote.amount,quote.receiving_address,quote.sending_address,quote.currency,quote.quote_type,quote.custom_fee,json.ChrgBr,json.Cdtr.StrdNm.FirstNm,json.Cdtr.StrdNm.LastNm,json.CdtrAcct.Id.Othr.Id,json.CdtrAgt.FinInstnId.ClrSysMmbId.MmbId,json.Dbtr.PstlAdr.AdrLine[0],json.Dbtr.PstlAdr.AdrLine[1],json.Dbtr.PstlAdr.Ctry,json.Dbtr.PstlAdr.CtrySubDvsn,json.Dbtr.PstlAdr.PstCd,json.Dbtr.PstlAdr.TwnNm,json.Dbtr.StrdNm.FirstNm,json.Dbtr.StrdNm.LastNm,json.PmtTpInf.CtgyPurp.Prtry,json.TxId
      DEFAULT,0,ORIGINAL,RANDOM_NODASH_UUID,1000,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,0.01,CRED,Michael,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.02,0,ORIGINAL,RANDOM_NODASH_UUID,112,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michael,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.03,0,ORIGINAL,RANDOM_NODASH_UUID,103,dev.xcreceiver13,dev.xcsender13,USD,receiver_amount,1,DEBT,Michael,Scott,000-12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,CASINONIGHT,TEST_CASE_ID
      1.03,1,RESUBMISSION,RANDOM_NODASH_UUID,103,dev.xcreceiver13,dev.xcsender13,USD,receiver_amount,1,DEBT,Michael,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.03,2,RESUBMISSION,RANDOM_NODASH_UUID,103,dev.xcreceiver13,dev.xcsender13,USD,receiver_amount,1,DEBT,Michael,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.04,0,ORIGINAL,RANDOM_NODASH_UUID,114,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michael,Scott,12345678,BAD666,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.06,0,ORIGINAL,RANDOM_NODASH_UUID,116,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Ed,Truck,10000009,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.07,0,ORIGINAL,RANDOM_NODASH_UUID,117,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Robert,Mifflin,10000001,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.08,0,ORIGINAL,RANDOM_NODASH_UUID,118,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Robert,Mifflin,10000001,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.09,0,ORIGINAL,RANDOM_NODASH_UUID,119,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Robert,Mifflin,10000001,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.10,0,ORIGINAL,RANDOM_NODASH_UUID,120,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Robert,Mifflin,10000001,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.13,0,ORIGINAL,RANDOM_NODASH_UUID,123,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michelle,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.13,1,AMENDMENT,RANDOM_NODASH_UUID,123,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michel,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.13,2,AMENDMENT,RANDOM_NODASH_UUID,123,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michael,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.14,0,ORIGINAL,RANDOM_NODASH_UUID,124,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michelle,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.14,1,AMENDMENT,RANDOM_NODASH_UUID,124,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michel,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID
      1.14,2,AMENDMENT,RANDOM_NODASH_UUID,124,dev.xcreceiver13,dev.xcsender13,USD,sender_amount,10,CRED,Michael,Scott,12345678,ABC123,Dunder Mifflin Paper,1725 Slough Avenue Ste 200,USA,PA,18503,Scranton,Bob,Vance,DMINFINITY,TEST_CASE_ID

All

Click to expand
Copy
Copied!
{
  "profile_name": "Sample Receiver Test Profile (14 Tests)",
  "version": "1.7",
  "customer_name": "Sample Sender",
  "profile_type": "RECEIVING",
  "cases": [
    {
      "test_case_id": "1.01",
      "test_case_description": "This test passes if the payment is COMPLETED within 35 minutes. Test Harness accepts the quote and settles the LOCKED payment regardless of the user_info.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        }
      ]
    },
    {
      "test_case_id": "1.02",
      "test_case_description": "This test passes if the payment is COMPLETED within 35 minutes. Test Harness accepts the quote, retry accepts the LOCK_DECLINED payment (if necessary), then settles the LOCKED payment.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        }
      ]
    },
    {
      "test_case_id": "1.03",
      "test_case_description": "This test passes if the payment is COMPLETED within 35 minutes. Test Harness accepts the quote, retry accepts the LOCK_DECLINED payment twice (RC04, FF06), and settles the LOCKED payment.",
      "execution_steps": [
        {
          "state": "LOCK_DECLINED",
          "action": "RETRY_ACCEPT"
        },
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RECEIVER_LOCK_DECLINED_CODES",
          "value": "RC04,FF06"
        }
      ]
    },
    {
      "test_case_id": "1.04",
      "test_case_description": "This test passes if the payment is FAILED within 35 minutes. Test Harness accepts a quote. The receiver must actively fail the ACCEPTED payment with ISO code AC08.",
      "execution_steps": [],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "FAILED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RECEIVER_FAILURE_CODES",
          "value": "AC08"
        }
      ]
    },
    {
      "test_case_id": "1.05",
      "test_case_description": "This test passes if the payment is FAILED within 35 minutes. Test Harness accepts the quote and fails the LOCKED payment with ISO code CUST.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "FAIL",
          "action_data": "CUST"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "FAILED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "SENDER_FAILURE_CODES",
          "value": "CUST"
        }
      ]
    },
    {
      "test_case_id": "1.06",
      "test_case_description": "This test passes if the payment is FAILED within 35 minutes. Test Harness accepts the quote and settles the LOCKED payment. The receiver must actively fail the EXECUTED payment with ISO code AC04.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "FAILED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RECEIVER_FAILURE_CODES",
          "value": "AC04"
        }
      ]
    },
    {
      "test_case_id": "1.07",
      "test_case_description": "This test passes if the payment is RETURNED within 35 minutes. Test Harness accepts/settles the original payment and completes the return payment. The receiver must complete the original payment and initiate a return with ISO code MD06.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "applicable_to_return_payment": true,
          "state": "ACCEPTED",
          "action": "LOCK"
        },
        {
          "applicable_to_return_payment": true,
          "state": "EXECUTED",
          "action": "COMPLETE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RETURN_PAYMENT_STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "RETURN_REASON_CODES",
          "value": "MD06"
        }
      ]
    },
    {
      "test_case_id": "1.08",
      "test_case_description": "This test passes if the payment is RETURNED within 35 minutes. Test Harness accepts/settles the original payment and completes the return payment. The receiver must initiate a return with ISO code AC03.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "applicable_to_return_payment": true,
          "state": "ACCEPTED",
          "action": "LOCK"
        },
        {
          "applicable_to_return_payment": true,
          "state": "EXECUTED",
          "action": "COMPLETE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RETURN_PAYMENT_STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "RETURN_REASON_CODES",
          "value": "AC03"
        }
      ]
    },
    {
      "test_case_id": "1.09",
      "test_case_description": "This test passes if the payment is RETURNED within 35 minutes. Test Harness accepts/settles the original payment and completes the return payment. The receiver must fail the original payment and initiate a return with ISO code RR06.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "applicable_to_return_payment": true,
          "state": "ACCEPTED",
          "action": "LOCK"
        },
        {
          "applicable_to_return_payment": true,
          "state": "EXECUTED",
          "action": "COMPLETE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RECEIVER_FAILURE_CODES",
          "value": "RR06"
        },
        {
          "criterion": "RETURN_REASON_CODES",
          "value": "RR06"
        }
      ]
    },
    {
      "test_case_id": "1.10",
      "test_case_description": "This test passes if the payment is RETURNED within 35 minutes. Test Harness accepts/settles the original payment and completes the return payment. The receiver must initiate a return with no reason code.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "applicable_to_return_payment": true,
          "state": "ACCEPTED",
          "action": "LOCK"
        },
        {
          "applicable_to_return_payment": true,
          "state": "EXECUTED",
          "action": "COMPLETE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RETURN_PAYMENT_STATE",
          "value": "COMPLETED"
        }
      ]
    },
    {
      "test_case_id": "1.11",
      "test_case_description": "This test passes if the payment is COMPLETED. Test Harness accepts/settles the LOCKED payment. The receiver adds the FORWARDED sub-state before completing the payment.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "RECEIVER_SUB_STATES",
          "value": "FORWARDED"
        }
      ]
    },
    {
      "test_case_id": "1.12",
      "test_case_description": "This test passes if the payment is RETURNED. Test Harness accepts/settles the LOCKED payment, then applies the REQUEST_RETURN sub-state. The receiver returns the payment with ISO code MD06 and the original sender completes the return payment.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "state": "EXECUTED",
          "action": "ADD_SUB_STATES",
          "props": {
            "preceding_sub_states": [
              {
                "sub_state": "REQUEST_RETURN",
                "memo": "Return requested by sender.",
                "delay_seconds": 30
              }
            ]
          }
        },
        {
          "applicable_to_return_payment": true,
          "state": "ACCEPTED",
          "action": "LOCK"
        },
        {
          "applicable_to_return_payment": true,
          "state": "EXECUTED",
          "action": "COMPLETE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "RETURN_PAYMENT_STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "SENDER_SUB_STATES",
          "value": "REQUEST_RETURN"
        },
        {
          "criterion": "RETURN_REASON_CODES",
          "value": "MD06"
        }
      ]
    },
    {
      "test_case_id": "1.13",
      "test_case_description": "This test passes if the payment is COMPLETED. Test Harness accepts/settles the LOCKED payment, then amends the user_info twice with the sub-state AMENDED. The receiver completes the payment after the second AMENDED sub-state.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "state": "EXECUTED",
          "action": "AMEND_VIA_SUB_STATE",
          "props": {
            "amendment_trigger": {
              "triggering_sub_state": "REQUEST_INFO",
              "trigger_timeout_seconds": 120
            },
            "amendment_sub_state_name": "AMENDED"
          }
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "SENDER_SUB_STATES",
          "value": "AMENDED"
        },
        {
          "criterion": "RECEIVER_SUB_STATES",
          "value": "REQUEST_INFO,AWAITING_COLLECTION"
        }
      ]
    },
    {
      "test_case_id": "1.14",
      "test_case_description": "This test passes if the payment is RETURNED. Test Harness accepts/settles the LOCKED payment, then amends the user_info twice with the sub-state AMENDED. The receiver returns the payment after the second AMENDED sub-state.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "state": "EXECUTED",
          "action": "AMEND_VIA_SUB_STATE",
          "props": {
            "amendment_trigger": {
              "triggering_sub_state": "REQUEST_INFO"
            },
            "amendment_sub_state_name": "AMENDED"
          }
        },
        {
          "state": "ACCEPTED",
          "action": "LOCK",
          "applicable_to_return_payment": true
        },
        {
          "state": "EXECUTED",
          "action": "COMPLETE",
          "applicable_to_return_payment": true
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "RETURN_PAYMENT_STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "RETURN_REASON_CODES",
          "value": "BE01,BE05"
        },
        {
          "criterion": "SENDER_SUB_STATES",
          "value": "AMENDED"
        },
        {
          "criterion": "RECEIVER_SUB_STATES",
          "value": "REQUEST_INFO,AWAITING_COLLECTION"
        }
      ]
    }
  ]
}

COMPLETE

Click to expand
Copy
Copied!
{
  "profile_name": "Sample Receiver Test Profile (COMPLETED)",
  "version": "1.7",
  "customer_name": "Sample Sender",
  "profile_type": "RECEIVING",
  "cases": [
    {
      "test_case_id": "1.01",
      "test_case_description": "This test passes if the payment is COMPLETED within 35 minutes. Test Harness accepts the quote and settles the LOCKED payment regardless of the user_info.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        }
      ]
    },
    {
      "test_case_id": "1.02",
      "test_case_description": "This test passes if the payment is COMPLETED within 35 minutes. Test Harness accepts the quote, retry accepts the LOCK_DECLINED payment (if necessary), then settles the LOCKED payment.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        }
      ]
    },
    {
      "test_case_id": "1.03",
      "test_case_description": "This test passes if the payment is COMPLETED within 35 minutes. Test Harness accepts the quote, retry accepts the LOCK_DECLINED payment twice (RC04, FF06), and settles the LOCKED payment.",
      "execution_steps": [
        {
          "state": "LOCK_DECLINED",
          "action": "RETRY_ACCEPT"
        },
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RECEIVER_LOCK_DECLINED_CODES",
          "value": "RC04,FF06"
        }
      ]
    }
  ]
}

FAIL

Click to expand
Copy
Copied!
{
  "profile_name": "Sample Receiver Test Profile (FAILED)",
  "version": "1.7",
  "customer_name": "Sample Sender",
  "profile_type": "RECEIVING",
  "cases": [
    {
      "test_case_id": "1.04",
      "test_case_description": "This test passes if the payment is FAILED within 35 minutes. Test Harness accepts a quote. The receiver must actively fail the ACCEPTED payment with ISO code AC08.",
      "execution_steps": [],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "FAILED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RECEIVER_FAILURE_CODES",
          "value": "AC08"
        }
      ]
    },
    {
      "test_case_id": "1.05",
      "test_case_description": "This test passes if the payment is FAILED within 35 minutes. Test Harness accepts the quote and fails the LOCKED payment with ISO code CUST.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "FAIL",
          "action_data": "CUST"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "FAILED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "SENDER_FAILURE_CODES",
          "value": "CUST"
        }
      ]
    },
    {
      "test_case_id": "1.06",
      "test_case_description": "This test passes if the payment is FAILED within 35 minutes. Test Harness accepts the quote and settles the LOCKED payment. The receiver must actively fail the EXECUTED payment with ISO code AC04.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "FAILED"
        },
        {
          "criterion": "MAX_DURATION_MINS",
          "value": "35"
        },
        {
          "criterion": "RECEIVER_FAILURE_CODES",
          "value": "AC04"
        }
      ]
    }
  ]
}

SUB

Click to expand
Copy
Copied!
{
  "profile_name": "Sample Receiver Test Profile (Sub-states)",
  "version": "1.7",
  "customer_name": "Sample Sender",
  "profile_type": "RECEIVING",
  "cases": [
    {
      "test_case_id": "1.11",
      "test_case_description": "This test passes if the payment is COMPLETED. Test Harness accepts/settles the LOCKED payment. The receiver adds the FORWARDED sub-state before completing the payment.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "RECEIVER_SUB_STATES",
          "value": "FORWARDED"
        }
      ]
    },
    {
      "test_case_id": "1.12",
      "test_case_description": "This test passes if the payment is RETURNED. Test Harness accepts/settles the LOCKED payment, then applies the REQUEST_RETURN sub-state. The receiver returns the payment with ISO code MD06 and the original sender completes the return payment.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "state": "EXECUTED",
          "action": "ADD_SUB_STATES",
          "props": {
            "preceding_sub_states": [
              {
                "sub_state": "REQUEST_RETURN",
                "memo": "Return requested by sender.",
                "delay_seconds": 30
              }
            ]
          }
        },
        {
          "applicable_to_return_payment": true,
          "state": "ACCEPTED",
          "action": "LOCK"
        },
        {
          "applicable_to_return_payment": true,
          "state": "EXECUTED",
          "action": "COMPLETE"
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "RETURN_PAYMENT_STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "SENDER_SUB_STATES",
          "value": "REQUEST_RETURN"
        },
        {
          "criterion": "RETURN_REASON_CODES",
          "value": "MD06"
        }
      ]
    },
    {
      "test_case_id": "1.13",
      "test_case_description": "This test passes if the payment is COMPLETED. Test Harness accepts/settles the LOCKED payment, then amends the user_info twice with the sub-state AMENDED. The receiver completes the payment after the second AMENDED sub-state.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "state": "EXECUTED",
          "action": "AMEND_VIA_SUB_STATE",
          "props": {
            "amendment_trigger": {
              "triggering_sub_state": "REQUEST_INFO",
              "trigger_timeout_seconds": 120
            },
            "amendment_sub_state_name": "AMENDED"
          }
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "SENDER_SUB_STATES",
          "value": "AMENDED"
        },
        {
          "criterion": "RECEIVER_SUB_STATES",
          "value": "REQUEST_INFO,AWAITING_COLLECTION"
        }
      ]
    },
    {
      "test_case_id": "1.14",
      "test_case_description": "This test passes if the payment is RETURNED. Test Harness accepts/settles the LOCKED payment, then amends the user_info twice with the sub-state AMENDED. The receiver returns the payment after the second AMENDED sub-state.",
      "execution_steps": [
        {
          "state": "LOCKED",
          "action": "SETTLE"
        },
        {
          "state": "EXECUTED",
          "action": "AMEND_VIA_SUB_STATE",
          "props": {
            "amendment_trigger": {
              "triggering_sub_state": "REQUEST_INFO"
            },
            "amendment_sub_state_name": "AMENDED"
          }
        },
        {
          "state": "ACCEPTED",
          "action": "LOCK",
          "applicable_to_return_payment": true
        },
        {
          "state": "EXECUTED",
          "action": "COMPLETE",
          "applicable_to_return_payment": true
        }
      ],
      "expected_results": [
        {
          "criterion": "STATE",
          "value": "RETURNED"
        },
        {
          "criterion": "RETURN_PAYMENT_STATE",
          "value": "COMPLETED"
        },
        {
          "criterion": "RETURN_REASON_CODES",
          "value": "BE01,BE05"
        },
        {
          "criterion": "SENDER_SUB_STATES",
          "value": "AMENDED"
        },
        {
          "criterion": "RECEIVER_SUB_STATES",
          "value": "REQUEST_INFO,AWAITING_COLLECTION"
        }
      ]
    }
  ]
}

Postman collection

To save and import API requests into Postman:

  1. Copy, paste, and save the Postman collection as RippleNet Test Harness (Receiver Tests).postman_collection
  2. Import the Postman collection into Postman.

Postman Collection

Click to expand
Copy
Copied!
{
  "info": {
    "_postman_id": "c7332f83-58cc-458b-aaeb-66c29170be59",
    "name": "RippleNet Test Harness (Receiver Tests)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "(RECEIVER) Get Auth Token",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "postman.clearEnvironmentVariable(\"RECEIVER_AUTH\")",
              "tests[\"Status code is 200\"] = responseCode.code === 200;",
              "var data = JSON.parse(responseBody);",
              "tests[\"Obtained Access Token\"] = data.access_token !== null;",
              "postman.setEnvironmentVariable(\"RECEIVER_AUTH\", data.access_token);",
              "",
              "pm.globals.set(\"RECEIVER_AUTH\", data.access_token);"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "username",
              "value": "super_user_client",
              "type": "string"
            },
            {
              "key": "password",
              "value": "secret",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "client_credentials",
              "type": "text"
            }
          ],
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/oauth/token",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "oauth",
            "token"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.04 - Fail Payment - AC08",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "var data = JSON.parse(responseBody);",
              "tests[\"Obtained Payment Object\"] = data.payment_id !== null;",
              "tests[\"Payment State is COMPLETED\"] = data.payment_state === \"FAILED\";"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reasons\": [\n    {\n      \"type\": \"RECEIVER_DATA_VALIDATION\",\n      \"code\": \"AC08\",\n      \"reason\": \"Branch code is invalid or missing.\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/92c44de6-e330-4e3e-be73-0e1c47d294f0/fail",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "92c44de6-e330-4e3e-be73-0e1c47d294f0",
            "fail"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.03 - Reject Payment - RC04",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reasons\": [\n    {\n      \"type\": \"RECEIVER_LOCK_FAILURE\",\n      \"code\": \"RC04\",\n      \"reason\": \"Creditor bank identifier is invalid or missing.\"\n    }\n  ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/10661513-d96b-40ca-b2a6-9d734da0cb41/reject",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "10661513-d96b-40ca-b2a6-9d734da0cb41",
            "reject"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.03 - Reject Payment - RC04, FF06",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reasons\": [\n    {\n      \"type\": \"RECEIVER_LOCK_FAILURE\",\n      \"code\": \"RC04\",\n      \"reason\": \"Creditor bank identifier is invalid or missing.\"\n    },\n    {\n      \"type\": \"RECEIVER_LOCK_FAILURE\",\n      \"code\": \"FF06\",\n      \"reason\": \"Category Purpose code is missing or invalid.\"\n    }\n  ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/62b8dc8f-b4b9-40bd-9500-a93db0a07bb6/reject",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "62b8dc8f-b4b9-40bd-9500-a93db0a07bb6",
            "reject"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.06 - Fail Payment - AC04",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "var data = JSON.parse(responseBody);",
              "tests[\"Obtained Payment Object\"] = data.payment_id !== null;",
              "tests[\"Payment State is COMPLETED\"] = data.payment_state === \"FAILED\";"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reasons\": [\n    {\n      \"type\": \"RECEIVER_DATA_VALIDATION\",\n      \"code\": \"AC04\",\n      \"reason\": \"Branch code is invalid or missing.\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/8305abad-6e2b-4193-b2e0-c995fda62874/fail",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "8305abad-6e2b-4193-b2e0-c995fda62874",
            "fail"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.08 - Return Payment - AC03",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"original_payment_id\": \"cd5aadfe-f4db-4928-8a68-d3b581485e53\",\n  \"return_reasons\": [\n    {\n      \"type\": \"RECEIVER_PROCESSING_ERROR\",\n      \"code\": \"AC03\",\n      \"reason\": \"Creditor account number invalid or missing.\"\n    }\n  ],\n  \"return_amount_type\": \"TOTAL_RECEIVED\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/quote_collections/return",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "quote_collections",
            "return"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.08 - Accept Quote",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"quote_id\": \"87952792-4a4b-4acb-ae36-d3aa4bd45dd1\",\n  \"user_info\": {\n    \"TxId\": \"TCID-1.08\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/accept",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "accept"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.09 - Fail Payment - RR06",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "var data = JSON.parse(responseBody);",
              "tests[\"Obtained Payment Object\"] = data.payment_id !== null;",
              "tests[\"Payment State is COMPLETED\"] = data.payment_state === \"FAILED\";"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reasons\": [\n    {\n      \"type\": \"RECEIVER_PROCESSING_ERROR\",\n      \"code\": \"RR06\",\n      \"reason\": \"Tax information missing, incomplete or invalid.; Failure reason was prescribed by test profile.\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/91b780b8-7182-45db-b3ac-89712e8c4a20/fail",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "91b780b8-7182-45db-b3ac-89712e8c4a20",
            "fail"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.09 - Return Payment - RR06",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"original_payment_id\": \"91b780b8-7182-45db-b3ac-89712e8c4a20\",\n  \"return_reasons\": [\n    {\n      \"type\": \"RECEIVER_PROCESSING_ERROR\",\n      \"code\": \"RR06\",\n      \"reason\": \"Tax information missing, incomplete or invalid.; Failure reason was prescribed by test profile.\"\n    }\n  ],\n  \"return_amount_type\": \"TOTAL_RECEIVED\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/quote_collections/return",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "quote_collections",
            "return"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.09 - Accept Quote",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"quote_id\": \"560f9739-c02a-42cc-b973-f7f59f7fd627\",\n  \"user_info\": {\n    \"TxId\": \"TCID-1.09\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/accept",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "accept"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.10 - Return Payment - no reason",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"original_payment_id\": \"764de16e-e7c2-4439-9b6e-70772dcaa93f\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/quote_collections/return",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "quote_collections",
            "return"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.10 - Accept Quote",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"quote_id\": \"c48427c6-4edf-484e-91af-b013823eb2a9\",\n  \"user_info\": {\n    \"TxId\": \"TCID-1.10\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/accept",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "accept"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.11 - Add Sub-state - FORWARDED",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n   \"sub_state\": \"FORWARDED\",\n   \"memo\": \"memo for forwarded.\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/3fab453b-e3c9-4e31-9f48-73ab26efac8f/sub_state",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "3fab453b-e3c9-4e31-9f48-73ab26efac8f",
            "sub_state"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.12 - Return Payment - MD06",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"original_payment_id\": \"2518f9ed-5c28-4fb1-b9db-fbfe68342cdd\",\n  \"return_reasons\": [\n    {\n      \"type\": \"SENDER_RETURN\",\n      \"code\": \"MD06\",\n      \"reason\": \"Return of funds requested by end customer.\"\n    }\n  ],\n  \"return_amount_type\": \"TOTAL_RECEIVED\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/quote_collections/return",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "quote_collections",
            "return"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.12 - Accept Quote",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"quote_id\": \"8882a03a-ccb3-4606-a9e3-c7b0a9147aaf\",\n  \"user_info\": {\n    \"TxId\": \"TCID-1.12\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/accept",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "accept"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.13, 1.14 - Add Sub-state - AWAITING_COLLECTION",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n   \"sub_state\": \"AWAITING_COLLECTION\",\n   \"memo\": \"Payment is available for cash pick-up.\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/911991d0-7dc1-4f00-9983-d7cdd1f74ce1/sub_state",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "911991d0-7dc1-4f00-9983-d7cdd1f74ce1",
            "sub_state"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.13, 1.14 - Add Sub-state - REQUEST_INFO 1",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n   \"sub_state\": \"REQUEST_INFO\",\n   \"memo\": \"Request confirmation of beneficiary first name, Michelle.\",\n   \"info\": \"BE01\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/911991d0-7dc1-4f00-9983-d7cdd1f74ce1/sub_state",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "911991d0-7dc1-4f00-9983-d7cdd1f74ce1",
            "sub_state"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.13, 1.14 - Add Sub-state - REQUEST_INFO 2",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n   \"sub_state\": \"REQUEST_INFO\",\n   \"memo\": \"Request confirmation of beneficiary first name, Michel.\",\n   \"info\": \"CH11\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/911991d0-7dc1-4f00-9983-d7cdd1f74ce1/sub_state",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "911991d0-7dc1-4f00-9983-d7cdd1f74ce1",
            "sub_state"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.14 - Return Payment - BE01, BE05",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"original_payment_id\": \"911991d0-7dc1-4f00-9983-d7cdd1f74ce1\",\n  \"return_reasons\": [\n    {\n        \"type\": \"RECEIVER_PROCESSING_ERROR\",\n        \"code\": \"BE01\",\n        \"reason\": \"Identification of end customer is not consistent with associated account number.\"\n    },\n    {\n        \"type\": \"RECEIVER_PROCESSING_ERROR\",\n        \"code\": \"BE05\",\n        \"reason\": \"Party who initiated the message is not recognized by the end customer.\"\n    }\n  ],\n  \"return_amount_type\": \"TOTAL_RECEIVED\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/quote_collections/return",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "quote_collections",
            "return"
          ]
        }
      },
      "response": []
    },
    {
      "name": "(RECEIVER) 1.14 - Accept Quote",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{RECEIVER_AUTH}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"quote_id\": \"6b92c17d-aaef-443b-bccb-a79a50f047b9\",\n  \"user_info\": {\n    \"TxId\": \"TCID-1.14\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{RECEIVER_BASE}}/v4/payments/accept",
          "host": [
            "{{RECEIVER_BASE}}"
          ],
          "path": [
            "v4",
            "payments",
            "accept"
          ]
        }
      },
      "response": []
    }
  ]
}

Open and close test

In each section below (Completed, Failed, Returned, Sub-states), start testing by creating a new "open" active mode test, and when done running the test cases, close the test to view the results. (You can also open one test and use the combined Test Profile but you may need to increase the time allotted to complete the tests.)

  1. Log on to the Test Harness that sends payments (to run your Receiver Tests).
  2. Click Receiver Tests > Active Mode .
  3. Click New Test to open a popup and select From Profile .
  4. Select the Test Profile "Ripple Sample Receiver Test Profile".
  5. Select the Payment Template Set , "Ripple Sample Payment Template Set".
  6. Click Create Test . All payments should move to the ACCEPTED state.
  7. In the RippleNet Server UI (in front of your actual RippleNet Server), click Refresh to view all the payments as Accepted .
  8. In each section, run all test cases, and when done, click Close Test to view the results.
Newly Opened Test with Combined Test Profile

All Payments Accepted

Expected results

For the receiver tests included in this tutorial to pass, they must all pass and reach the following states with the defined failure codes within the defined amount of time.

Copy
Copied!
| TCID | Final State | Sub-state(s)                                | ISO Codes      |
|:-----|:------------|:--------------------------------------------|:---------------|
| 1.01 | COMPLETED   |                                             |                |
| 1.02 | COMPLETED   |                                             |                |
| 1.03 | COMPLETED   |                                             | RC04,FF06      |
| 1.04 | FAILED      |                                             | AC08           |
| 1.05 | FAILED      |                                             | CUST           |
| 1.06 | FAILED      |                                             | AC04           |
| 1.07 | RETURNED    |                                             | MD06           |
| 1.08 | RETURNED    |                                             | AC03           |
| 1.09 | RETURNED    |                                             | RR06           |
| 1.10 | RETURNED    |                                             |                |
| 1.11 | COMPLETED   | FORWARDED                                   |                |
| 1.12 | RETURNED    | REQUEST_RETURN                              | MD06           |
| 1.13 | COMPLETED   | AWAITING_COLLECTION, REQUEST_INFO / AMENDED | BE01,CH11      |
| 1.14 | RETURNED    | AWAITING_COLLECTION, REQUEST_INFO / AMENDED | BE01,CH11,BE05 |
Expected Results Before Closing Combined Test (Varying States)

Expected Results for Combined Receiver Tests

Expected Results After Closing Combined Test (14 Passed Tests)

Combined Receiver Tests Passed

Completed payments

The following tests pass when the "REGULAR" payment is in the COMPLETED state and also meets the conditions defined in the test profile.

  • Test case 1.01 : Happy path payment with no lock rejects, failures, or returns.
  • Test case 1.02 : Receiver validates against RPO (added to user_info).
  • Test case 1.03 : Receiver rejects payment and sender retry accepts twice.

Test case 1.01

This test uses the DEFAULT data in the Ripple Sample Payment Template Set.

Test Case 1.01 passes if the payment is COMPLETED within 35 minutes. Test Harness accepts a quote and settles the payment regardless of the user_info. The receiver must lock and complete the payment.

  1. In the RippleNet Server UI, find the payment for Test case 1.01 (by payment ID) and click Take Action .
  2. View the additional information (which comes from the Payment Template Set) and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
  5. Click Complete > Complete payment . The payment moves to the COMPLETED state.

Test case 1.02

This test uses the DEFAULT data in the Ripple Sample Payment Template Set.

Test case 1.02 passes if the payment is COMPLETED within 35 minutes. Test Harness accepts a quote and settles the payment if the user_info can be validated. The receiver must lock and complete the payment.

Test Case 1.02 is the same as 1.01. This test exists for aligned testing only (because it differs when running sender tests). Run it simply to pass this section of the testing.

  1. In the RippleNet Server UI, find the payment for test case 1.01 (by payment ID) and click Take Action .
  2. View the additional information (which comes from the Payment Template Set) and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
  5. Click Complete and then Complete payment . The payment moves to the COMPLETED state.

Test case 1.03

Test case 1.03 passes if the payment is COMPLETED within 35 minutes. Test Harness accepts the quote. The receiver must reject the ACCEPTED payment twice, with ISO codes RC04 and FF06 respectively, and the Test Harness retry accepts in turn. The receiver must lock the third time.

  1. In the Test Harness, copy the Payment ID for test case 1.03.
  2. (In Postman) Reject the payment with ISO code RC04 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/reject
        {
          "reasons": [
            {
              "type": "RECEIVER_LOCK_FAILURE",
              "code": "RC04",
              "reason": "Creditor bank identifier is invalid or missing."
            }
          ]
        }

    {{RECEIVER_BASE}} is a variable for the Test Harness URL: https://hostname:port.

    Postman Example Inbound

  3. In the Test Harness, watch the payment move through states: LOCK_DECLINEDACCEPTED .
  4. (In Postman) Reject the payment with both ISO codes RC04 and FF06 using the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/reject
    
        {
          "reasons": [
            {
              "type": "RECEIVER_LOCK_FAILURE",
              "code": "RC04",
              "reason": "Creditor bank identifier is invalid or missing."
            },
            {
              "type": "RECEIVER_LOCK_FAILURE",
              "code": "FF06",
              "reason": "Category Purpose code is missing or invalid."
            }
          ]
        }
  5. In the Test Harness, watch the payment move through states: LOCK_DECLINEDACCEPTED .
  6. In the RippleNet Server UI, find the payment for test case 1.03 and click Take Action .
  7. View the additional information (especially under "lock_declined") and click Lock Quote .

    Result:

    Copy
    Copied!
        "lock_declined": [
          {
            "json": [
              {
                "type": "RECEIVER_LOCK_FAILURE",
                "code": "RC04",
                "reason": "Creditor bank identifier is invalid or missing."
              },
              {
                "type": "RECEIVER_LOCK_FAILURE",
                "code": "FF06",
                "reason": "Category Purpose code is missing or invalid."
              }
            ],
            "created_at": "2021-01-15T18:19:35.677Z",
            "subState": ""
          }
        ]
  8. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  9. In the RippleNet Server UI, click Refresh to view the payment as EXECUTED .
  10. Click Complete and then Complete payment . The payment moves to the COMPLETED state.
  11. Click the payment ID to view the payment contract details.

Test Harness only recognizes the last failure. So to record two rejects you must include both codes in the last API call.

Failed payments

Test case 1.04

Test case 1.04 passes if the payment is FAILED within 35 minutes. Test Harness accepts the quote. The receiver must actively fail the ACCEPTED payment with ISO code AC08.

  1. In the Test Harness, copy the payment ID for test case 1.04.
  2. (In Postman) Fail the payment with ISO code AC08 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/fail
        {
          "reasons": [
            {
              "type": "RECEIVER_DATA_VALIDATION",
              "code": "AC08",
              "reason": "Branch code is invalid or missing."
            }
          ]
        }
  3. In the Test Harness, watch the payment move to the FAILED state.
  4. Click the Payment ID to view the payment contract details.

Test case 1.05

This test uses the DEFAULT data in the Ripple Sample Payment Template Set.

Test case 1.05 passes if the payment is FAILED within 35 minutes. Test Harness accepts the quote. The receiver must lock the and then Test Harness fails the LOCKED payment with ISO code CUST.

  1. In the RippleNet Server UI, find the payment for test case 1.05 and click Take Action .
  2. View the additional information (which comes from the Payment Template Set) and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDFAILED .
  4. Click the payment ID to view the payment contract details.

Test Case 1.06

Test case 1.06 passes if the payment is FAILED within 35 minutes. Test Harness accepts the quote, the receiver must lock, and Test Harness settles the payment. The receiver then must actively fail the EXECUTED payment with ISO code AC04.

  1. In the RippleNet Server UI, find the payment for Test case 1.06 and click Take Action .
  2. View the additional information (which comes from the Payment Template Set) and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the Test Harness, copy the payment ID for test case 1.06.
  5. (In Postman) Fail the payment with ISO code AC04 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/fail
        {
          "reasons": [
            {
              "type": "RECEIVER_DATA_VALIDATION",
              "code": "AC04",
              "reason": "Branch code is invalid or missing."
            }
          ]
        }
  6. In the Test Harness, watch the payment move to the FAILED state.
  7. Click the Payment ID to view the payment contract details.

Returned payments

The following tests pass when the "RETURN" payment is in the COMPLETED state, the "REGULAR" (original) payment is in the RETURNED state, and both meet the conditions defined in the test profile.

The sender must complete the receiver's RETURN payment. When the RETURN payment is COMPLETED, the sender's (original) REGULAR payment is RETURNED.

  • Test Case 1.07 : Receiver locks/completes REGULAR payment and initiates RETURN payment with code MD06 (RefundRequestByEndCustomer).
  • Test Case 1.08 : Receiver locks REGULAR payment and initiates RETURN payment with code AC03 (InvalidCreditorAccountNumber).
  • Test Case 1.09 : Receiver locks/fails REGULAR payment and initiates RETURN payment with code RR06 (TaxInformationInvalid).
  • Test Case 1.10 : Receiver locks/completes REGULAR payment and initiates RETURN payment with no ISO code.

Test case 1.07

Test case 1.07 passes if the REGULAR payment is RETURNED within 35 minutes. Test Harness accepts the quote. The receiver must lock and complete the REGULAR payment, then initiate a RETURN of the COMPLETED payment with ISO code MD06. Test Harness completes the RETURN payment.

Regular payment
  1. In the RippleNet Server UI, find the payment for test case 1.07 and click Take Action .
  2. View the additional information and click Lock Quote .
  3. In the test harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
  5. Click Complete > Complete payment .
  6. In the Test Harness, watch the (original) REGULAR, payment move to the COMPLETED state.
Return payment
  1. In the RippleNet Server UI, click Refresh to view the payment as COMPLETED .
  2. Click Return , enter the reasons, and click Continue with Return :
    Copy
    Copied!
        RECEIVER_PROCESSING_ERROR
        MD06
        Return of funds requested by end customer.
  3. Click Get Quote , select the quote, click through and add the following user_info and Save : {"TxId":"TCID-1.07"}
  4. Click Refresh to view the RETURN payment as Locked .
  5. Click Settle and then Settle payment .
  6. In the Test Harness, watch the RETURN payment move to EXECUTEDCOMPLETED and the REGULAR payment move to the RETURNED state.
  7. Click the payment ID (of the COMPLETED RETURN payment) to view the payment contract details.

Test case 1.08

Test case 1.08 passes if the REGULAR payment is RETURNED within 35 minutes. Test Harness accepts the quote. The receiver must lock the REGULAR payment (completing is optional), then initiate a RETURN of the EXECUTED (or COMPLETED) REGULAR payment with ISO code AC03. Test Harness completes the RETURN payment.

Regular payment
  1. In the RippleNet Server UI, find the payment for test case 1.08 and click Take Action .
  2. View the additional information and click Lock Quote .
  3. Click Refresh to watch the payment change states: LOCKEDEXECUTED .
Return payment
  1. In the Test Harness, copy the payment ID for test case 1.08.
  2. (In Postman) Return the payment with ISO code AC03 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/quote_collections/return
        {
          "original_payment_id": "{PAYMENT_ID}",
          "return_reasons": [
            {
              "type": "RECEIVER_PROCESSING_ERROR",
              "code": "AC03",
              "reason": "Creditor account number invalid or missing."
            }
          ],
          "return_amount_type": "TOTAL_RECEIVED"
        }
  3. (In Postman) Accept the returned quote and include the Test Case ID, "TxId": "TCID-1.08" :
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/accept
        {
          "quote_id": "{QUOTE_ID}",
          "user_info": {
            "TxId": "TCID-1.08"
          }
        }
  4. In the RippleNet Server UI click Refresh to update the RETURN payment as Locked .
  5. Click Settle , view the additional information, and click Settle payment .
  6. In the Test Harness, watch the RETURN payment move to EXECUTEDCOMPLETED and the REGULAR payment moves to EXECUTEDRETURNED .
  7. Click the payment ID (of the COMPLETED return payment) to view the payment contract details.

Test case 1.09

Test case 1.09 passes if the REGULAR payment is RETURNED within 35 minutes. Test Harness accepts the quote. The receiver must lock and fail the REGULAR payment with ISO code RR06, then initiate a RETURN payment of the FAILED payment with ISO code RR06. Test Harness completes the RETURN payment.

Regular payment
  1. In the RippleNet Server UI, find the payment for test case 1.09 and click Take Action .
  2. View the Additional Information and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
  5. In the Test Harness, copy the payment ID for test case 1.09.
  6. (In Postman) Fail the payment with ISO code RR06 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/fail
        {
          "reasons": [
            {
              "type": "RECEIVER_PROCESSING_ERROR",
              "code": "RR06",
              "reason": "Tax information missing, incomplete or invalid.; Failure reason was prescribed by test profile."
            }
          ]
        }
Return payment
  1. (In Postman) Return the payment with ISO code RR06 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/quote_collections/return
        {
          "original_payment_id": "{PAYMENT_ID}",
          "return_reasons": [
            {
              "type": "RECEIVER_PROCESSING_ERROR",
              "code": "RR06",
              "reason": "Tax information missing, incomplete or invalid.; Failure reason was prescribed by test profile."
            }
          ],
          "return_amount_type": "TOTAL_RECEIVED"
        }
  2. (In Postman) Accept the returned quote and include the Test Case ID, "TxId": "TCID-1.09" :
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/accept
        {
          "quote_id": "{QUOTE_ID}",
          "user_info": {
            "TxId": "TCID-1.09"
          }
        }
  3. In the RippleNet Server UI click Refresh to update the RETURN payment as Locked .
  4. Click Settle , view the additional information, and click Settle payment .
  5. In the Test Harness, watch the RETURN payment move to EXECUTEDCOMPLETED and the REGULAR payment moves to FAILEDRETURNED .
  6. Click the payment ID (of the COMPLETED return payment) to view the payment contract details.

Test case 1.10

Test case 1.10 passes if the REGULAR payment is RETURNED within 35 minutes. Test Harness accepts the quote. The receiver must lock and complete the REGULAR payment, then initiate a RETURN of the COMPLETED REGULAR payment with no reasons. Test Harness completes the RETURN payment.

Regular payment
  1. In the RippleNet Server UI, find the payment for test case 1.10 and click Take Action .
  2. View the additional information and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
  5. Click Complete and then Complete payment .
  6. In the Test Harness, watch the (original) REGULAR, payment move to the COMPLETED state.
Return payment
  1. In the Test Harness, copy the payment ID for test case 1.10.
  2. (In Postman) Return the payment with no reasons and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/quote_collections/return
        {
          "original_payment_id": "{PAYMENT_ID}"
        }
  3. (In Postman) Accept the returned quote and include the Test Case ID, "TxId": "TCID-1.10" :
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/accept
        {
          "quote_id": "{QUOTE_ID}",
          "user_info": {
            "TxId": "TCID-1.10"
          }
        }
  4. In the RippleNet Server UI click Refresh to update the RETURN payment as Locked .
  5. Click Settle , view the additional information, and click Settle payment .
  6. In the Test Harness, watch the RETURN payment move to EXECUTEDCOMPLETED and the REGULAR payment moves to COMPLETEDRETURNED .
  7. Click the payment ID (of the COMPLETED return payment) to view the payment contract details.

Sub-state payments

The following tests pass when the payment is either COMPLETED or RETURNED with the defined sub-states and ISO codes.

  • Test Case 1.11 : Receiver adds sub-state FORWARDED to EXECUTED payment before completing.
  • Test Case 1.12 : Sender adds sub-state REQUEST_RETURN to EXECUTED payment, triggering the receiver to initiate a RETURN ( MD06 ).
  • Test Case 1.13 : Receiver applies sub-state AWAITING_COLLECTION and then REQUEST_INFO sub-state twice ( BE01 , CH11 ); sender amends user_info in turn with sub-state AMENDED and receiver completes payment.
  • Test Case 1.14 : Receiver applies sub-state AWAITING_COLLECTION and then REQUEST_INFO sub-state twice ( BE01 , CH11 ); sender amends user_info in turn with sub-state AMENDED and receiver initiates RETURN payment ( BE01 , BE05 ).

Test case 1.11

This test uses the DEFAULT data in the Ripple Sample Payment Template Set.

Test case 1.11 passes if the payment is COMPLETED. Test Harness accepts the quote. The receiver must lock the ACCEPTED payment, then add the FORWARDED sub-state to the EXECUTED payment before completing.

  1. In the RippleNet Server UI, find the payment for test case 1.11 (by payment ID) and click Take Action .
  2. View the additional information (which comes from the Payment Template Set) and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
  5. Click Complete and select Forward , add a memo (for example, "forwarding memo") and click Forward Payment .
  6. In Test Harness, click the payment ID to view the payment contract details and see the FORWARDED sub-state.

    Result:

    Copy
    Copied!
        "executed": [
          {
            "created_at": "2021-01-15T19:30:59.608Z",
            "json": {
              "FORWARDED": "forwarding memo"
            },
            "subState": "FORWARDED"
          }
        ]
  7. Click Complete > Complete payment . The payment moves to the COMPLETED state.

Test case 1.12

This test uses the DEFAULT data in the Ripple Sample Payment Template Set.

Test case 1.12 passes if the REGULAR payment is RETURNED. Test Harness accepts the quote. The receiver must lock the REGULAR payment. The Test Harness settles and applies the REQUEST_RETURN sub-state to the EXECUTED payment. The receiver must initiate a RETURN payment with ISO code MD06. When running Sender Tests, the REQUEST_RETURN sub-state triggers the receiving Test Harness to initiate a return.

Regular payment
  1. In the RippleNet Server UI, find the payment for test case 1.12 (by payment ID) and click Take Action .
  2. View the additional information (which comes from the Payment Template Set) and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
Return payment
  1. In the Test Harness, view the REQUEST_RETURN applied by the sender (after a 30 second delay):

    Result:

    Copy
    Copied!
        "executed": [
          {
            "created_at": "2021-01-19T21:06:26.608Z",
            "json": {
              "REQUEST_RETURN": "Return requested by sender."
            },
            "subState": "REQUEST_RETURN"
          }
        ]
  2. In the Test Harness, copy the payment ID for test case 1.12.
  3. (In Postman) Return the payment with ISO code MD06 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/quote_collections/return
        {
          "original_payment_id": "{PAYMENT_ID}",
          "return_reasons": [
            {
              "type": "SENDER_RETURN",
              "code": "MD06",
              "reason": "Return of funds requested by end customer."
            }
          ],
          "return_amount_type": "TOTAL_RECEIVED"
        }
  4. (In Postman) Accept the returned quote and include the Test Case ID, "TxId": "TCID-1.12" :
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/accept
        {
          "quote_id": "{QUOTE_ID}",
          "user_info": {
            "TxId": "TCID-1.12"
          }
        }
  5. In the RippleNet Server UI click Refresh to update the RETURN payment as Locked .
  6. Click Settle , view the additional information, and click Settle payment .
  7. In the Test Harness, watch the RETURN payment move to EXECUTEDCOMPLETED and the REGULAR payment moves to FAILEDRETURNED .
  8. Click the payment ID (of the COMPLETED return payment) to view the payment contract details.

Test case 1.13

Test case 1.13 passes if the payment is COMPLETED. Test Harness accepts the quote. The receiver must lock the ACCEPTED payment, then add the AWAITING_COLLECTION sub-state (for the cash payout) and request an amendment twice with sub-state REQUEST_INFO. Test Harness responds in turn by amending the payment with the AMENDED sub-state. When satisfied with the changes, the receiver completes the payment.

  1. In the RippleNet Server UI, find the payment for test case 1.13 (by payment ID) and click Take Action .
  2. View the additional information (which comes from the Payment Template Set) and click Lock Quote .
  3. In the Test Harness, watch the payment move to LOCKEDPREPAREDEXECUTED .
  4. In the RippleNet Server UI, click Refresh to view the payment as Executed .
  5. (In Postman) Apply sub-state AWAITING_COLLECTION with the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/sub_state
        {
           "sub_state": "AWAITING_COLLECTION",
           "memo": "Payment is available for cash pick-up."
        }
  6. In the Test Harness, click the Payment ID to view the application of the sub-state.
  7. (In Postman) Apply sub-state REQUEST_INFO with the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/sub_state
        {
           "sub_state": "REQUEST_INFO",
           "memo": "Request confirmation of beneficiary first name, Michelle."
           "info": "BE01"
        }
  8. In the Test Harness, view the application of the sub-state and the sender's AMENDED response.

    Result:

    Copy
    Copied!
            "executed": [
              {
                "created_at": "2021-01-19T22:50:21.501Z",
                "json": {
                  "AMENDED": "Amendment cycle 1.",
                  "info": {
                    "ChrgBr": "CRED",
                    "Cdtr": {
                      "StrdNm": {
                        "FirstNm": "Michel",
                        "LastNm": "Scott"
                      }
                    },
                    ...
                },
                "subState": "AMENDED"
              }
            ]
  9. (In Postman) Again, apply sub-state REQUEST_INFO with the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/{PAYMENT_ID}/sub_state
        {
           "sub_state": "REQUEST_INFO",
           "memo": "Request confirmation of beneficiary first name, Michel."
           "info": "CH11"
        }
  10. In the Test Harness, view the application of the sub-state and the sender's second AMENDED response.

    Result:

    Copy
    Copied!
        "executed": [
          ...
          {
            "created_at": "2021-01-19T22:53:19.228Z",
            "json": {
              "AMENDED": "Amendment cycle 2.",
              "info": {
                "ChrgBr": "CRED",
                "Cdtr": {
                  "StrdNm": {
                    "FirstNm": "Michael",
                    "LastNm": "Scott"
                  }
                },
                ...
            },
            "subState": "AMENDED"
          }
        ]
  11. In the RippleNet Server UI, click Complete then Complete payment . The payment moves to the COMPLETED state.

Test Case 1.14

Test Case 1.14 passes if the REGULAR payment is RETURNED. Test Harness accepts the quote. The receiver must lock the ACCEPTED REGULAR payment, then add the AWAITING_COLLECTION sub-state (for the cash payout) and request an amendment twice with sub-state REQUEST_INFO. Test Harness responds in turn by amending the payment with the AMENDED sub-state. After the second change, the receiver initiates a RETURN payment.

Test case 1.14 is the same as 1.13 except that instead of completing the payment, the receiver returns it.

Regular payment

Repeat test case 1.13 through the second REQUEST_INFO request (but do not complete the payment).

Return payment
  1. (In Postman) Return the payment with reasons BE01 and BE05 and the following endpoint and request body:
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/quote_collections/return
        {
          "original_payment_id": "{PAYMENT_ID}",
          "return_reasons": [
            {
              "type": "RECEIVER_PROCESSING_ERROR",
              "code": "BE01",
              "reason": "Identification of end customer is not consistent with associated account number."
            },
            {
              "type": "RECEIVER_PROCESSING_ERROR",
              "code": "BE05",
              "reason": "Party who initiated the message is not recognized by the end customer."
            }
          ],
          "return_amount_type": "TOTAL_RECEIVED"
        }
  2. (In Postman) Accept the returned quote and include the Test Case ID, "TxId": "TCID-1.14" :
    Copy
    Copied!
        ## {{RECEIVER_BASE}}/v4/payments/accept
        {
          "quote_id": "{QUOTE_ID}",
          "user_info": {
            "TxId": "TCID-1.14"
          }
        }
  3. In the RippleNet Server UI click Refresh to update the RETURN payment as Locked .
  4. Click Settle , view the additional Information, and click Settle payment .
  5. In the Test Harness, watch the RETURN payment move to EXECUTEDCOMPLETED and the REGULAR payment moves to COMPLETEDRETURNED .
  6. Click the payment ID (of the COMPLETED return payment) to view the payment contract details.