• Home
  • API Documentation
Show / Hide Table of Contents
  • Yort.AfterPay.InStore
    • AfterPayApiError
      • ErrorCode
      • ErrorId
      • HttpStatusCode
      • Message
    • AfterPayApiException
      • AfterPayApiException
      • ErrorCode
      • ErrorId
      • HttpStatusCode
    • AfterPayCallContext
      • OperatorId
    • AfterPayClient
      • AfterPayClient
      • CreateOrder
      • DisposeManagedResources
      • Ping
      • PreapprovalEnquiry
      • RefundOrder
      • RegisterDevice
      • ReverseOrder
      • ReverseRefund
      • SendInvite
    • AfterPayConfiguration
      • AfterPayConfiguration
      • DefaultCurrency
      • DeviceId
      • DeviceKey
      • Environment
      • HttpClient
      • MerchantId
      • MinimumRetries
      • ProductName
      • ProductVendor
      • ProductVersion
      • RetryDelaySeconds
      • SystemClock
    • AfterPayConstants
      • JsonMediaType
      • ProductionRootUrl
      • SandboxRootUrl
    • AfterPayCreateOrderRequest
      • Amount
      • MerchantReference
      • OrderItems
      • PreapprovalCode
      • RequestedAt
      • RequestId
    • AfterPayCreateRefundRequest
      • Amount
      • MerchantReference
      • OrderId
      • OrderMerchantReference
      • RequestedAt
      • RequestId
    • AfterPayCurrencies
      • AustralianDollars
      • NewZealandDollars
    • AfterPayDeviceRegistration
      • DeviceId
      • Key
    • AfterPayDeviceRegistrationRequest
      • Attributes
      • Name
      • Secret
    • AfterPayEnvironment
      • Production
      • Sandbox
    • AfterPayInviteRequest
      • ExpectedAmount
      • MobileNumber
      • NormalizePhoneNumber
    • AfterPayMoney
      • AfterPayMoney
      • Amount
      • Currency
      • Equality
      • Equals
      • GetHashCode
      • Inequality
      • ToString
    • AfterPayMoneyJsonConverter
      • CanConvert
      • ReadJson
      • WriteJson
    • AfterPayOrder
      • Amount
      • MerchantReference
      • OrderedAt
      • OrderId
      • OrderItems
      • PreapprovalCode
      • RequestedAt
      • RequestId
    • AfterPayOrderItem
      • Name
      • Price
      • Quantity
      • Sku
    • AfterPayOrderReversal
      • RequestedAt
      • ReversedAt
      • ReverseId
      • ReversingRequestId
    • AfterPayPreapprovalRequest
      • PreapprovalCode
    • AfterPayPreapprovalResponse
      • Amount
      • ExpiresAt
      • Minimum
    • AfterPayRefund
      • Amount
      • MerchantReference
      • OrderId
      • OrderMerchantReference
      • RefundedAt
      • RefundId
      • RequestedAt
      • RequestId
    • AfterPayRefundReversal
      • RequestedAt
      • ReversedAt
      • ReverseId
      • ReversingRequestId
    • AfterPayReverseOrderRequest
      • RequestedAt
      • ReversingRequestId
    • AfterPayReverseRefundRequest
      • RequestedAt
      • ReversingRequestId
    • AfterPaySystemClock
      • DefaultInstance
      • Now
    • AfterPayToken
      • ExpiresAt
      • ExpiresIn
      • IsExpired
      • IssuedAt
      • Token
    • AfterPayTokenRequest
      • Key
    • IAfterPayClient
      • CreateOrder
      • Ping
      • PreapprovalEnquiry
      • RefundOrder
      • RegisterDevice
      • ReverseOrder
      • ReverseRefund
      • SendInvite
    • IAfterPaySystemClock
      • Now

Struct AfterPayMoney

Represents a monetary or financial value in the AfterPay API as a tuple containing a numeric value and a string representing the associated currency.

Implements
IEquatable<AfterPayMoney>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Yort.AfterPay.InStore
Assembly: cs.temp.dll.dll
Syntax
public struct AfterPayMoney : IEquatable<AfterPayMoney>
Remarks

This is an immutable value type. To set the value or currency you must use the AfterPayMoney(Decimal, String) constructor.

Instances created using the default construtor will return a zero value with the Currency property returning the value of AustralianDollars.

Note it is important the Amount property be set with the correct number of decimals. Using too many decimal places (more than 2 for AUD or NZD) will result in a 400 - bad request, invalid json response from the server. You can use the function when setting the amount to ensure the maximum number of decimal places used.

 //Assuming you have an variable called payment with a 'value' property containing the decimal amount 
    //you want to send to after pay.
    var amount = new AfterPayMoney(Math.Round(payment.Value, 2));

    //This sample uses a literal value for illustration purposes
    var amount = new AfterPayMoney(Math.Round(99.9900, 2));

See https://docs.afterpay.com.au/instore-api-v1.html#money-object for more information.

Constructors

Name Description
AfterPayMoney(Decimal)

Constructs a new instance using the specified amount and currency.

AfterPayMoney(Decimal, String)

Constructs a new instance using the specified amount and currency.

Properties

Name Description
Amount

Returns the numeric amount of this monetary value in the currency specified by Currency.

Currency

Specifies the currency of the Amount/

Methods

Name Description
Equals(Object)

Compares this instance to an object value and returns true if they are both AfterPayMoney instances that are considered equal, otherwise false.

Equals(AfterPayMoney)

Returns true if this instance is considered equal to other, otherwise returns false.

GetHashCode()

Returns the hashcode for this instance.

ToString()

Returns the Amount property formatted as a currency using the current thread culture (which may or may not match the currency defined by Currency).

Operators

Name Description
Equality(AfterPayMoney, AfterPayMoney)

Performs equality checking on AfterPayMoney instances.

Inequality(AfterPayMoney, AfterPayMoney)

Performs inequality checking on AfterPayMoney instances.

See Also

AfterPayCurrencies
Back to top Copyright (c) 2017 Troy Willmot