Search code examples
iosiphonepaymentpayment-processingbalanced-payments

how to send href to sever for payment processing using balanced payments in iOS


I am using balanced payments(1.1 version) for payment using credit card.

I have followed sample given at https://github.com/balanced/balanced-ios

iam able to get href from

[balanced createCardWithNumber:[tfCardNumber text]
               expirationMonth:[[tfExpMonth text] integerValue]
                expirationYear:[[tfExpYear text] integerValue]
                     onSuccess:^(NSDictionary *responseParams) {
                         response = responseParams;
                         [tvResponseView setText:[response description]];
                         NSLog(@"%@", response);

                         [self setActivityIndicatorEnabled:NO];
                         [self setResetButton];
                         tvResponseView.alpha = 0.0;
                         [UIView animateWithDuration:0.5 animations:^{
                             [tvResponseView setHidden:NO];
                             tvResponseView.alpha = 1.0;
                         }];
                     }
                       onError:^(NSError *error) {
                           [tvResponseView setText:[response description]];
                           NSLog(@"%@", [error description]);

                           [self setActivityIndicatorEnabled:NO];
                           [self setResetButton];
                       }
                optionalFields:optionalFields];

I want to know how to send href to server and what is the payment process.

Any help or suggestion to proceed.


Solution

  • The library that you are using is only to tokenize the credit cards. It generates the token (href) you'll need to make the charge.

    You need to do that in your backend. You shouldn't do the charge directly in your app because you need to send the credentials from there and it could be intercepted.

    Balanced has libraries for C#, PHP, Node.js, Python, Ruby and Java. You can also can make CURL requests https://docs.balancedpayments.com/1.1/api/cards/#charge-a-card