package com.cloudmine.api.rest.response;

import com.cloudmine.api.rest.response.code.PaymentCode;
import org.apache.http.HttpResponse;

/**
 * <br>Copyright CloudMine LLC. All rights reserved
 * <br> See LICENSE file included with SDK for details.
 */
public class PaymentResponse extends ResponseBase<PaymentCode> {
    protected PaymentResponse(HttpResponse response) {
        super(response);
    }

    public PaymentResponse(String messageBody, int statusCode) {
        super(messageBody, statusCode);
    }

    @Override
    public PaymentCode getResponseCode() {
        return PaymentCode.codeForStatus(getStatusCode());
    }
}

@@ -35,16 +35,55 @@
 ponse;%0A%0A
+import com.cloudmine.api.CMCreditCard;%0A
 import c
@@ -169,16 +169,119 @@
 ponse;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A
 /**%0A * %3C
@@ -453,16 +453,62 @@
 Code%3E %7B%0A
+%0A    private List%3CCMCreditCard%3E creditCards;%0A%0A
     prot
@@ -819,11 +819,979 @@
 );%0A    %7D
+%0A%0A    public List%3CCMCreditCard%3E getCreditCards() %7B%0A        if(creditCards == null) %7B%0A            creditCards = new ArrayList%3CCMCreditCard%3E();%0A            Object cards = getObject(%22card%22);%0A            if(cards instanceof Collection) %7B%0A                for(Object card : (Collection)cards) %7B%0A                    if(card instanceof Map) %7B%0A                        Map%3CString, String%3E cardMap = (Map%3CString, String%3E) card;%0A                        String nameOnCard = cardMap.get(%22nameOnCard%22);%0A                        String token = cardMap.get(%22token%22);%0A                        String expirationDate = cardMap.get(%22expirationDate%22);%0A                        String last4Digits = cardMap.get(%22last4Digits%22);%0A                        String type = cardMap.get(%22type%22);%0A                        creditCards.add(new CMCreditCard(nameOnCard, token, expirationDate,last4Digits,type));%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        return creditCards;%0A    %7D
 %0A%7D%0A

Add seeing loaded cards to payment response