[英]How to integrate Citrus payment gateway without asking for login to user in ios?
希望你一切順利。
我正在嘗試將CitrusPay SDK集成到我的iPhone應用程序中。 我如何集成CitrusPay Direct付款而不要求用戶登錄citrus pay。
我想給用戶這樣的選項:
如果用戶想使用Citrus Wallet付款,那么我將要求用戶使用其憑據登錄到柑橘。 如果他們選擇使用信用卡/借記卡或網上銀行付款的第二或第三選項,則無需登錄。
我想使用CitrusPay SDK在我的應用程序中實現此功能。 您能指出我的代碼嗎?
我已經有一個柑橘工資的演示,並且我已經檢查了。
https://github.com/citruspay/citruspay-ios-sdk
我從上面的鏈接下載了演示。
請幫我解決這個問題。
[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];
}
}];
}
}];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.