Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 84176299

Von Werner Hahn vor fast 3 Jahren hinzugefügt

  • ID 841762994976f7cdbdf1ab5c4bdcbf9daf8230e1
  • Vorgänger b1a92c56
  • Nachfolger 457e1237

WooCommerce Shopware: paymentid im Shoporder setzen

Unterschiede anzeigen:

SL/ShopConnector/Shopware.pm
11 11
use SL::DB::ShopOrder;
12 12
use SL::DB::ShopOrderItem;
13 13
use SL::DB::History;
14
use SL::DB::PaymentTerm;
14 15
use DateTime::Format::Strptime;
15 16
use SL::DB::File;
16 17
use Data::Dumper;
......
185 186
  my $shop_id      = $self->config->id;
186 187
  my $tax_included = $self->config->pricetype;
187 188

  
189
  # Mapping Zahlungsmethoden muss an Firmenkonfiguration angepasst werden
190
  my %payment_ids_methods = (
191
    # shopware_paymentId => kivitendo_payment_id
192
  );
193
  my $default_payment_id = SL::DB::Manager::PaymentTerm->get_first()->id || undef;
188 194
  # Mapping to table shoporders. See http://community.shopware.com/_detail_1690.html#GET_.28Liste.29
189 195
  my %columns = (
190 196
    amount                  => $import->{data}->{invoiceAmount},
......
232 238
    netamount               => $import->{data}->{invoiceAmountNet},
233 239
    order_date              => $orderdate,
234 240
    payment_description     => $import->{data}->{payment}->{description},
235
    payment_id              => $import->{data}->{paymentId},
241
    payment_id              => $payment_ids_methods{$import->{data}->{paymentId}} || $default_payment_id,
236 242
    remote_ip               => $import->{data}->{remoteAddress},
237 243
    sepa_account_holder     => $import->{data}->{paymentIntances}->{accountHolder},
238 244
    sepa_bic                => $import->{data}->{paymentIntances}->{bic},
SL/ShopConnector/WooCommerce.pm
9 9
use LWP::Authen::Digest;
10 10
use SL::DB::ShopOrder;
11 11
use SL::DB::ShopOrderItem;
12
use SL::DB::PaymentTerm;
12 13
use SL::DB::History;
13 14
use SL::DB::File;
14 15
use Data::Dumper;
......
205 206
    }
206 207
  # Mapping Zahlungsmethoden muss an Firmenkonfiguration angepasst werden
207 208
  my %payment_ids_methods = (
208
                              'paypal'                            => 2489,
209
                              'german_market_purchase_on_account' => 2487,
210
                            );
209
    # woocommerce_payment_method_title => kivitendo_payment_id
210
  );
211
  my $default_payment_id = SL::DB::Manager::PaymentTerm->get_first()->id || undef;
211 212
  my %columns = (
212 213
#billing Shop can have different billing addresses, and may have 1 customer_address
213 214
    billing_firstname       => $import->{billing}->{first_name},
......
297 298
    #prices_include_tax
298 299
    tax_included            => $tax_included,
299 300
    #payment_method
300
    payment_id              => $payment_ids_methods{$import->{payment_method}} || 2487,
301
    payment_id              => $payment_ids_methods{$import->{payment_method}} || $default_payment_id,
301 302
    #payment_method_title
302 303
    payment_description     => $import->{payment_method_title},
303 304
    #transaction_id

Auch abrufbar als: Unified diff