I’ve made a
form in the back office of Umbraco 7 the problem is that it is the same form as
in the web site. If a user enter their information they will be redirected to
the payment method.
So it is one product on my website.
Users do
not pay in the back office so I use the “Default payment Method Service” pay
method. If I try to create a payment I get some error in my custom pipeline. This
pipeline saves the users info in the database. The error is PurchaseOrder.Orderadress is null. The other information is filled but
only the order address is null.
If I use
this code it work but it can't be the right way:
If I don't change the CultureCode I get the error: no "Confirmationemail" for culture code "en-GB"
So the problem is that the Orderadress stays null after paying with “Default payment Method Service”. And yes the checkout pipeline is attachted to that payment method.
the catch: //Continue processing the data... var orderAddress = order.OrderAddresses.FirstOrDefault();
When you use the back office to do so, why is that? All the API's runs on a basket for a user, so you need to ensure that it can be resolved properly.
You can use the order editor in the backend to process orders from scratch. Everything should be enabled to do so. So why do you need a custom form in the backend?
The Form in the backend will be used by the customers(this will be used locally with the help of a collaborator). for example when a customer pays direct with cash etc.. so they can enter their information and submit that without a online pay method.
You can fix this in a couple of different ways. If what you need in the pipeline is indeed the billing address, you can just use that as it seems you're always setting that up anyway.
The PurchaseOrder.OrderAddresses collection just holds a number of addresses, it doesn't have to hold any though, so it's basically up to you how you want to use it.
I know that, and I actually fill the billing adress. It does work without any problems when I use another payment provider(custom made). this is the code what I use to fill the Billingadres:
Make an order without paying
I’ve made a form in the back office of Umbraco 7 the problem is that it is the same form as in the web site. If a user enter their information they will be redirected to the payment method.
So it is one product on my website.
Users do not pay in the back office so I use the “Default payment Method Service” pay method. If I try to create a payment I get some error in my custom pipeline. This pipeline saves the users info in the database. The error is PurchaseOrder.Orderadress is null. The other information is filled but only the order address is null.
If I use this code it work but it can't be the right way:
basket.PurchaseOrder.AddOrderAddress(basket.PurchaseOrder.BillingAddress);
basket.PurchaseOrder.CultureCode = "nl-NL";
TransactionLibrary.CreatePayment(id);
If I don't change the CultureCode I get the error:
no "Confirmationemail" for culture code "en-GB"
So the problem is that the Orderadress stays null after paying with “Default payment Method Service”. And yes the checkout pipeline is attachted to that payment method.
the catch:
//Continue processing the data...
var orderAddress = order.OrderAddresses.FirstOrDefault();
if (orderAddress == null)
{
string error = String.Concat("CustomCode.Pipeline (", order.OrderId, ") - OrderAdress is null");
Log.Error(error);
throw new ArgumentException(error);
}
I also tried the TransactionLibary.Checkout(); but that doesn't work because the order total is higher than 0 so i need to use a payment method.
I hope you can help me.
Hi Ferry,
When you use the back office to do so, why is that? All the API's runs on a basket for a user, so you need to ensure that it can be resolved properly.
You can use the order editor in the backend to process orders from scratch. Everything should be enabled to do so. So why do you need a custom form in the backend?
Best regards
Morten
Hi morten,
The Form in the backend will be used by the customers(this will be used locally with the help of a collaborator). for example when a customer pays direct with cash etc.. so they can enter their information and submit that without a online pay method.
Anyway thanks for your help.
Best regards, Ferry
Hi Ferry,
You can fix this in a couple of different ways. If what you need in the pipeline is indeed the billing address, you can just use that as it seems you're always setting that up anyway.
The PurchaseOrder.OrderAddresses collection just holds a number of addresses, it doesn't have to hold any though, so it's basically up to you how you want to use it.
The PurchaseOrder.BillingAddress has to be set.
Hope this helps.
Hi Søren,
I know that, and I actually fill the billing adress. It does work without any problems when I use another payment provider(custom made). this is the code what I use to fill the Billingadres:
So this works fine when I use another Payment provider. it only crashes when I use the “Default payment Method Service”.
Best regards,
Ferry
is working on a reply...