solved payment problems
This commit is contained in:
parent
5885c68bda
commit
f8df6ea06d
|
@ -7,7 +7,7 @@
|
||||||
<key>BaseLibrary.xcscheme</key>
|
<key>BaseLibrary.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>0</integer>
|
<integer>1</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<key>Verdnaturaventas.xcscheme</key>
|
<key>Verdnaturaventas.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>1</integer>
|
<integer>0</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
Binary file not shown.
|
@ -166,8 +166,10 @@ class ControllerPedido: NSObject {
|
||||||
let order = getPedido()
|
let order = getPedido()
|
||||||
|
|
||||||
order.customer_id = order.cliente!.Id_Cliente
|
order.customer_id = order.cliente!.Id_Cliente
|
||||||
order.delivery_method_id = order.agencia!.Vista
|
if order.agencia != nil {
|
||||||
order.agency_id = order.agencia!.Id_Agencia
|
order.delivery_method_id = order.agencia!.Vista
|
||||||
|
order.agency_id = order.agencia!.Id_Agencia
|
||||||
|
}
|
||||||
order.address_id = order.consignatarioActivo?.Id_Consigna
|
order.address_id = order.consignatarioActivo?.Id_Consigna
|
||||||
order.source_app = "IOS"
|
order.source_app = "IOS"
|
||||||
|
|
||||||
|
|
|
@ -319,7 +319,7 @@
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wpn-Qt-7HE">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wpn-Qt-7HE">
|
||||||
<rect key="frame" x="15" y="0.0" width="290" height="30"/>
|
<rect key="frame" x="15" y="0.0" width="290" height="29.5"/>
|
||||||
<fontDescription key="fontDescription" name="Roboto-Regular" family="Roboto" pointSize="20"/>
|
<fontDescription key="fontDescription" name="Roboto-Regular" family="Roboto" pointSize="20"/>
|
||||||
<color key="textColor" red="0.62860941889999999" green="0.62909907099999995" blue="0.62868529559999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="textColor" red="0.62860941889999999" green="0.62909907099999995" blue="0.62868529559999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
|
|
|
@ -20,7 +20,9 @@ class ParserOrder: Parser {
|
||||||
let order = Order()
|
let order = Order()
|
||||||
order.parseJson(jsonDictionary)
|
order.parseJson(jsonDictionary)
|
||||||
order.consignatarioActivo = ParserConsignatario().parse(jsonDictionary["consignatarioActivo"]! as AnyObject)
|
order.consignatarioActivo = ParserConsignatario().parse(jsonDictionary["consignatarioActivo"]! as AnyObject)
|
||||||
order.agencia = ParserAgencias().parseAgencia(jsonDictionary["agencia"] as! NSDictionary)
|
if jsonDictionary["agencia"] != nil {
|
||||||
|
order.agencia = ParserAgencias().parseAgencia(jsonDictionary["agencia"] as! NSDictionary)
|
||||||
|
}
|
||||||
order.PedidoSplitado = (jsonDictionary["PedidoSplitado"] as AnyObject).boolValue
|
order.PedidoSplitado = (jsonDictionary["PedidoSplitado"] as AnyObject).boolValue
|
||||||
if let cliente = jsonDictionary["cliente"]
|
if let cliente = jsonDictionary["cliente"]
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
|
@ -46,20 +46,18 @@ class ViewNavegador: MyViewVentas, UIWebViewDelegate {
|
||||||
|
|
||||||
func generateWebView()
|
func generateWebView()
|
||||||
{
|
{
|
||||||
|
/*Request*/
|
||||||
let url = URL(string: datos!.Url!)
|
var request = URLRequest(url: URL(string:datos!.Url!)!)
|
||||||
let mutableURL = NSMutableURLRequest(url:url!)
|
request.httpMethod = "POST"
|
||||||
mutableURL.httpMethod = "POST"
|
request.httpBody = generateData().data(using:String.Encoding.ascii, allowLossyConversion: false)
|
||||||
let data = generateData().data(using: String.Encoding.utf8)
|
webView.loadRequest(request)
|
||||||
mutableURL.httpBody = data
|
|
||||||
webView.loadRequest(mutableURL as URLRequest)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateData() -> String
|
func generateData() -> String
|
||||||
{
|
{
|
||||||
let data = "Ds_SignatureVersion=\(datos!.DSSignature!)&Ds_MerchantParameters=\(datos!.EncodedParams!)&Ds_Signature=\(datos!.Signature!)"
|
let data = "Ds_SignatureVersion=\(datos!.DSSignature!)&Ds_MerchantParameters=\(datos!.EncodedParams!)&Ds_Signature=\(datos!.Signature!)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!.replacingOccurrences(of: "+", with: "%2B")
|
||||||
|
print(data)
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,11 +75,11 @@ class ViewNavegador: MyViewVentas, UIWebViewDelegate {
|
||||||
handlerFinish: {
|
handlerFinish: {
|
||||||
self.datos = cmd.datos!
|
self.datos = cmd.datos!
|
||||||
self.generateWebView()
|
self.generateWebView()
|
||||||
},
|
},
|
||||||
handlerRetry: {
|
handlerRetry: {
|
||||||
self.showProgress(false)
|
self.showProgress(false)
|
||||||
self.obtenerDatosPasarBanco()
|
self.obtenerDatosPasarBanco()
|
||||||
},
|
},
|
||||||
handlerAccept: {}
|
handlerAccept: {}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -109,13 +107,13 @@ class ViewNavegador: MyViewVentas, UIWebViewDelegate {
|
||||||
handlerFinish: {
|
handlerFinish: {
|
||||||
self.showProgress(false)
|
self.showProgress(false)
|
||||||
self.launchSegue("segueNavegadorFinalizar", sender: Values.CALLBACK_PAGO_OK as AnyObject?)
|
self.launchSegue("segueNavegadorFinalizar", sender: Values.CALLBACK_PAGO_OK as AnyObject?)
|
||||||
},
|
},
|
||||||
handlerRetry: {
|
handlerRetry: {
|
||||||
self.transactionEnd(url, transaccion: transaccion)
|
self.transactionEnd(url, transaccion: transaccion)
|
||||||
},
|
},
|
||||||
handlerAccept: {
|
handlerAccept: {
|
||||||
self.back()
|
self.back()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
execute(cmd);
|
execute(cmd);
|
||||||
|
@ -129,6 +127,8 @@ class ViewNavegador: MyViewVentas, UIWebViewDelegate {
|
||||||
|
|
||||||
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool
|
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if(request.url!.absoluteString == Values.CALLBACK_PAGO_OK || request.url!.absoluteString == Values.CALLBACK_PAGO_ERROR){
|
if(request.url!.absoluteString == Values.CALLBACK_PAGO_OK || request.url!.absoluteString == Values.CALLBACK_PAGO_ERROR){
|
||||||
transactionEnd((request.url?.absoluteString)!, transaccion: NSNumber(value: Int(datos!.DSOrder!)! as Int))
|
transactionEnd((request.url?.absoluteString)!, transaccion: NSNumber(value: Int(datos!.DSOrder!)! as Int))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue