Skip to content

Commit

Permalink
typo fix and incorporate into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
codewitch committed Aug 11, 2015
1 parent 3d138dc commit 8a4a3e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Transaction struct {
UpdatedAt *time.Time `xml:"updated-at,omitempty"`
DisbursementDetails *DisbursementDetails `xml:"disbursement-details,omitempty"`
RefundIds *[]string `xml:"refund-ids>item,omitempty"`
RefundedTransactionId *string `xml:"refundied-transaction-id,omitempty"`
RefundedTransactionId *string `xml:"refunded-transaction-id,omitempty"`
}

// TODO: not all transaction fields are implemented yet, here are the missing fields (add on demand)
Expand Down
14 changes: 14 additions & 0 deletions transaction_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,20 @@ func TestTransactionCreateSettleAndFullRefund(t *testing.T) {
t.Fatal(txn.Status)
}

if *refundTxn.RefundedTransactionId != txn.Id {
t.Fatal(*refundTxn.RefundedTransactionId)
}

// Check that the refund shows up in the original transaction
txn, err = testGateway.Transaction().Find(txn.Id)
if err != nil {
t.Fatal(err)
}

if txn.RefundIds != nil && (*txn.RefundIds)[0] != refundTxn.Id {
t.Fatal(*txn.RefundIds)
}

// Second refund should fail
refundTxn, err = testGateway.Transaction().Refund(txn.Id)
t.Log(refundTxn)
Expand Down

0 comments on commit 8a4a3e1

Please sign in to comment.