//create settings
[MFSettings.sharedInstance setMerchantWithMerchantCodeWithMerchantCode:@"22605019033" merchantName:@"Noora" merchantUserName:@"hello@mynutribox.com" merchantPassword:@"pass" merchantReferenceID:@"201454542190" merchantReturnURL:@"" merchantErrorUrl:@"" udf1:@"" udf2:@"" udf3:@"" udf4:@"" udf5:@"" isTestMode:false];
//setap delegate
[MFOrderStatusRequest sharedInstance].delegateOrderStatus = self;
[MFPaymentRequest sharedInstance].delegatePayment = self;
//Customer info
MFCustomer *customer = [[MFCustomer alloc] init];
customer.customerName = self.nameField.text;
customer.customerEmailAddress = self.emailField.text;
customer.customerMobileNo = self.phoneField.text;
customer.customerGender = @"";
customer.customerDOB = @"";
customer.customerCivilID = @"";
customer.customerArea = @"";
customer.customerBlockNo = @"";
customer.customerStreet = @"";
customer.customerAvenue = @"";
customer.customerBuildingNo = @"";
customer.customerFloorNo = @"";
customer.customerApartment = @"";
NSMutableArray *productList = [@[] mutableCopy];
// create product detail
MFProductDetails *product = [[MFProductDetails alloc] init];
product.productName = @"Fish";
product.productPrice = 1.0;
product.productQuntity = 1.0;
[productList addObject:product];
}
//send request
[MFPaymentRequest.sharedInstance placeOrderWithCustomer:customer productList:productList subTotal:1.0 paymentMode:@"BOTH" paymentCurrrency:@"KWD"];
//implemented delegate methods
#pragma MARK - MFOrderStatusRequestDelegate
- (void)getOrderPaymentStatusSucessWithOrdetStatus:(MFOrderStatusRequestResponse *)ordetStatus {
NSLog(@"%@", ordetStatus.responseCode);
NSLog(@"%@", ordetStatus.result);
dispatch_async(dispatch_get_main_queue(), ^{
});
}
- (void)getOrderPaymentStatusFailedWithOrdetStatus:(MFOrderStatusRequestResponse *)ordetStatus {
NSLog(@"%@", ordetStatus.responseCode);
NSLog(@"%@", ordetStatus.result);
dispatch_async(dispatch_get_main_queue(), ^{
});
}
#pragma MARK - MFOrderStatusRequestDelegate
- (void)paymentSucss {
}
- (void)errorMessageWithError:(NSString * _Nonnull)error {
}
iOS
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.