Wednesday 15 September 2010

How Do I Create a Sales Order with Payment Settings through Acumatica API -



How Do I Create a Sales Order with Payment Settings through Acumatica API -

i trying create sales order using acumatica web service api. have been able pass required fields except payment settings. our installation uses authorize.net (px.ccprocessing.authorizenettokenizedprocessing) add-in. possible interact authorize.net add-in through api creating new payment method , authorizing payment employees can work order within acumatica , capture payment there.

below code using create sales order. not sure construction utilize in order activate "create new payment profile id" action through api itself. through gui, opens popup window copies card authorize.net , saves payment profile id record within acumatica.

so301000content so301000 = context.so301000getschema(); context.so301000clear(); so301000content[] so30100content = context.so301000submit ( new command[] { //add header info new value { value = "so", linkedcommand = so301000.ordersummary.ordertype }, new value { value = "<new>", linkedcommand = so301000.ordersummary.ordernbr }, new value { value = "999999", linkedcommand = so301000.ordersummary.customer }, //add line items so301000.documentdetails.servicecommands.newrow, new value { value = "ss1121", linkedcommand = so301000.documentdetails.inventoryid }, new value { value = "2", linkedcommand = so301000.documentdetails.quantity }, so301000.documentdetails.servicecommands.newrow, new value { value = "ss1122", linkedcommand = so301000.documentdetails.inventoryid }, new value { value = "2", linkedcommand = so301000.documentdetails.quantity }, so301000.documentdetails.servicecommands.newrow, new value { value = "ss1123", linkedcommand = so301000.documentdetails.inventoryid }, new value { value = "2", linkedcommand = so301000.documentdetails.quantity }, //add shipping info new value { value = "true", linkedcommand = so301000.shippingsettingsshiptoinfooverridecontact.overridecontact }, new value { value = "demo church ship", linkedcommand = so301000.shippingsettingsshiptoinfooverridecontact.businessname }, new value { value = "true", linkedcommand = so301000.shippingsettingsshiptoinfo.overrideaddress }, new value { value = "123 test street", linkedcommand = so301000.shippingsettingsshiptoinfo.addressline1 }, new value { value = "buford", linkedcommand = so301000.shippingsettingsshiptoinfo.city }, new value { value = "ga", linkedcommand = so301000.shippingsettingsshiptoinfo.state }, new value { value = "30519", linkedcommand = so301000.shippingsettingsshiptoinfo.postalcode }, new value { value = "freeship", linkedcommand = so301000.shippingsettingsshippinginformation.shipvia }, //add totals new value { value = "10.00", linkedcommand = so301000.totals.premiumfreight }, new value { value = "94.0000", linkedcommand = so301000.totals.packageweight }, //add payment so301000.actions.save, so301000.ordersummary.ordernbr } );

new code error - able insert client payment record receive error when trying insert card existing sales order.

here code:

so301000content so301000 = context.so301000getschema(); context.so301000clear(); so301000content[] so30100content = context.so301000submit ( new command[] { //add header info new value { value = "so", linkedcommand = so301000.ordersummary.ordertype }, new value { value = "000129", linkedcommand = so301000.ordersummary.ordernbr }, //add payment new value { value = "visa", linkedcommand = so301000.paymentsettings.paymentmethod }, new value { value = "visa:****-****-****-7261", linkedcommand = so301000.paymentsettings.cardaccountno }, so301000.actions.save } );

if has ideas, appreciate it. thanks.

you can't utilize "create new payment profile id", because relies on actual user in web browser (we show authorize.net new profile page in iframe). limit exposure of application pci compliance, , way no credit card number or sensitive info ever touches acumatica server. should add together payment profile straight through authorize.net cim site or cim apis, , pass profile id acumatica.

unfortunately can't pass client profile id straight order, payment profile value accepted input, you'll first need add together entry using client payment methods screen api.

ar303010content ar301000 = context.ar303010getschema(); context.ar303010clear(); ar303010content[] ar303010content = context.ar303010submit( new command[] { new value { value = "999999", linkedcommand = ar301000.paymentmethodselection.customer }, new value { value = "visatok", linkedcommand = ar301000.paymentmethodselection.paymentmethod }, new value { value = "authtok", linkedcommand = ar301000.paymentmethodselection.proccenterid }, new value { value = "102000", linkedcommand = ar301000.paymentmethodselection.cashaccount }, new value { value = "23640304", linkedcommand = ar301000.paymentmethodselection.customerprofileid }, new value { value = "27187006", fieldname = "value", objectname = "ccpiddet"}, //payment profile id, going straight internal ccpiddet view bypass validation error when using ar301000.paymentmethoddetails.value ar301000.actions.save, ar301000.paymentmethodselection.cardaccountno }); string cardaccountno = ar303010content[0].paymentmethodselection.cardaccountno.value;

then when create sales order, need specify card used, returned ar301000 after creation process:

//add payment new value { value = "visatok", linkedcommand = so301000.paymentsettings.paymentmethod }, new value { value = cardaccountno, linkedcommand = so301000.paymentsettings.cardaccountnocardaccountno }, //use card business relationship number returned earlier, "visatok:****-****-****-1111"

acumatica

No comments:

Post a Comment