Skip to content

Conversation

@Anindya007
Copy link

Noticed there is no PaymentMethod facade implementation in the codebase so I provided one. Please review and merge. Thank you.

@kingIZZZY
Copy link
Contributor

kingIZZZY commented Jun 28, 2022

Temporary / hacky workaround:

// add/create
$pm = QuickBooksOnline\API\Facades\FacadeHelper::reflectArrayToObject("PaymentMethod", ['Name' => 'Bitcoin', 'Type' => ['value' => 'NON_CREDIT_CARD']], true );
$pm1 = $dataService->add($pm);

// update - for ex. deactivate (as delete is apparently not supported)
$newObj = FacadeHelper::reflectArrayToObject("PaymentMethod", ['Active' => false], true );
$clonedOfObj = FacadeHelper::cloneObj($pm1);
$pm2 = FacadeHelper::mergeObj($clonedOfObj, $newObj);
$pm3 = $dataService->update($pm2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants