From 6525511e5d2c5ba49a8c299324864b986b944b75 Mon Sep 17 00:00:00 2001 From: juliendsv Date: Tue, 3 Mar 2015 10:42:09 +0000 Subject: [PATCH] add payment method nonce --- transaction.go | 1 + transaction_integration_test.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/transaction.go b/transaction.go index bb6e5873..67d1c7dc 100644 --- a/transaction.go +++ b/transaction.go @@ -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"` diff --git a/transaction_integration_test.go b/transaction_integration_test.go index 34e80d89..a8071929 100644 --- a/transaction_integration_test.go +++ b/transaction_integration_test.go @@ -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) + } +}