Skip to content

Commit

Permalink
Merge pull request #811 from stripe/bdorfman-alipay-reusable
Browse files Browse the repository at this point in the history
Add reusable alipay source params.
  • Loading branch information
bdorfman-stripe authored Oct 23, 2017
2 parents 9871bc6 + c54c019 commit 364fe69
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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

0 comments on commit 364fe69

Please sign in to comment.