mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-28 06:00:43 +00:00

git-subtree-dir: submodules/TelegramUI git-subtree-mainline: 5c1613d1048026b9e00a6ce753775cef87eb53fa git-subtree-split: fa3ac0b61a27c8dd3296518a15891a6f9750cbf2
50 lines
1.3 KiB
Objective-C
Executable File
50 lines
1.3 KiB
Objective-C
Executable File
//
|
|
// STPBlocks.h
|
|
// Stripe
|
|
//
|
|
// Created by Jack Flintermann on 3/23/16.
|
|
// Copyright © 2016 Stripe, Inc. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
@class STPToken;
|
|
|
|
/**
|
|
* An enum representing the status of a payment requested from the user.
|
|
*/
|
|
typedef NS_ENUM(NSUInteger, STPPaymentStatus) {
|
|
/**
|
|
* The payment succeeded.
|
|
*/
|
|
STPPaymentStatusSuccess,
|
|
/**
|
|
* The payment failed due to an unforeseen error, such as the user's Internet connection being offline.
|
|
*/
|
|
STPPaymentStatusError,
|
|
/**
|
|
* The user cancelled the payment (for example, by hitting "cancel" in the Apple Pay dialog).
|
|
*/
|
|
STPPaymentStatusUserCancellation,
|
|
};
|
|
|
|
/**
|
|
* An empty block, called with no arguments, returning nothing.
|
|
*/
|
|
typedef void (^STPVoidBlock)();
|
|
|
|
/**
|
|
* A block that may optionally be called with an error.
|
|
*
|
|
* @param error The error that occurred, if any.
|
|
*/
|
|
typedef void (^STPErrorBlock)(NSError * __nullable error);
|
|
|
|
/**
|
|
* A callback to be run with a token response from the Stripe API.
|
|
*
|
|
* @param token The Stripe token from the response. Will be nil if an error occurs. @see STPToken
|
|
* @param error The error returned from the response, or nil in one occurs. @see StripeError.h for possible values.
|
|
*/
|
|
typedef void (^STPTokenCompletionBlock)(STPToken * __nullable token, NSError * __nullable error);
|