Skip to content

Commit

Permalink
Fix bug where AlternativePaymentSourceResponse.getType() always retur…
Browse files Browse the repository at this point in the history
…ned null

Releasing as 2.3.1
  • Loading branch information
harry-peirse committed Apr 22, 2020
1 parent c9c0414 commit f68ef70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=com.checkout
version=2.3.0-SNAPSHOT
version=2.3.1-SNAPSHOT

maven2_url=https://oss.sonatype.org/service/local/staging/deploy/maven2/
snapshot_url=https://oss.sonatype.org/content/repositories/snapshots/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class AlternativePaymentSourceResponse extends HashMap<String, Object> implements ResponseSource {
private String type;
private static final String TYPE_FIELD = "type";

@Override
public String getType() {
return type;
return get(TYPE_FIELD).toString();
}

public void setType(String type) {
this.type = type;
put(TYPE_FIELD, type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void can_get_alternative_payment() throws Exception {

GetPaymentResponse verifiedPayment = getApi().paymentsClient().getAsync(payment.getId()).get();

Assert.assertEquals("giropay", verifiedPayment.getSource().getType());
Assert.assertNotNull(verifiedPayment);
Assert.assertEquals(payment.getId(), verifiedPayment.getId());
Assert.assertNotNull(verifiedPayment);
Expand Down

0 comments on commit f68ef70

Please sign in to comment.