Hope you are doing well.
I am trying to integrate CitrusPay SDK to my iPhone application. How can i integrate CitrusPay Direct payment without asking user to login to citrus pay.
I want to give options to user like :
If user would like to pay using Citrus Wallet then i will ask user to login to citrus using their credentials. If they will go with 2nd or 3rd option like pay using Credit Card/Debit Card or net banking then they don't need to login.
I want to implement this function in my app using CitrusPay SDK. Can you point out me for the code of this?
I already have a demo of the Citrus pay and i already checked it.
https://github.com/citruspay/citruspay-ios-sdk
I downloaded the demo from the above link.
Please help me out for this.
[CitrusPaymentSDK enableDEBUGLogs];
CTSKeyStore *keyStore = [[CTSKeyStore alloc] init];
keyStore.signinId = SignInId;
keyStore.signinSecret = SignInSecretKey;
keyStore.signUpId = SubscriptionId;
keyStore.signUpSecret = SubscriptionSecretKey;
keyStore.vanity = VanityUrl;
[CitrusPaymentSDK initializeWithKeyStore:keyStore environment:CTSEnvSandbox];
[CitrusPaymentSDK enableDEBUGLogs];
//CC, DC payments
CTSElectronicCardUpdate *creditCard = [[CTSElectronicCardUpdate alloc] initCreditCard]; //for debit card use > initDebitCard
creditCard.number = @"";
creditCard.expiryDate = @"XX/XX"; //only mm/yyyy format
creditCard.scheme = [CTSUtility fetchCardSchemeForCardNumber:creditCard.number]; //fetch card scheme
creditCard.ownerName = @"XXXXXXXX"; // no special characters here
creditCard.cvv = @"XXX";
CTSPaymentLayer *paymentLayer = [CitrusPaymentSDK fetchSharedPaymentLayer];
CTSPaymentDetailUpdate *paymentInfo = [[CTSPaymentDetailUpdate alloc] init];
[paymentInfo addCard:creditCard];
CTSContactUpdate* contactInfo;
CTSUserAddress* addressInfo;
contactInfo = [[CTSContactUpdate alloc] init];
contactInfo.firstName = @"";
contactInfo.lastName = @"";
contactInfo.email = @"";
contactInfo.mobile = @"";
addressInfo = [[CTSUserAddress alloc] init];
addressInfo.city = TEST_CITY;
addressInfo.country = TEST_COUNTRY;
addressInfo.state = TEST_STATE;
addressInfo.street1 = TEST_STREET1;
addressInfo.street2 = TEST_STREET2;
addressInfo.zip = TEST_ZIP;
[CTSUtility requestBillAmount:@"X" billURL:BillUrl callback: ^(CTSBill *bill , NSError *error){
if(error){
dispatch_async(dispatch_get_main_queue(), ^{
});
[UIUtility toastMessageOnScreen:error.localizedDescription];
}
else {
[paymentLayer requestDirectChargePayment:paymentInfo withContact:contactInfo withAddress:addressInfo bill:bill returnViewController:self withCompletionHandler:^(CTSCitrusCashRes *citrusCashResponse, NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
// [self.indicatorView stopAnimating];
// self.indicatorView.hidden = TRUE;
});
if(error){
[UIUtility toastMessageOnScreen:error.localizedDescription];
}
else {
[UIUtility toastMessageOnScreen:[NSString stringWithFormat:@"Payment Status %@",[citrusCashResponse.responseDict valueForKey:@"TxStatus"] ]];
// [self resetUI];
}
}];
}
}];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.