/// <summary> /// This is where you would send your payment to be processed - here we will /// simply present a confirmation screen. If your payment processor failed the /// payment you would return `completion(PKPaymentAuthorizationStatus.Failure)` instead. Remember to never /// attempt to decrypt the payment token on device. /// </summary> public void DidAuthorizePayment(PKPaymentAuthorizationViewController controller, PKPayment payment, Action <PKPaymentAuthorizationStatus> completion) { paymentToken = payment.Token; var ccApi = CCCAPI.Instance(); //Verifyng - Apple pay token got from apple Console.WriteLine("CC API paymentToken = " + paymentToken); //Card Connect Verifying - Endpoint Console.WriteLine("CC API End point = " + ccApi.Endpoint); ccApi.GenerateTokenForApplePay(payment, (theToken, error) => { //Card Connect token, which should be used to finalize the payment through one of the server sdks of card connect. Console.WriteLine("CC API theToken = " + theToken); if (!String.IsNullOrWhiteSpace(theToken)) { completion(PKPaymentAuthorizationStatus.Success); } else { completion(PKPaymentAuthorizationStatus.Failure); } }); }
public Task <Checkout> CompleteCheckoutAsync(Checkout checkout, PKPaymentToken token, CancellationToken cancellationToken = default(CancellationToken)) { var tcs = new TaskCompletionSource <Checkout>(); var urlTask = CompleteCheckout(checkout, token, (data, error) => HandleCallback(tcs, cancellationToken, data, error)); cancellationToken.Register(urlTask.Cancel); return(tcs.Task); }
/// <summary> /// This is where you would send your payment to be processed - here we will /// simply present a confirmation screen. If your payment processor failed the /// payment you would return `completion(PKPaymentAuthorizationStatus.Failure)` instead. Remember to never /// attempt to decrypt the payment token on device. /// </summary> public void DidAuthorizePayment(PKPaymentAuthorizationViewController controller, PKPayment payment, Action <PKPaymentAuthorizationStatus> completion) { paymentToken = payment.Token; completion(PKPaymentAuthorizationStatus.Success); PerformSegue(confirmationSegue, this); }
/// <summary> /// This is where you would send your payment to be processed - here we will /// simply present a confirmation screen. If your payment processor failed the /// payment you would return `completion(PKPaymentAuthorizationStatus.Failure)` instead. Remember to never /// attempt to decrypt the payment token on device. /// </summary> public void DidAuthorizePayment (PKPaymentAuthorizationViewController controller, PKPayment payment, Action<PKPaymentAuthorizationStatus> completion) { paymentToken = payment.Token; completion (PKPaymentAuthorizationStatus.Success); PerformSegue (confirmationSegue, this); }