ios – paypal sdk implementation in Swift UIKit


i am trying to implement Paypal SDK into my ios application, i am facing two problems first is i am not able to have Paylater button, even though i tried different parameters and second is does the implementation of pay later will be different than normal ? i am adding my effort so that you can help me find out issues.

func configurePayPalCheckout() {
      Checkout.setCreateOrderCallback { createOrderAction in
        let amount = PurchaseUnit.Amount(currencyCode: .mxn, value: "1500.00")
        let purchaseUnit = PurchaseUnit(amount: amount)
        let order = OrderRequest(intent: .capture, purchaseUnits: [purchaseUnit])
        createOrderAction.create(order: order)
      }

      Checkout.setOnApproveCallback { approval in
          
        approval.actions.capture { (response, error) in
          print("Order successfully captured: \(response?.data)")
        }
      }
    }

let paymentButton = PaymentButtonContainer()
      view.addSubview(paymentButton)

      NSLayoutConstraint.activate(
        [
          paymentButton.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: 200),
          paymentButton.centerXAnchor.constraint(equalTo: view.centerXAnchor)
        ]
      )

i am stuck with this for days now, i am sorry if its a noob question.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img