Skip to content

Commit

Permalink
Adds 'email' to contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
fayderflorez committed Oct 3, 2017
1 parent 4071894 commit 7b1a4bc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class Contribution {

private int amount;
private String token;
private String email;

public int getAmount() {
return amount;
Expand All @@ -15,4 +16,8 @@ public int getAmount() {
public String getToken() {
return token;
}

public String getEmail() {
return email;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public Object contribute(Contribution contribution) {
params.put("amount", contribution.getAmount());
params.put("currency", "eur");
params.put("description", "REST Countries");
params.put("email", contribution.getEmail());
params.put("source", contribution.getToken());

try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/restc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $(function () {
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify({"token": token.id, "amount": restc.amount}),
data: JSON.stringify({"token": token.id, "email": token.email, "amount": restc.amount}),
success: function(data, textStatus, jqXHR) {
console.log("Contribution success");
},
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/restc.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b1a4bc

Please sign in to comment.