All Downloads are FREE. Search and download functionalities are using the official Maven repository.

models.dsl.Stripe.rapid Maven / Gradle / Ivy

There is a newer version: 1.4.2
Show newest version
/* 
  A Zen Model for stripe.com - a payments infrastructure for Internet (https://stripe.com/docs/api/)
*/
rapidModel Stripe
	resourceAPI Stripe baseURI "https://api.stripe.com/v1/"
		collectionResource ChargeCollection type Charge
			URI /charges
			/** To charge a credit card, you create a new charge object. If your API key is in test mode, the supplied card won't actually be charged, though everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully)*/
			method POST createCharge
				request
					/** A positive integer in the smallest currency unit (e.g 100 cents to charge $1.00, or 1 to charge ВҐ1, a 0-decimal currency) representing how much to charge the card. The minimum amount is $0.50 (or equivalent in charge currency).*/
					required param amount property amount
					/** 3-letter ISO code for currency. */
					required param currency type string
					/* it should be a reference path to "/currency>code", but this feature is not supported yet */

					/** either customer or card is required.
						The ID of an existing customer that will be charged in this request.*/
					param customer property customer

					/** either card or customer is required
						A card to be charged. If you also pass a customer ID, the card must be the ID of a card belonging to the customer. Otherwise, if you do not pass a customer ID, the card you provide must either be a token, like the ones returned by Stripe.js, or a dictionary containing a user's credit card details, with the options described below. Although not all information is required, the extra info helps prevent fraud.*/
					param card type string
					/* it should be a reference path to "/card", but this feature is not supported yet */

					/** An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the description of the charge(s) that they are describing.*/
					param description type string 
						default "null"

					/** A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format. It's often a good idea to store an email address in metadata for tracking later. */
					param metadata type string
					/* should be reference to metadata */
						default "{}"

					/** Whether or not to immediately capture the charge. When false, the charge issues an authorization (or pre-authorization), and will need to be captured later. Uncaptured charges expire in 7 days. For more information, see authorizing charges and settling later.*/
					param capture type boolean 
						default "true"

					/** A fee in cents that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key in order to take an application fee. For more information, see the application fees documentation.*/
					param application_fee type integer

				/** Returns a charge object if the charge succeeded.
					If the cvc parameter is provided, Stripe will attempt to check the CVC's correctness, and the check's result will be returned. Similarly, If address_line1 or address_zip are provided, Stripe will similarly try to check the validity of those parameters. Some banks do not support checking one or more of these parameters, in which case Stripe will return an 'unchecked' result. Also note that, depending on the bank, charges can succeed even when passed incorrect CVC and address information. */
				response ChargeCollection statusCode 200

				/**Returns an error if something goes wrong. A common source of error is an invalid or expired card, or a valid card with insufficient available balance. */
				response statusCode 400

			/** Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. */
			method GET listAllCharges
				request
					/** A limit on the number of objects to be returned. Count can range between 1 and 100 items. */
					required param count type integer
						default "10"

					/** A filter on the list based on the object created field. The value can be a string with an exact UTC timestamp, or it can be a dictionary with the following options: */
					required param created property created
					/** Only return charges for the customer specified by this customer ID. */
					required param customer property customer
					/** An offset into the list of returned items. The API will return the requested number of items starting at that offset. */
					required param offset type integer
						default "0"

				/** A dictionary with a data property that contains an array of up to count charges, starting at index offset. Each entry in the array is a separate charge object. If no more charges are available, the resulting array will be empty. */
				response ChargeCollection statusCode 200
				/** If you provide a non-existent customer ID, this call returns an error. */
				response statusCode 400

		objectResource ChargeObject type Charge
			URI /charges/{CHARGE_ID}
				required templateParam CHARGE_ID property id

			/** Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. */
			method GET retrieveCharge
				request
					/** The identifier of the charge to be retrieved. */
					required param id property id

				/** Returns a charge object if a valid identifier was provided.*/
				response ChargeCollection statusCode 200
				/** Returns an error if a valid identifier was not provided.*/
				response statusCode 400

			/** Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
				This request accepts only the description and metadata as arguments. */
			method POST updateCharge
				request ChargeObject

					/** An arbitrary string which you can attach to a recipient object. It is displayed alongside the recipient in the web interface. This will be unset if you POST an empty value. */
					param description type string
						default "null"

					/** A set of key/value pairs that you can attach to a charge object. It can be useful for storing additional information about the charge in a structured format. You can unset individual keys if you POST an empty value for that key. You can clear all keys if you POST an empty value for metadata. */
					required param metadata type string

				/** Returns the charge object if the update succeeded. */
				response ChargeObject statusCode 200
				/** This call will return an error if update parameters are invalid. */
				response statusCode 400

		objectResource RefundChargeObject type Charge
			URI /charges/{CHARGE_ID}/refund
				required templateParam CHARGE_ID property id

			/** Refunds a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged. The fees you were originally charged are also refunded.
				You can optionally refund only part of a charge. You can do so as many times as you wish until the entire charge has been refunded.
				Once entirely refunded, a charge can't be refunded again. This method will return an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge. */
			method POST updateReResource
				request
					/** The identifier of the charge to be refunded. */
					required param id property id
					/** A positive integer in cents representing how much of this charge to refund. Can only refund up to the unrefunded amount remaining of the charge. */
					param amount type integer
						default "entire charge"

					/** Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Else, the application fee will be refunded with an amount proportional to the amount of the charge refunded.
						An application fee can only be refunded by the application that created the charge. */
					param refund_application_fee type boolean

				/** Returns the charge object if the refund succeeded. */
				response ChargeCollection statusCode 200
				/** Returns an error if the charge has already been refunded or an invalid charge identifier was provided. */
				response statusCode 400


		objectResource CaptureChargeObject type Charge
			URI /charges/{CHARGE_ID}/capture
				templateParam CHARGE_ID property id

			/** Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.
				Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable. */
			method POST captureCharge
				request CaptureChargeObject
					required param id property id
					/** The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. */
					param amount property amount
					/** An application fee to add on to this charge. Can only be used with Stripe Connect. */
					param application_fee type integer

				/** Returns the charge object, with an updated captured property (set to true). Capturing a charge will always succeed.*/
				response statusCode 200
				/** Returns an error if the charge is already refunded, or expired, or an invalid capture amount is specified.*/
				response statusCode 400


		collectionResource CustomerCollection type Customer
			URI /customers
			/** Creates a new customer object. */
			method POST createCustomer
				request
					/** An integer amount in cents that is the starting account balance for your customer. A negative amount represents a credit that will be used before attempting any charges to the customer’s card; a positive amount will be added to the next invoice. */
					param account_balance property account_balance
					/** The card can either be a token, like the ones returned by our Stripe.js, or a dictionary containing a user’s credit card details (with the options shown below). Passing card will create a new card, make it the new customer default card, and delete the old customer default if one exists. If you want to add additional cards instead of replacing the existing default, use the card creation API. Whenever you attach a card to a customer, Stripe will automatically validate the card.*/
					param card type string
					/** If you provide a coupon code, the customer will have a discount applied on all recurring charges. Charges you create through the API will not have the discount.*/
					param coupon type string
					/** An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. This will be unset if you POST an empty value.*/
					param description type string
					/** Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This will be unset if you POST an empty value.*/
					param email property email
					/** A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format. This will be unset if you POST an empty value.*/
					param metadata type string
					/** The identifier of the plan to subscribe the customer to. If provided, the returned customer object has a �subscription’ attribute describing the state of the customer’s subscription*/
					param plan type string
					/** The quantity you’d like to apply to the subscription you’re creating. For example, if your plan is 10 cents/user/month, and your customer has 5 users, you could pass 5 as the quantity to have the customer charged 50 cents (5 x 10 cents) monthly. Defaults to 1 if not set. Only applies when the plan parameter is also provided.*/
					param quantity type string
					/** UTC integer timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value now can be provided to end the customer’s trial immediately. Only applies when the plan parameter is also provided.*/
					param trial_end type string

				/** Returns a customer object if the call succeeded. The returned object will have information about subscriptions, discount, and cards, if that information has been provided.
					If a card has been attached to the customer, the returned customer object will have a default_card attribute, which is an ID that can be expanded into the full card details when retrieving the customer. */
				response CustomerObject statusCode 200
				/**  If a non-free plan is specified and a card is not provided (unless the plan has a trial period), the call will return an error.*/
				response statusCode 400
				/** If a non-existent plan or a non-existent or expired coupon is provided, the call will return an error. */
				response statusCode 400

			/** Returns a list of your customers. The customers are returned sorted by creation date, with the most recently created customers appearing first. */
			method GET listAllCustomers
				request
					/** A limit on the number of objects to be returned. Count can range between 1 and 100 items.*/
					param count type integer
						default "10"

					/**A filter on the list based on the object created field. The value can be a string with an exact UTC timestamp, or it can be a dictionary with the following options:
						Show Child Parameters... */
					param created type string
					/** An offset into the list of returned items. The API will return the requested number of items starting at that offset. */
					param offset type integer
						default "0"


				/** A dictionary with a data property that contains an array of up to count customers, starting at index offset. Each entry in the array is a separate customer object. If no more customers are available, the resulting array will be empty. This request should never return an error. */
				response CustomerCollection


		/**Customer objects allow you to perform recurring charges and track multiple charges that are associated with the same customer. The API allows you to create, delete, and update your customers. You can retrieve individual customers as well as a list of all your customers. */
		objectResource CustomerObject type Customer
			URI /customers/{CUSTOMER_ID}
				required templateParam CUSTOMER_ID property id

			mediaTypes
				application/xml
			/** Retrieves the details of an existing customer. You need only supply the unique customer identifier that was returned upon customer creation. */
			method GET retrieveCustomer
				request
					/** The identifier of the customer to be retrieved. */
					required param id property id

				/** Returns a customer object if a valid identifier was provided. When requesting the ID of a customer that has been deleted, a subset of the customer's information will be returned, including a "deleted" property, which will be true. */
				response CustomerObject statusCode 200
				response statusCode 404

			/** Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the card parameter, that becomes the customer's active card to be used for all charges in the future. When you update a customer to a new valid card, the last unpaid invoice (if one exists) will be retried automatically.
				This request accepts mostly the same arguments as the customer creation call.*/
			method POST updateCustomer
				request
					/** An integer amount in cents that is the starting account balance for your customer. A negative amount represents a credit that will be used before attempting any charges to the customer’s card; a positive amount will be added to the next invoice. */
					param account_balance property account_balance
					/** The card can either be a token, like the ones returned by our Stripe.js, or a dictionary containing a user’s credit card details (with the options shown below). Passing card will create a new card, make it the new customer default card, and delete the old customer default if one exists. If you want to add additional cards instead of replacing the existing default, use the card creation API. Whenever you attach a card to a customer, Stripe will automatically validate the card.*/
					param card type string
					/** If you provide a coupon code, the customer will have a discount applied on all recurring charges. Charges you create through the API will not have the discount.*/
					param coupon type string
					/**ID of card to make the customer’s new default for invoice payments */
					param default_card type string
					/** An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. This will be unset if you POST an empty value.*/
					param description type string
					/** Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This will be unset if you POST an empty value.*/
					param email property email
					/** A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format. This will be unset if you POST an empty value.*/
					param metadata type string

				/** Returns the customer object if the update succeeded. */
				response CustomerObject statusCode 200
				/** Returns an error if update parameters are invalid (e.g. specifying an invalid coupon or an invalid card).*/
				response statusCode 400

			/** Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscription on the customer.*/
			method DELETE deleteCustomer
				request
					/** The identifier of the customer to be deleted. */
					required param id property id

				/**Returns an object with a deleted parameter on success. 
				Unlike other objects, deleted customers can still be retrieved through the API, in order to be able to track the history of customers while still removing their credit card details and preventing any further operations to be performed (such as adding a new subscription). */
				response statusCode 200
				/** If the customer ID does not exist, this call returns an error. */
				response statusCode 400



	dataModel Stripe
		/** To charge a credit or a debit card, you create a new charge object. You can retrieve and refund individual charges as well as list all charges. Charges are identified by a unique random ID.*/
		structure Charge
			/** object string, value is "charge"*/
			id : string
			livemode : boolean
			/** Amount charged in cents*/
			amount : integer
			/**If the charge was created without capturing, this boolean represents whether or not it is still uncaptured or has since been captured. */
			captured : boolean
			/** Hash describing the card used to make the charge*/
			card : reference Card
			created : dateTime
			/** Three-letter ISO currency code representing the currency in which the charge was made.*/
			currency : reference Currency
			paid : boolean
			/** Whether or not the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. */
			refunded : boolean
			/** hash A list of refunds that have been applied to the charge.*/
			refunds : containing reference to Refund*
			/** Amount in cents refunded (can be less than the amount attribute on the charge if a partial refund was issued)*/
			amount_refunded : integer
			/** Balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). */
			balance_transaction : string
			/** ID of the customer this charge is for if one exists*/
			customer : string
			description : string
			/** Details about the dispute if the charge has been disputed*/
			dispute : reference Dispute
			/** Error code explaining reason for charge failure if available (see https://stripe.com/docs/api#errors for a list of codes)*/
			failure_code : string
			/** Message to user further explaining reason for charge failure if available*/
			failure_message : string
			/**ID of the invoice this charge is for if one exists */
			invoice : string
			/** A set of key/value pairs that you can attach to a charge object. It can be useful for storing additional information about the charge in a structured format.*/
			metadata : reference Metadata

		/**Customer objects allow you to perform recurring charges and track multiple charges that are associated with the same customer. The API allows you to create, delete, and update your customers. You can retrieve individual customers as well as a list of all your customers. */
		structure Customer
			id : string
			/** value is "customer" */
			object : string //value is "customer"
			livemode : boolean
			cards : reference Card *
			created : time
			/** Current balance, if any, being stored on the customer’s account. If negative, the customer has credit to apply to the next invoice. If positive, the customer has an amount owed that will be added to the next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account for recurring charges.*/
			account_balance : integer
			/** The currency the customer can be charged in for recurring billing purposes (subscriptions, invoices, invoice items).*/
			currency : string
			/** ID of the default credit card attached to the customer */
			default_card : string
			/** Whether or not the latest charge for the customer’s latest invoice has failed*/
			delinquent : boolean
			description : string
			/** Describes the current discount active on the customer, if there is one. */
			discount : containing reference DiscountObject
			email : string
			/** A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.*/
			metadata : containing reference MetadataHash
			subscriptions : reference Subscription *

		structure Card
			/** ID of card (used in conjunction with a customer ID)*/
			id : string
			// object string, value is "card"
			exp_month : integer
			exp_year : integer
			/** Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. */
			fingerprint : string
			last4 : string
			/** Card brand. Can be Visa, American Express, MasterCard, Discover, JCB, Diners Club, or Unknown. */
			^type : string
			address_city : string
			/** Billing address country, if provided when creating card */
			address_country : string
			address_line1 : string
			/** If address_line1 was provided, results of the check: pass, fail, or unchecked. */
			address_line1_check : string
			address_line2 : string
			address_state : string
			address_zip : string
			/** If address_zip was provided, results of the check: pass, fail, or unchecked. */
			address_zip_check : string
			/** Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected. */
			country : string
			customer : string
			/** If a CVC was provided, results of the check: pass, fail, or unchecked */
			cvc_check : string
			/** Cardholder name */
			name : string

		structure DiscountObject

		structure MetadataHash

		structure Subscription

		structure Currency
			/** Three-letter ISO currency code representing the currency in which the charge was made.*/
			code : string

		structure Refund

		structure Dispute

		/** A set of key/value pairs that you can attach to a charge object. It can be useful for storing additional information about the charge in a structured format.*/
		structure Metadata






© 2015 - 2024 Weber Informatics LLC | Privacy Policy