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 FPX to Basic Integration #1390

Merged
merged 10 commits into from
Sep 27, 2019
2 changes: 1 addition & 1 deletion Stripe/STPPaymentIntentParams.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ - (nullable NSString *)setupFutureUsageRawString {

- (void)configureWithPaymentResult:(STPPaymentResult *)paymentResult {
if (paymentResult.paymentMethod) {
_paymentMethodId = paymentResult.paymentMethod.stripeId;
_paymentMethodId = [paymentResult.paymentMethod.stripeId copy];
} else if (paymentResult.paymentMethodParams) {
_paymentMethodParams = paymentResult.paymentMethodParams;
}
Expand Down
8 changes: 4 additions & 4 deletions Stripe/STPPaymentOptionsInternalViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,19 @@ - (BOOL)isPaymentOptionDetachable:(id<STPPaymentOption>)paymentOption {
return [self.paymentOptions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id<STPPaymentOption> _Nullable evaluatedObject, NSDictionary<NSString *,id> * __unused _Nullable bindings) {
if ([evaluatedObject isKindOfClass:[STPPaymentMethodParams class]]) {
STPPaymentMethodParams *paymentMethodParams = (STPPaymentMethodParams *)evaluatedObject;
if (paymentMethodParams.type == STPPaymentMethodTypeFPX) {
return NO;
if (paymentMethodParams.type == STPPaymentMethodTypeCard) {
return YES;
}
}
return YES;
return NO;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn'e this still be yes in case it's an STPPaymentMethod?

}]];
}

- (NSArray<id<STPPaymentOption>> *)apmPaymentOptions {
return [self.paymentOptions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id<STPPaymentOption> _Nullable evaluatedObject, NSDictionary<NSString *,id> * __unused _Nullable bindings) {
if ([evaluatedObject isKindOfClass:[STPPaymentMethodParams class]]) {
STPPaymentMethodParams *paymentMethodParams = (STPPaymentMethodParams *)evaluatedObject;
if (paymentMethodParams.type == STPPaymentMethodTypeFPX) {
if (paymentMethodParams.type == STPPaymentMethodTypeFPX) { // Add other APMs as we gain support for them in Basic Integration
return YES;
}
}
Expand Down