give
/
src
/
PaymentGateways
/
Gateways
/
Stripe
/
StripePaymentElementGateway
/
Actions
/
UpdateStripeInvoiceMetaData.php
give
/
src
/
PaymentGateways
/
Gateways
/
Stripe
/
StripePaymentElementGateway
/
Actions
Last commit date
AddStripeAttributesToNewForms.php
2 years ago
EnqueueStripeFormBuilderScripts.php
2 years ago
UpdateStripeFormBuilderSettingsMeta.php
2 years ago
UpdateStripeInvoiceMetaData.php
1 year ago
UpdateStripeInvoiceMetaData.php
22 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\Gateways\Stripe\StripePaymentElementGateway\Actions; |
| 4 | |
| 5 | use Give\Donations\Models\Donation; |
| 6 | use Stripe\Invoice; |
| 7 | |
| 8 | /** |
| 9 | * @since 4.3.0 |
| 10 | */ |
| 11 | class UpdateStripeInvoiceMetaData |
| 12 | { |
| 13 | /** |
| 14 | * @since 4.3.0 |
| 15 | */ |
| 16 | public function __invoke(Invoice $invoice, Donation $donation) |
| 17 | { |
| 18 | $invoice->updateAttributes(['metadata' => give_stripe_prepare_metadata($donation->id)]); |
| 19 | $invoice->save(); |
| 20 | } |
| 21 | } |
| 22 |