none
Cartao de Credito no banco de dados RRS feed

  • Pergunta

  • Estarei usando Authorize.Net para armazenar os dados dos cartoes de credito dos meus clientes.
    Mas o q preciso estar armazenando em meu banco de dados pra poder fazer essa conexao com o gateway de pagamento ?

    Abracos

    quarta-feira, 16 de outubro de 2019 21:06

Todas as Respostas

  • AGA Neto,

       Você já viu esse exemplo?
       É preciso ter o pacote instalado...
    PM> Install-Package AuthorizeNet

    ==============================================
    Authorize.Net | A Visa Solution
    using System;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Collections.Generic;
    using AuthorizeNet.Api.Controllers;
    using AuthorizeNet.Api.Contracts.V1;
    using AuthorizeNet.Api.Controllers.Bases;
    
    namespace net.authorize.sample
    {
    	public class ChargeCreditCard
    	{
    		public static void Run(String ApiLoginID, String ApiTransactionKey)
    		{
    			Console.WriteLine("Charge Credit Card Sample");
    
    			ApiOperationBase.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
    
    			// define the merchant information (authentication / transaction id)
    			ApiOperationBase.MerchantAuthentication = new merchantAuthenticationType()
    			{
    				name = ApiLoginID,
    				ItemElementName = ItemChoiceType.transactionKey,
    				Item = ApiTransactionKey,
    			};
    
    			var creditCard = new creditCardType
    			{
    				cardNumber = "4111111111111111",
    				expirationDate = "0718"
    			};
    
    			//standard api call to retrieve response
    			var paymentType = new paymentType { Item = creditCard };
    
    			var transactionRequest = new transactionRequestType
    			{
    				transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),   // charge the card
    				amount = 133.45m,
    				payment = paymentType
    			};
    			
    			var request = new createTransactionRequest { transactionRequest = transactionRequest };
    			
    			// instantiate the contoller that will call the service
    			var controller = new createTransactionController(request);
    			controller.Execute();
    			
    			// get the response from the service (errors contained if any)
    			var response = controller.GetApiResponse();
    
    			if (response.messages.resultCode == messageTypeEnum.Ok)
    			{
    				if (response.transactionResponse != null)
    				{
    					Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode);
    				}
    			}
    			else
    			{
    				Console.WriteLine("Error: " + response.messages.message[0].code + "  " + response.messages.message[0].text);
    				if (response.transactionResponse != null)
    				{
    					Console.WriteLine("Transaction Error : " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);
    				}
    			}
    		   
    		}
    	}
    }


    https://developer.authorize.net/hello_world/
    ==============================================

       Veja também:

    ==============================================
    Where in the Authorize.net database is login_id, custtoken and paytoken?

    https://community.developer.authorize.net/t5/Integration-and-Testing/Where-in-the-Authorize-net-database-is-login-id-custtoken-and/td-p/68739
    ==============================================
    Authorize.Net ODBC Driver
    SQL-based Access to Authorize.Net through ODBC 
    Easily connect live Authorize.Net data with BI, ETL, Reporting, & Custom Apps.

    https://www.cdata.com/drivers/authorizedotnet/odbc/
    ==============================================
    understanding database schema

    https://community.developer.authorize.net/t5/Integration-and-Testing/understanding-database-schema/td-p/18824
    ==============================================

    []'s,
    Fabio I.
    • Editado Fabio I quinta-feira, 17 de outubro de 2019 12:01
    quinta-feira, 17 de outubro de 2019 11:56