ToTheZeroth News

API Documentation

"Payment" resource

Embedded as ttzn:payment in a "user" resource

The "payment" resource models a PayPal payment the user is interested in making. It is PUT to a specific URI given by the ttzn:pay link in the "user" resource, and using the information in the returned resource, the client is able to redirect the user to PayPal. After payment is complete, PayPal will make a call to the IPN callback URI, and after this call has been validated, the subscription will be automatically upgraded and/or extended.

The resource is represented by an application/hal+json [draft] object with the following structure.

State properties
Property Type Mode Description
amount Integer Read-only The amount of money required for the payment
currency String Read-only ISO currency code for the accepted currency
extension Boolean Required Whether or not the subscription should be extended another year
newPayLevel Integer Required The requested pay level (equal to or higher than the current one)
paypalIpnCallback String Read-only See the PayPal API reference for how to use this URI
paypalMerchantId String Read-only See the PayPal API reference for how to use this ID
verificationFailed Boolean Read-only true if payment has been attempted but failed verification
Resource links
Relation Description
self The URI of the "payment" resource
up The URI of the corresponding "user" resource
Note: Not included when the resource is embedded in the "user" resource