ASPaypalManager.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // ASPaypalManager.m
  3. // Asteria
  4. //
  5. // Created by xingyu on 2024/5/14.
  6. //
  7. #import "ASPaypalManager.h"
  8. @implementation ASPaypalManager
  9. - (void)checkoutPayWithMethodType:(NSString *)payType completion:(void (^ __nullable)(NSUInteger isSucess , id payData))completion {
  10. if ([payType isEqualToString:@"paypal_express"]) {//paypal
  11. K_WEAK_SELF;
  12. [ASNetTools.shared postWithPath:postTakeExtraPoints param:@{@"type": @"123"} success:^(id _Nonnull json) {
  13. } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
  14. }];
  15. } else if ([payType isEqualToString:@"stripe_payments"]) {//visa
  16. } else if ([payType isEqualToString:@"afterpay_payment"]) {//afterpay
  17. } else if ([payType isEqualToString:@"klarna_kco"]) {//klarna
  18. } else {
  19. }
  20. }
  21. - (void)tool_gotoWebPay:(NSString *)urlStr withVC:(UIViewController *)tmpvc completion:(void (^ __nullable)(NSUInteger isSucess , id payData))completion{
  22. XXX_BaseWebC *vc = [[XXX_BaseWebC alloc] init];
  23. vc.isPayType = YES;
  24. vc.WebViewBlock = ^(NSUInteger status, id _Nonnull webData) {
  25. if(status == 1){
  26. if(completion){
  27. completion(1, webData);
  28. }
  29. }else{
  30. if(completion){
  31. completion(0, webData);
  32. }
  33. }
  34. };
  35. [vc xxx_dsWebLoadUrl:urlStr];
  36. vc.modalPresentationStyle = UIModalPresentationFullScreen;
  37. [tmpvc presentViewController:vc animated:YES completion:nil];
  38. }
  39. @end