Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'fp-javadoc-update' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
juwon committed Sep 17, 2014
2 parents bb35dca + 8acd820 commit f8ba00e
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 5 deletions.
7 changes: 3 additions & 4 deletions rest-api-sdk/src/main/java/com/paypal/api/payments/Cost.java
Expand Up @@ -8,7 +8,7 @@ public class Cost {
/**
* Cost in percent. Range of 0 to 100.
*/
private float percent;
private Float percent;

/**
* Cost in amount. Range of 0 to 999999.99.
Expand All @@ -25,19 +25,18 @@ public Cost() {
/**
* Setter for percent
*/
public Cost setPercent(float percent) {
public Cost setPercent(Float percent) {
this.percent = percent;
return this;
}

/**
* Getter for percent
*/
public float getPercent() {
public Float getPercent() {
return this.percent;
}


/**
* Setter for amount
*/
Expand Down
Expand Up @@ -31,7 +31,7 @@ private Properties getCredential() throws FileNotFoundException, IOException {
* https://developer.paypal.com/webapps/developer/docs/integration/mobile/make-future-payment/
*
* @param authorizationCode an authorization code
* @param refreshToken a refresh token
* @param accessToken an access token
* @param correlationId paypal application correlation ID
* @return a <code>Payment</code> object
* @throws PayPalRESTException
Expand Down
Expand Up @@ -39,6 +39,22 @@ public class Transaction {
*/
private List<Transaction> transactions;

/**
* Invoice number used to track the payment. 256 characters max.
*/
private String invoiceNumber;

/**
* Free-form field for the use of clients. 256 characters max.
*/
private String custom;

/**
* Soft descriptor used when charging this funding source. 22 characters max.
*/
private String softDescriptor;


/**
* Default Constructor
*/
Expand Down Expand Up @@ -148,6 +164,51 @@ public List<Transaction> getTransactions() {
return this.transactions;
}

/**
* Setter for invoiceNumber
*/
public Transaction setInvoiceNumber( String invoiceNumber ) {
this.invoiceNumber = invoiceNumber;
return this;
}

/**
* Getter for invoiceNumber
*/
public String getInvoiceNumber() {
return this.invoiceNumber;
}

/**
* Setter for custom
*/
public Transaction setCustom( String custom ) {
this.custom = custom;
return this;
}

/**
* Getter for custom
*/
public String getCustom() {
return this.custom;
}

/**
* Setter for softDescriptor
*/
public Transaction setSoftDescriptor( String softDescriptor ) {
this.softDescriptor = softDescriptor;
return this;
}

/**
* Getter for softDescriptor
*/
public String getSoftDescriptor() {
return this.softDescriptor;
}

/**
* Returns a JSON string corresponding to object state
*
Expand Down
Expand Up @@ -14,6 +14,12 @@ public class TransactionTestCase {

public static final String DESCRIPTION = "sample description";

public static final String CUSTOM = "custom field value 1";

public static final String INVOICE = "invoice 1";

public static final String SOFT_DESCRIPTOR = "soft descriptor 1";

public static Transaction createTransaction() {
ItemList itemList = ItemListTestCase.createItemList();
List<RelatedResources> relResources = new ArrayList<RelatedResources>();
Expand All @@ -24,6 +30,9 @@ public static Transaction createTransaction() {
transaction.setDescription(DESCRIPTION);
transaction.setItemList(itemList);
transaction.setRelatedResources(relResources);
transaction.setCustom( CUSTOM );
transaction.setInvoiceNumber( INVOICE );
transaction.setSoftDescriptor( SOFT_DESCRIPTOR );
return transaction;
}

Expand All @@ -40,6 +49,9 @@ public void testConstruction() {
.getAuthorization().getId(), AuthorizationTestCase.ID);
Assert.assertEquals(transaction.getAmount().getCurrency(),
AmountTestCase.CURRENCY);
Assert.assertEquals(transaction.getCustom(), CUSTOM);
Assert.assertEquals(transaction.getInvoiceNumber(), INVOICE);
Assert.assertEquals(transaction.getSoftDescriptor(), SOFT_DESCRIPTOR);
}

@Test
Expand Down

0 comments on commit f8ba00e

Please sign in to comment.