Skip to content

Commit

Permalink
add payment method nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendsv committed Mar 3, 2015
1 parent b11e9b5 commit 6525511
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Transaction struct {
Amount *Decimal `xml:"amount"`
OrderId string `xml:"order-id,omitempty"`
PaymentMethodToken string `xml:"payment-method-token,omitempty"`
PaymentMethodNonce string `xml:"payment-method-nonce,omitempty"`
MerchantAccountId string `xml:"merchant-account-id,omitempty"`
PlanId string `xml:"plan-id,omitempty"`
CreditCard *CreditCard `xml:"credit-card,omitempty"`
Expand Down
16 changes: 16 additions & 0 deletions transaction_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,19 @@ func TestSettleTransaction(t *testing.T) {
t.Fatal(txn.Status)
}
}

func TestTrxPaymentMethodNonce(t *testing.T) {
txn, err := testGateway.Transaction().Create(&Transaction{
Type: "sale",
Amount: randomAmount(),
PaymentMethodNonce: "fake-apple-pay-mastercard-nonce",
})
if err != nil {
t.Fatal(err)
}

txn, err = testGateway.Transaction().SubmitForSettlement(txn.Id, txn.Amount)
if err != nil {
t.Fatal(err)
}
}

0 comments on commit 6525511

Please sign in to comment.