Testing Use Cases

normal case
{
  "order" : {
    "number" : "wonder side unique id",
    "reference_number" : "your side unique id",
     ...
     "state" : "invoiced",
     "correspondence_state" : "unpaid",
     "line_items" : [
        {
          "uuid" : "wonder generated unique id",
          "purchasable_type” : "Charge",
          "price" : "your submitted charge_fee",
          "quantity" : 1,
          "total" : "price * quantity",
                },
          ...
      ]
  }
}

empty request body or have not order object
{"error_code" : "ET200002"}

charge_fee <= 0.0 or tips <= 0.0
{"error_code" : "ET200002"}

note length > 255
{"error_code" : "ET200002"}

format is not YYYY-MM-DD
{"error_code" : "ET200002"}

not a stardand URL format
{"error_code" : "ET200002"}

not a stardand URL format
{"error_code" : "ET200002"}

Refernece number already created another order
{"error_code" : "ET100309"}

Query order before payment
{
  "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "unpaid",
  }
}

Query order after payment success
{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "paid",
     "transactions: " [
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        ....
       "payment_data" : {
         "acquirer_type" : "follow acquier_type enum table",
         ...
         }
       }
     ]
}
}

Query order after payment failed
{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "unpaid",
     "transactions: " [
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : false,
        ....
       }
     ]
}
}

Query order after Pre-authorization success
{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "unpaid",
     "transactions: " [
       {
        "type" : "Authorization",
        "uuid": "transaction uuid",
        "success" : true,
        ....
       }
     ]
}
}

Query order after captured.
{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "paid",
     "transactions: " [
        {
          "type" : "Capture",
          "uuid" : "capture transaction uuid",
          success: true,
          ...
        },
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        ....
       }
     ]
}
}

Query order after transaction voided.
{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "unpaid",
     "transactions: " [
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        "voided" : true,
        ....
       }
     ]
}
}

Query order after transaction refunded.
{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "refunded",
     "transactions: " [
        {
          "type" : "Refund",
          "uuid" : "capture transaction uuid",
          success: true,
          ...
        },
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        ....
       }
     ]
}
}

Query order with not exists order number
{"error_code" : "ET100301"}

Query order with not exists reference number
{"error_code" : "ET100301"}

Query order with not exists transaction id
{"error_code" : "ET100401"}

Query order without order number & reference number
{"error_code" : "ET100301"}

Void a success transaction.
{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "unpaid",
     "transactions: " [
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        "voided" : true,
        ....
       }
     ]
}
}

Make a failed transaction, then void
{"error_code" : "EO100301"}

Make a capture transaction, then void
{"error_code" : "EO200005"}

Duplicated void.
{"error_code" : "EO200005"}

Transaction.uuid can not match order.number
{"error_code" : "EO100301"}

Make a transaction, then make refund success, finally void the transaction
{"error_code" : "EO200005"}

Pass a randomly string to transaction.uuid
{"error_code" : "EO200005"}

{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "refunded",
     "transactions: " [
        {
          "type" : "Refund",
          "uuid" : "capture transaction uuid",
          success: true,
          ...
        },
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        ....
       }
     ]
}
}

Refund a failed transaction
{"error_code" : "EO100301"}

Make a voided transaction, then refund
{"error_code" : "EO100001"}

Refund amount <= 0.0
{"error_code" : "EO100001"}

Refund amount > Transaction Amount
{"error_code" : "EO100001"}

Pass a randomly string to transaction.uuid
{"error_code" : "EO100401"}

{
   "order" : {
     ...
     "state" : "invoiced",
     "correspondence_state" : "paid",
     "transactions: " [
        {
          "type" : "Capture",
          "uuid" : "capture transaction uuid",
          success: true,
          ...
        },
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        ....
       }
     ]
}
}

Make a sales transaction, then capture.
{"error_code" : "EO100003"}

Make a voided pre-authorization,then capture.
{"error_code" : "EO100003"}

Pass a randomly string to order.order_number
{"error_code" : "EO100301"}

Pass a randomly string to order.reference_number
{"error_code" : "EO100301"}

Not pass order_number & reference_number
{"error_code" : "ET200001"}

Pass a randomly string to transaction.uuid
{"error_code" : "EO100401"}

Not pass transaction.uuid
{"error_code" : "ET200001"}

Capture amount <0.0
{"error_code" : "400001"}

{
   "order" : {
     ...
     "state" : "voided",
     "correspondence_state" : "unpaid",
     "transactions: " [
       {
        "type" : "Sales",
        "uuid": "transaction uuid",
        "success" : true,
        "voided" : true
        ....
       }
     ]
}
}

Create an order,then partial paid,then void
{"error_code" : "EO100307"}

Pass a randomly string to order.order_number
{"error_code" : "EO100301"}

pass a randomly string to order.reference_number
{"error_code" : "EO100301"}

Empty order.number or order.reference_number
{"error_code" : "EO200001"}

Create an order, then make payment success, finally void order
{"error_code" : "EO100307"}

Header X-Action: order.created, request body same as query Order

Header X-Action: order.paid, request body same as query Order

Header X-Action: order.payment_failure, request body same as query Order

Header X-Action: transaction.authorized, request body same as query Order

Header X-Action: transaction.voided, request body same as query Order

Header X-Action: order.refunded, request body same as query Order

Header X-Action: order.voided, request body same as query Order

The webhook server return 4xx http error

The webhook connected but processed  over 60 seconds

{
    "customer": {
        "name": "customer.name",
        "email": "customer.email",
        "phone": "customer.phone",
        "reference_number": "customer.reference_number",
        "default_payment_method": "deflault_payment_method",
        "default_payment_token":"default_payment_token"
        }
 }

Empty reference number
{"error_code" : "EO200001"}

Empty name
{"error_code" : "EO200001"}

Empty phone
{"error_code" : "EO200001"}