|
9 | 9 | use Magento\Customer\Api\Data\AddressInterface;
|
10 | 10 | use Magento\Customer\Api\Data\CustomerInterface;
|
11 | 11 | use Magento\Framework\DB\Transaction;
|
| 12 | +use Magento\OfflinePayments\Model\Checkmo; |
12 | 13 | use Magento\Sales\Api\CreditmemoItemRepositoryInterface;
|
13 | 14 | use Magento\Sales\Api\CreditmemoRepositoryInterface;
|
14 | 15 | use Magento\Sales\Api\Data\CreditmemoItemInterfaceFactory;
|
|
60 | 61 | AddressInterface::CITY => 'Los Angeles',
|
61 | 62 | CustomerInterface::EMAIL => 'admin@example.com',
|
62 | 63 | AddressInterface::TELEPHONE => '11111111',
|
63 |
| - AddressInterface::COUNTRY_ID => 'US' |
| 64 | + AddressInterface::COUNTRY_ID => 'US', |
64 | 65 | ];
|
65 | 66 | $product = $productRepository->get('simple');
|
| 67 | +/** @var AddressFactory $addressFactory */ |
66 | 68 | $addressFactory = $objectManager->get(AddressFactory::class);
|
67 | 69 | $billingAddress = $addressFactory->create(['data' => $addressData]);
|
68 | 70 | $billingAddress->setAddressType(Address::TYPE_BILLING);
|
|
71 | 73 | /** @var OrderPaymentInterfaceFactory $paymentFactory */
|
72 | 74 | $paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class);
|
73 | 75 | $payment = $paymentFactory->create();
|
74 |
| -$payment->setMethod('checkmo') |
| 76 | +$payment->setMethod(Checkmo::PAYMENT_METHOD_CHECKMO_CODE) |
75 | 77 | ->setAdditionalInformation('last_trans_id', '11122')
|
76 | 78 | ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]);
|
77 | 79 | /** @var OrderItemInterface $orderItem */
|
|
0 commit comments