1 package com.srv4pos.server.api.sale; 2 3 /** 4 * Determines status of the payment. Assuming the payment can be made trough payment system, it can be {@link #CHARGE_FAILED}. 5 * Or for instance {@link #PENDING}, which means not yet PAID. etc. 6 * <p>User: Pavel Abizyaev, Date: 04.09.2014 18:46</p>* 7 */ 8 public enum PaymentState { 9 /** 10 * First state when payment is created and going to go trough payment system. It means it's moving to payment system, but 11 * payment system didn't report the payment is received. 12 */ 13 SENDING, 14 /** 15 * In case of any problems with sending the payment. 16 */ 17 SENDING_FAILED, 18 /** 19 * This state indicates that payment system has sucessfully received the payment. Now it's up to payment system to 20 * perform action for the payment. After this state it can go to {@link #APPROVED}, {@link #REJECTED}, {@link #PAUSED}, 21 * {@link #CANCELED}, {@link #CHARGE_FAILED}. 22 */ 23 PENDING, 24 /** 25 * This state guarantees consumer confirmed the payment. 26 */ 27 APPROVED, 28 /** 29 * This state means the payment system (not a consumer) rejected the payment. 30 */ 31 REJECTED, 32 /** 33 * This state means our app (not a payment system) doesn't communicate with payment system at the moment. In means, 34 * the payment system can perform any action with the payment (like approval, rejection etc.). Later on our app can 35 * request latest status via getPaymentStatus() method and then our app updates state of the payment. 36 * We can treat PAUSED state as `unknown yet`. 37 */ 38 PAUSED, 39 /** 40 * This means consumer or cashier (not the payment system) actively refused the payment. 41 */ 42 CANCELED, 43 /** 44 * This state indicates the PENDING payment was failed on a pending process. 45 */ 46 CHARGE_FAILED, 47 /** 48 * It happens if we try to cancel but some problem occurs so we don't know actual state anymore. resumePayment call required to discover latest state. 49 */ 50 CHARGE_UNKNOWN 51 }