、ありがとうございました。私は、チェック以下のコードを添付し、私に知らせてください:
var braintree: Braintree?
braintree = Braintree(clientToken: "")
func userDidCancelPayment() {
self.dismiss(animated: true, completion: nil)
}
func drop(_ viewController: BTDropInViewController!, didSucceedWith paymentMethod: BTPaymentMethod!) {
print(paymentMethod.nonce)
// Send payment method nonce to your server
dismiss(animated: true, completion: nil)
let alert = UIAlertController(title: "Alert", message: "Send payment method nonce to your server Sucessfully", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
func tappedMyPayButton()
{
let dropInViewController = braintree!.dropInViewController(with: self)
dropInViewController.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action: #selector(PaymentVController.userDidCancelPayment))
let navigationController = UINavigationController(rootViewController: dropInViewController)
self.present(navigationController, animated: true, completion: nil)
}
func drop(inViewControllerDidCancel viewController: BTDropInViewController!) {
dismiss(animated: true, completion: nil)
}
ビザ:4242 4242 4242 4242 マスター:5555 5555 5555 4444 アメリカン・エキスプレス:3782 822463 10005 重要な注意:任意の将来の有効期限を使用して、名前にカード、CVC、Billing Zipをテストモードで使用します。