-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update transaction model #22
Conversation
1c49382
to
0deab81
Compare
0deab81
to
59808cd
Compare
8ccabd3
to
4119497
Compare
return Promise<Transaction>(error: UnexpectedResponseError(message: "Transaction id should not be nil.")) | ||
} | ||
|
||
guard let origin = self.origin, cardId = origin.cardId else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to guard let cardId = self.origin?.cardId else
. Our objective is to extract only the cardId
, so we don't need to unwrap the origin
to unwrap the cardId
.
4119497
to
a219658
Compare
Updated @SandroMachado. |
a219658
to
5a5eaf5
Compare
/** | ||
Creates a transaction. | ||
|
||
- parameter transactionRequest: The transaction request information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the documentation.
5a5eaf5
to
606c94e
Compare
@@ -115,20 +115,20 @@ class CardTest: UpholdTestCase { | |||
|
|||
card.createTransaction(transactionRequest).then { (transaction: Transaction) -> () in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add a test to the create transaction with commit query parameter.
606c94e
to
736c412
Compare
let request = UserCardService.createTransaction("bar", commit: true, transactionRequest: "foobar") | ||
|
||
XCTAssertEqual(request.url, "https://api.uphold.com/v0/me/cards/bar/transactions", "Failed: Wrong URL.") | ||
XCTAssertEqual(request.query[0], "commit=true", "Failed: Wrong URL.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an assert to the size of the query parameters.
736c412
to
ead5eb0
Compare
Updated @SandroMachado. |
func testCreateTransactionWithCommitShouldReturnTheTransaction() { | ||
let card: Card = Fixtures.loadCard(nil) | ||
let expectation = expectationWithDescription("Card test: create transaction.") | ||
card.adapter = MockRestAdapter(body: "{ \"id\": \"foobar\" }") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort.
ead5eb0
to
be69a4e
Compare
Update transaction model
This pull request updates the transaction model.