#jared-ios-taptopay

1 messages ยท Page 1 of 1 (latest)

severe hazelBOT
deep comet
#

can you share your code as text not pictures? Can you also give a bit more details about which parts returns error 1920 and if you get any more than just the code?

#

jared-ios-taptopay

dreamy acorn
#

sure, one sec, first I call, discover readers and that returns successfully

then we call createIntent in the second screenshot, after that we call collect payment method

deep comet
#

please no pictures

#

we're both devs, I can't do anything with pictures or really small text

dreamy acorn
#

๐Ÿ‘

deep comet
#

Just share the exact raw code, it can be formatted on Discord like you would on most tools

#

I also need the exact/detailed error you get beyond just the code

dreamy acorn
#

here is the header file associated with it

//
//  NewChargeController.m
//  PocketSuite
//
//  Created by Yang Forjindam on 6/30/19.
//  Copyright (c) 2019 PocketSuite. All rights reserved.
//

#import "User.h"
#import "Invoice.h"
#import "Payment.h"
#import "BEMCheckBox.h"
#import "SearchController.h"


typedef enum {
    CHARGE_TYPE_AMOUNT,
    CHARGE_TYPE_ITEMIZE,
    CHARGE_TYPE_AMOUNT_OR_ITEMIZE,
    CHARGE_TYPE_EMPLOYEE
} CHARGE_TYPE;


@interface NewChargeController : SearchController<UITableViewDelegate, UITableViewDataSource, BEMCheckBoxDelegate>
@property (nonatomic, retain) Payment *record;

- (id)initWithClient:(User *)client;
- (id)initWithInvoice:(Invoice *)invoice;
- (id)initWithBooking:(Booking *)booking;
- (id)initWithPackage:(Package *)aPackage;
- (id)initWithCharge:(Charge *)charge;

+ (void)newCharge:(PocketController *)pocketController client:(User *)client;
+ (void)sendPayment:(PocketController *)pocketController person:(User *)person;
@end


deep comet
#

So where is it failing exactly, what exact error do you get, can you log all the details and share that?

dreamy acorn
#

please be patient I am getting you that info

#

Here is the error,

It is failing after calling

ln:422 in the .m file

 [[SCPTerminal shared] collectPaymentMethod:result

with the error

@"A required parameter was invalid or missing."
deep comet
#

cool can you share the lines around that error?

dreamy acorn
#

First we call this and it returns successfully, do you want the server code that creates the intent?

#

here is fetch card where it fails

- (void)fetchCard:(SCPPaymentIntent *)result {
    if (self.checkoutType == CHECKOUT_TYPE_READER)
        [self setReaderStatus:READER_STATUS_READY];

    __weak NewChargeReaderController* weakCR = self;
    self.collectCancelable = [[SCPTerminal shared] collectPaymentMethod:result
                                                             completion:^(SCPPaymentIntent *collectResult, NSError *collectError) {
                                                                 if (collectError) {
                                                                     [weakCR setReaderStatus:READER_STATUS_WARNING statusDisplay:collectError.localizedDescription];
                                                                 }
                                                                 else {
                                                                     // reset local payment intent variable, so we don't try to cancel it on view disappear
                                                                     weakCR.currentPaymentIntent = nil;
                                                                     [weakCR setReaderStatus:READER_STATUS_AUTHORIZING];
                                                                     [weakCR chargeCard:collectResult];
                                                                 }
                                                             }];
}
deep comet
#

can you share a PaymentIntent id?

dreamy acorn
#

@"pi_3MrPyZDxdeYXpVhR1heRnRqz"
@"acct_1MkDl0RXdrCyx91A"

#

That one is a new intent that I just created, and failed

deep comet
#

thanks looking

#

Okay so you set on_behalf_of on PaymentIntent creation but not when you initialized Terminal

dreamy acorn
#

I tried leaving that out and get the same error but I can set it to null their too

dreamy acorn
#

oh the server sets on_behalf_of got it

#

interestingly android doesn't require this, thanks for the help I will give it a shot!