我从 Github 下载了 Cyber Source SDK iOS。它也工作正常。但我需要设置总量,我在 SDK 中找不到任何参数。如何使用 SDK 在网络源中设置金额?
我不知道它是由 SDK 或后端(API)设置的。请在下面检查我的代码:
//Card data
let cardData = InAppSDKCardData.init()
cardData.accountNumber = txtCardNumber.text
cardData.expirationMonth = txtMonth.text
cardData.expirationYear = txtYear.text
cardData.cvNumber = txtCVV.text
//Create Transaction object
let transactionObj = InAppSDKTransactionObject.init()
transactionObj.billTo = getBillToData()
transactionObj.cardData = cardData
//Get the Merchant data and credentials and assign.
transactionObj.merchant = getMerchantData()
//Set the End point / Environment. Test or Live
InAppSDKSettings.sharedInstance()?.inAppSDKEnvironment = INAPPSDK_ENV_TEST
//Enable log for debugging
InAppSDKSettings.sharedInstance()?.enableLog = true
//Obtain the gateway sharted instance.
let gatWay = InAppSDKGateway.sharedInstance()
result = (gatWay?.performPaymentDataEncryption(transactionObj, with: self))!
if (result) {
NSLog("InAppSDK: Request Accepted. Expect the response in the delegate method.");
}
else {
NSLog("InAppSDK: Request NOT Accepted. Verify the input values if any one is invalid.");
}
我得到了这样的回应
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-1623853623"><wsu:Created>2019-08-01T10:25:43.747Z</wsu:Created></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><c:replyMessage xmlns:c="urn:schemas-cybersource-com:transaction-data-1.120"><c:merchantReferenceCode>Cyber_iOS</c:merchantReferenceCode><c:requestID>5646551432976553503004</c:requestID><c:decision>ACCEPT</c:decision><c:reasonCode>100</c:reasonCode><c:requestToken>AhizbwSTMhmkg5ScYGkcEQFRp++q/94CP9hk0ky9GK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CJ0cmFuc2FjdGlvbklkIjoiNTY0NjU1MTQzMjk3NjU1MzUwMzAwNCJ9LCJzaWduYXR1cmVBbGdJbmZvIjoiU0hBMjU2Iiwic2lnbmF0dXJlIjoiNXdya1BuTEtJZWoxV0ZEVjVZNUJEc0orTUg2QkJSN2Zoa2FVM1ZsQzE2OD0iLCJ2ZXJzaW9uIjoiMS4xLjEuMiJ9</c:data></c:encryptedPayment><c:encryptPaymentDataReply><c:reasonCode>100</c:reasonCode><c:requestDateTime>2019-08-01T10:25:43Z</c:requestDateTime></c:encryptPaymentDataReply><c:reserved><ics_message xmlns="urn:schemas-cybersource-com:transaction-data:ics"><encrypt_payment_data_rcode>1</encrypt_payment_data_rcode><ics_return_code>1000000</ics_return_code><encrypt_payment_data_rmsg>Request was processed successfully.</encrypt_payment_data_rmsg><ics_rcode>1</ics_rcode><encrypt_payment_data_return_code>1001000</encrypt_payment_data_return_code><ics_rmsg>Request was processed successfully.</ics_rmsg><request_id>5646551432976553503004</request_id><encrypt_payment_data.reason_code>100</encrypt_payment_data.reason_code><encrypt_payment_data_rflag>SOK</encrypt_payment_data_rflag><request_token>AhizbwSTMhmkg5ScYGkcEQFRp++q/94CP9hk0ky9GK+AnABMoAny</request_token><ics_decision_reason_code>100</ics_decision_reason_code><encrypt_payment_data_request_date_time>2019-08-01T102543Z</encrypt_payment_data_request_date_time><ics_rflag>SOK</ics_rflag><merchant_ref_number>Cyber_iOS</merchant_ref_number><encrypted_payment_data>eyJkYXRhIjoiK1ZrdmNpTDhpcStyeEt2RytTMDl3R05MbTFGZzlRcXZpQUE3K3FWOFNvckJqYnp1b0lcL3VzRUs0RWpDZkpxZ1pJejJRbWd3cjBNdGxpVXltS2k0bERNS3lFZmdHZmlOS1wvOWRIMWpMXC9WaCszbk5nOXV6NVp2eG54OVpJbmExNkpBbmtvMmt0OSs0S2lDdW1TYkVBVlVtSkdrRm12ZFhqYlBRUXFzVXNcL0xjS2tlVEkzb1RrSkhFXC9jWVBkRXRHZU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