syntax = "proto3";

package wix.payment.api.pay.v2;

import "google/protobuf/timestamp.proto";

option java_package = "com.wix.payment.api.pay.v2";

// status of the order
message OrderStatus {
  // status of the order
  Status status                = 1;
  // timestamp when the order was transmited to the current status
  google.protobuf.Timestamp ts = 2;

  // status of the order (more info [here][1])
  //
  //  [1]: /cashier-pay/guides/Order%20overview
  enum Status {
    UNDEFINED              = 0;
    // meaning the order was created
    INITIALIZED            = 1;
    // meaning payment process for this order has started OR has been successfully completed
    IN_PROCESS             = 2;
    // meaning payment process for this order didn't finish in time
    EXPIRED                = 3;
    // meaning payment process has failed (due to any of the reasons)
    NOT_APPROVED           = 4;
    // meaning that order has been approved (has approved transaction)
    APPROVED               = 5;
    // meaning order can become EXPIRED or APPROVED based on existing transactions
    // prevents from adding new transactions to order
    PENDING_EXPIRATION     = 6;

    // meaning recurring payment is active
    SUBSCRIPTION_ACTIVE    = 10;
    // meaning recurring payment was cancelled by user
    SUBSCRIPTION_CANCELLED = 11;
    // meaning the total billing cycles for the optional trial and the regular payment periods was completed (not yet supported)
    SUBSCRIPTION_FINISHED  = 12;
    // meaning recurring payment is not active yet, waiting for the first payment
    SUBSCRIPTION_PENDING   = 13;
    // meaning recurring payment was suspended by user
    SUBSCRIPTION_SUSPENDED = 14;
  }
}