diff --git a/Stripe/PublicHeaders/STPSourceParams.h b/Stripe/PublicHeaders/STPSourceParams.h index e5930c1167d..fc99d75df8b 100644 --- a/Stripe/PublicHeaders/STPSourceParams.h +++ b/Stripe/PublicHeaders/STPSourceParams.h @@ -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 diff --git a/Stripe/STPSourceParams.m b/Stripe/STPSourceParams.m index e037db513d0..61f89af8bf7 100644 --- a/Stripe/STPSourceParams.m +++ b/Stripe/STPSourceParams.m @@ -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