Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reusable alipay source params. #811

Merged
merged 2 commits into from
Oct 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Stripe/PublicHeaders/STPSourceParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@ NS_ASSUME_NONNULL_BEGIN
currency:(NSString *)currency
returnURL:(NSString *)returnURL;

/**
Creates params for a reusable Alipay source
@see https://stripe.com/docs/sources/alipay#create-source

@param currency The currency the payment is being created in.
@param returnURL The URL the customer should be redirected to after they have
successfully verified the payment.

@return An STPSourceParams object populated with the provided values
*/
+ (STPSourceParams *)alipayReusableParamsWithCurrency:(NSString *)currency
returnURL:(NSString *)returnURL;

/**
Creates params for a P24 source
@see https://stripe.com/docs/sources/p24#create-source
Expand Down
11 changes: 11 additions & 0 deletions Stripe/STPSourceParams.m
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ + (STPSourceParams *)alipayParamsWithAmount:(NSUInteger)amount
return params;
}

+ (STPSourceParams *)alipayReusableParamsWithCurrency:(NSString *)currency
returnURL:(NSString *)returnURL {
STPSourceParams *params = [self new];
params.type = STPSourceTypeAlipay;
params.currency = currency;
params.redirect = @{ @"return_url": returnURL };
params.usage = STPSourceUsageReusable;

return params;
}

+ (STPSourceParams *)p24ParamsWithAmount:(NSUInteger)amount
currency:(NSString *)currency
email:(NSString *)email
Expand Down